Skip to content

Migrate test policies to Rego v1#6462

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

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

Conversation

@dakshhhhh16
Copy link
Copy Markdown
Contributor

@dakshhhhh16 dakshhhhh16 commented May 19, 2026

Summary

This PR migrates Minder's embedded Rego test fixtures, sample rule YAML, and Rego docs examples to Rego v1 syntax as part of Phase 2 of #5262. (Parent issue)
Child issue #6463

The production evaluator already supports Rego version detection. This change moves the policy corpus we own toward the Rego v1 baseline by replacing v0 syntax and future.keywords examples with import rego.v1.

What changed

  • Migrated embedded Rego snippets in evaluator and rtengine tests to Rego v1 syntax.
  • Updated Minder sample/fixture rule YAML and quickstart policy YAML to import rego.v1.
  • Updated Rego documentation snippets to stop recommending future.keywords imports.
  • Refreshed the affected mindpak fixture hash after the YAML policy migration.

Validation

  • git diff --check
  • go test ./pkg/mindpak ./internal/engine/eval/... ./pkg/engine/v1/rtengine ./pkg/api/protobuf/go/minder/v1 ./cmd/cli/app/ruletype ./cmd/cli/app/quickstart
  • go test ./... was also attempted. It reaches unrelated failures in internal/engine/actions/remediate/pull_request where tests cannot create a temporary git repository in this local environment.

Notes for reviewers

This is intended to be a syntax-only migration. The remaining v0 snippets in internal/engine/eval/rego/version_test.go are deliberate detector coverage and do not use future.keywords.

@dakshhhhh16 dakshhhhh16 requested a review from a team as a code owner May 19, 2026 09:05
@dakshhhhh16 dakshhhhh16 force-pushed the rego-v1-test-policy-migration branch from 6a2f24a to 19d8a53 Compare May 19, 2026 09:06
@coveralls
Copy link
Copy Markdown

coveralls commented May 19, 2026

Coverage Status

Coverage is 60.446%dakshhhhh16:rego-v1-test-policy-migration into mindersec:main. No base build found for mindersec:main.

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