Migrate rule policies to Rego v1#398
Open
dakshhhhh16 wants to merge 1 commit into
Open
Conversation
Author
|
@evankanderson |
Member
|
I need to look into why the tests are failing in this repo. |
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.
Summary
This PR migrates the Rego policies in
minder-rules-and-profilesto Rego v1 syntax as Phase 2 of the Rego v1 migration work from mindersec/minder#5262.Child issue mindersec/minder#6463
It adds a reusable migration helper that extracts embedded YAML
def: |policy blocks, runsopa fmt --v0-v1, and writes the formatted Rego back into place. The migration also updates docs/examples so downstream users have a repeatable path for their own rule type YAML.What changed
scripts/migrate-rego-v1.pyand atask migrate-rego-v1target.import rego.v1.future.keywordsusage from policy docs and examples.Validation
python3 scripts/migrate-rego-v1.py --check .git diff --checkgo test ./...Notes for reviewers
This should be a syntax-only migration. Any policy behavior change should be treated as unintended unless called out during review.