Skip to content

Remove legacy Rego compat shim (follow-up to Rego v1)#185

Merged
whitemerch merged 1 commit into
mainfrom
chakib.hamie/remove_rego_compat_shim
Jun 15, 2026
Merged

Remove legacy Rego compat shim (follow-up to Rego v1)#185
whitemerch merged 1 commit into
mainfrom
chakib.hamie/remove_rego_compat_shim

Conversation

@whitemerch

@whitemerch whitemerch commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Motivation

This is a small follow-up to PR #179. After defaulting the engine to Rego v1, the dd_iac_compat shim still merged results from the pre-rename data.Cx.CxPolicy path even though every shipped rule now exposes data.datadog.DatadogPolicy. The CxPolicy leg is unused dead code; removing it drops an extra OPA module from every evaluation and simplifies the top-level query.

Changes

Engine

Stop injecting dd_iac_compat.rego alongside rule modules.

Query defaults

Set RegoQuery to result = data.datadog.DatadogPolicy and delete the RegoCompatShim constant.

Author Checklist

  • I have reviewed my own PR.
  • I have added or updated relevant unit tests where necessary. If no tests are added, I've explained why.
  • All new and existing tests pass.
  • I have tested my changes on staging (if applicable).
  • I have updated any relevant documentation (if applicable).

QA Instruction

  1. go test ./pkg/engine/... ./pkg/utils/... ./pkg/scan/...
  2. Run a scan against a fixture or project that uses Datadog-sourced rules and confirm findings still appear as before.

Blast Radius

Datadog IaC Scanner OPA evaluation only: rule modules must continue to define package datadog with a DatadogPolicy rule set, which is already the contract after the rename migration.

Additional Notes

None.

I submit this contribution under the Apache-2.0 license.

@whitemerch
whitemerch marked this pull request as ready for review June 15, 2026 16:19
@whitemerch
whitemerch requested a review from a team as a code owner June 15, 2026 16:19
@datadog-prod-us1-3

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 48.33% (-0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1f41b31 | Docs | Datadog PR Page | Give us feedback!

@whitemerch
whitemerch merged commit d787b27 into main Jun 15, 2026
19 of 20 checks passed
@whitemerch
whitemerch deleted the chakib.hamie/remove_rego_compat_shim branch June 15, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants