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

No support for Rego.v1 #1049

Open
perithompson opened this issue Jan 23, 2025 · 3 comments
Open

No support for Rego.v1 #1049

perithompson opened this issue Jan 23, 2025 · 3 comments

Comments

@perithompson
Copy link

When trying to integrate conftest into atlantis policy-checks I am encountering errors when writing policies as per the conftest documentation, this seems to be due to a lack of support for rego.v1

rego_parse_error: if keyword is required before rule body

>> conftest --version    
Conftest: 0.56.0
OPA: 0.69.0

Please could we have updates to how to use conftest with rego.v1 and have some documentation on how exceptions and denies work when importing rego.v1 instead so that the contains and if keywords are used

@charlieegan3
Copy link

charlieegan3 commented Jan 23, 2025

As a starting point, we have a guide here for projects integrating with OPA's go packages here: https://www.openpolicyagent.org/docs/latest/v0-upgrade/#upgrading-for-go-integrations. I am about to close up my working week here, but @ me if I can help at all here.

@jalseth
Copy link
Member

jalseth commented Jan 25, 2025

I will look into bumping Conftest's dependency to Rego v1 soon. It does have breaking changes, so we'll likely need to update the examples, docs, etc.

@perithompson In the interim, you can add import rego.v1 to your Rego policies and update them with V1 syntax. This has been supported since OPA v0.59 https://docs.styra.com/regal/rules/imports/use-rego-v1#rationale.

@perithompson
Copy link
Author

i think i tried import rego.v1 and it gave me a series of errors in conftest, i will try again, for now ive been importing future.keywords.in etc

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

No branches or pull requests

3 participants