Skip to content

Migrate rule policies to Rego v1#398

Open
dakshhhhh16 wants to merge 1 commit into
mindersec:mainfrom
dakshhhhh16:rego-v1-policy-migration
Open

Migrate rule policies to Rego v1#398
dakshhhhh16 wants to merge 1 commit into
mindersec:mainfrom
dakshhhhh16:rego-v1-policy-migration

Conversation

@dakshhhhh16
Copy link
Copy Markdown

@dakshhhhh16 dakshhhhh16 commented May 19, 2026

Summary

This PR migrates the Rego policies in minder-rules-and-profiles to 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, runs opa 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

  • Added scripts/migrate-rego-v1.py and a task migrate-rego-v1 target.
  • Migrated embedded Rego policies in rule types, security-baseline rule types, and autofill-insights rule types to import rego.v1.
  • Removed future.keywords usage from policy docs and examples.
  • Kept the migration script idempotent and whitespace-safe for YAML block scalars.

Validation

  • python3 scripts/migrate-rego-v1.py --check .
  • git diff --check
  • go 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.

@dakshhhhh16 dakshhhhh16 requested a review from a team as a code owner May 19, 2026 09:04
@dakshhhhh16
Copy link
Copy Markdown
Author

@evankanderson
You can have a look into this. It will lead to close of issue #6463 and I can further start working on phase 3

@evankanderson
Copy link
Copy Markdown
Member

I need to look into why the tests are failing in this repo.

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.

2 participants