feat: Add support for custom OPA command line arguments#1576
Merged
james00012 merged 4 commits intomainfrom Aug 29, 2025
Merged
feat: Add support for custom OPA command line arguments#1576james00012 merged 4 commits intomainfrom
james00012 merged 4 commits intomainfrom
Conversation
Contributor
Author
|
Hi @jsok, PTAL |
Contributor
Author
|
Thanks for your patience @jsok, this should be ready for review again. |
e8262b7 to
7bfbf3d
Compare
…tibility - Add ExtraArgs field to EvalOptions to pass custom flags to OPA eval - ExtraArgs are placed after 'eval' subcommand (OPA has no true global flags) - Update Rego policies for OPA v1.0+ syntax (if keyword, contains keyword) - Create v0-compatible policy for testing with --v0-compatible flag - Add TestOPAEvalTerraformModuleWithExtraArgs to verify functionality - Update documentation to explain ExtraArgs usage Note: TestOPAEvalTerraformModuleRemotePolicy may temporarily fail until merged to main
7bfbf3d to
c08feb4
Compare
- Fixed Rego v1.0 syntax errors in test policies (allow := true if) - Upgraded CI OPA version from v0.33.1 to v1.1.0 to support --v0-compatible flag - Removed version detection from ExtraArgs test since CI now uses OPA v1.1.0 - Added skip condition to remote policy test due to syntax mismatch - Updated policy documentation for version compatibility
denis256
approved these changes
Aug 19, 2025
denis256
previously approved these changes
Aug 21, 2025
Member
|
Looks ok, but the code needs to be cleaned: |
17b4c22 to
5908409
Compare
denis256
approved these changes
Aug 28, 2025
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.
Description
This PR adds support for passing custom command-line arguments to OPA eval commands and fixes compatibility with OPA v1.0+.
Key Changes
Added ExtraArgs field to EvalOptions
--v0-compatible,--format json)evalsubcommand and before standard argumentsFixed OPA v1.0+ compatibility
ifkeyword for rule bodiescontainskeyword for partial set rules--v0-compatibleflagWhy These Changes Were Necessary
--v0-compatiblefor backward compatibility)Note
TestOPAEvalTerraformModuleRemotePolicymay temporarily fail in CI until this PR is merged to main, as it downloads the policy from the main branch which still has the old syntax.