Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --v1-compatible flag to commands #6463

Closed
johanfylling opened this issue Dec 7, 2023 · 3 comments
Closed

Add --v1-compatible flag to commands #6463

johanfylling opened this issue Dec 7, 2023 · 3 comments

Comments

@johanfylling
Copy link
Contributor

johanfylling commented Dec 7, 2023

When applied to commands other than fmt and check, the --rego-v1 flag should enforce that all supplied modules are compatible with OPA v1.0, but not require the rego.v1 or future.keywords imports.
Essentially, using the --rego-v1 flag should make OPA parse, compile, and evaluate policies as if 1.0.

E.g. this is a valid module in OPA 1.0:

package example

# Notice: no imports

allow if {
  count(violations) == 0
}

violations contains msg if {
  ...
}

Commands:

  • build
  • check
  • eval
  • fmt
  • test

Commands supported at a later date (#6520):

  • bench
  • deps
  • exec
  • inspect
  • run
  • parse
@johanfylling johanfylling self-assigned this Dec 12, 2023
johanfylling added a commit to johanfylling/opa that referenced this issue Dec 12, 2023
Fixes: open-policy-agent#6463
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
johanfylling added a commit to johanfylling/opa that referenced this issue Dec 12, 2023
Fixes: open-policy-agent#6463
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
ashutosh-narkar pushed a commit to johanfylling/opa that referenced this issue Dec 19, 2023
Fixes: open-policy-agent#6463
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
ashutosh-narkar pushed a commit to johanfylling/opa that referenced this issue Dec 19, 2023
Fixes: open-policy-agent#6463
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
johanfylling added a commit to johanfylling/opa that referenced this issue Dec 19, 2023
Adding `--v1-compatible` flag to `opa test`

Fixes: open-policy-agent#6463
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
johanfylling added a commit to johanfylling/opa that referenced this issue Dec 19, 2023
Fixes: open-policy-agent#6463
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
johanfylling added a commit to johanfylling/opa that referenced this issue Dec 19, 2023
Fixes: open-policy-agent#6463
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
@johanfylling johanfylling changed the title Add --rego-v1 flag to more commands Add --v1-compatible flag to more commands Dec 20, 2023
@johanfylling
Copy link
Contributor Author

It has been decided that we should use the --v1-compatible flag instead of --rego-v1.

@frek818
Copy link

frek818 commented Jan 18, 2024

@johanfylling, I notice that this issue is closed but the PR (#6520) is still open. Do you know if this feature will make into opa soon.

@johanfylling
Copy link
Contributor Author

The scope of this issue was redefined to the build, check, fmt, eval, and test commands. I've updated the description to reflect this.

PR #6521 implements #6520; which adds --v1-compatible support to the remaining applicable commands: bench, deps, exec, inspect, run, and parse. This is expected to be included in the next release (0.61.0).

I hope this clarifies things. Thanks for making us aware of the issue 😃.

@johanfylling johanfylling changed the title Add --v1-compatible flag to more commands Add --v1-compatible flag to commands Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants