Skip to content

Various small fixes#1736

Merged
anderseknert merged 1 commit intoopen-policy-agent:mainfrom
anderseknert:small-fixes
Oct 29, 2025
Merged

Various small fixes#1736
anderseknert merged 1 commit intoopen-policy-agent:mainfrom
anderseknert:small-fixes

Conversation

@anderseknert
Copy link
Member

  • Add debugging configuration to enable inlineValues in project
  • Don't use hardcoded "/" in eval test paths (as that won't work on Windows)
  • More efficient input creation in aggregate lint step

- Add debugging configuration to enable inlineValues in project
- Don't use hardcoded "/" in eval test paths (as that won't work on Windows)
- More efficient input creation in aggregate lint step

Signed-off-by: Anders Eknert <anders@eknert.com>
Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicks only

}
},
// Enable to have values displayed inline during debugging
// The default value is "auto", which consults the language extension on whethher
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// The default value is "auto", which consults the language extension on whethher
// The default value is "auto", which consults the language extension on whether

}

createWithContent(t, tmpDir+"/workspace/foo/bar/input."+tc.fileExt, tc.fileContent)
inputPath := filepath.Join(workspacePath, "foo", "bar", "input."+tc.fileExt)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filepath.Join is quite clever, I think you should be able to do this, too:

Suggested change
inputPath := filepath.Join(workspacePath, "foo", "bar", "input."+tc.fileExt)
inputPath := filepath.Join(workspacePath, "foo/bar/input."+tc.fileExt)

Join also calls Clean, so it'll adjust your / and \ as needed, IIRC.

Comment on lines +872 to +878
regal := ast.ObjectTerm(
ast.Item(ast.InternedTerm("operations"), ast.ArrayTerm(ast.InternedTerm("aggregate"))),
ast.Item(ast.InternedTerm("file"), ast.ObjectTerm(
ast.Item(ast.InternedTerm("name"), ast.InternedTerm("__aggregate_report__")),
ast.Item(ast.InternedTerm("lines"), ast.InternedEmptyArray),
)),
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I wonder if the compiler will raise this out of the function body, since it's constant... alternatively, you could do that, if this is called more than once, perhaps in the LSP scenario.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, definitely for the LSP scenario! Will update 👍

Comment on lines +441 to 449
policies := make(map[string]string, 2)
policies["foo.rego"] = `package foo
import data.bar

default allow := false
`
policies["bar.rego"] = `package bar
import data.foo.allow
`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
policies := map[string]string{
"foo.rego": `package foo
import data.bar
default allow := false
`,
"bar.rego": `package bar
import data.foo.allow
`,
}

@anderseknert anderseknert merged commit 70449b7 into open-policy-agent:main Oct 29, 2025
8 checks passed
@anderseknert anderseknert deleted the small-fixes branch October 29, 2025 14:14
@anderseknert
Copy link
Member Author

@srenatus I'll come back to address your (all valid!) points later. Highest priority now is to just get as many of the windows tests to work before we prepare the next release, so I merged this so @charlieegan3 (who's also working on this) and I have a shared state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants