Skip to content

Conversation

@siliconsheep
Copy link
Member

@siliconsheep siliconsheep commented May 12, 2025

Checklist

  • [ x ] I have read the Contributor Guide
  • [ x ] I have read and agree to the Code of Conduct
  • [ x ] I have added a description of my changes and why I'd like them included in the section below

Description of Changes

As of conftest v0.60.0, the default version of Rego syntax is v1 [1]. This PR updates all policies to use this syntax. Another breaking change came with this version as well (or rather v0.59.0) [2], where hcl2json will consistently use array when using repeated blocks ([3] and [4]). Current (internal) uses are checked for breaking changed. All files were formatted / pre-processed with opa fmt --write --v0-v1

Related Issues

[1] https://github.com/open-policy-agent/conftest/releases/tag/v0.60.0
[2] https://github.com/open-policy-agent/conftest/releases/tag/v0.59.0
[3] open-policy-agent/conftest#1074
[4] open-policy-agent/conftest#1006

@siliconsheep siliconsheep marked this pull request as ready for review May 12, 2025 13:25
@siliconsheep siliconsheep requested a review from a team as a code owner May 12, 2025 13:25
@siliconsheep siliconsheep marked this pull request as draft May 12, 2025 13:32
@siliconsheep siliconsheep marked this pull request as ready for review May 12, 2025 13:40
Comment on lines -6 to +8
input := {
"resource": {
"google_compute_firewall": {
"f1": {
"name": "f1",
"source_ranges": ["0.0.0.0/0"],
"allow": {
"ports":["22", "5432"]
}
}
}
}
}
test_deny_compute_firewall_unrestricted if {
inp := {"resource": {"google_compute_firewall": {"f1": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this formatting, maybe this and others like it was ported to v1 syntax manually? I would format consistently or just at least we can leave a small comment on this PR for how the porting was done for posterity's sake

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all files were preprocessed with opa fmt --write --v0-v1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll also copy this comment in the PR description for increased visibility 👌

@siliconsheep siliconsheep merged commit 02f9263 into EmbarkStudios:main May 13, 2025
2 checks passed
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