Merged
Conversation
…tested properly leading to false negatives.
There was a problem hiding this comment.
Pull request overview
This pull request adds node scope support to the compiler and fixes test issues where stats counts were not being properly validated, leading to false negatives in tests.
Changes:
- Changed
StatsTtype frommap[string]anytomap[string]int64for type safety - Added a
negativeboolean field to test cases to distinguish between tests that expect problems vs. those that shouldn't - Changed compiler scope from
ScopeDefaulttoScopeNodeand added a default plugin for the node scope
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/pkg/ux/ux.go | Changed StatsT type definition from map[string]any to map[string]int64 for consistent type handling |
| internal/pkg/ux/eval.go | Updated FinalStats to cast uint32 values to int64 to match new StatsT type |
| internal/pkg/ux/eval_test.go | Removed redundant type assertions since StatsT now returns int64 directly |
| test/preq_test.go | Added negative field to test struct and switched to proper conditional logic for validating stats based on test expectations; removed unnecessary uint32 cast |
| internal/pkg/engine/engine.go | Added node scope plugin and changed compilation scope from ScopeDefault to ScopeNode |
Comments suppressed due to low confidence (1)
test/preq_test.go:191
- The test case 'Example21-miss' in TestMissExamples uses the same rule and data files as 'Example21' in TestSuccessExamples. However, 'Example21' in TestSuccessExamples is marked with
negative: true(expecting no problems), while 'Example21-miss' expects no problems. This appears to be a duplicate test case. Consider removing the duplicate or clarifying the different expected behaviors with distinct test data.
"Example21-miss": {
rulePath: "../examples/21-negative-example.yaml",
dataPath: "../examples/21-example.log",
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aleksmaus
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix tests; the stats count was not being tested properly leading to false negatives.