Skip to content

Commit

Permalink
Remove code to workaround bug fixed in OPA v0.68.0 (#1032)
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Eknert <[email protected]>
anderseknert authored Aug 30, 2024
1 parent 6fac539 commit 29d16c6
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ report contains violation if {
some part in ast.named_refs(rule.head.ref)
not util.is_snake_case(part.value)

violation := result.fail(rego.metadata.chain(), _location(rule, part))
violation := result.fail(rego.metadata.chain(), result.ranged_location_from_text(part))
}

report contains violation if {
@@ -22,9 +22,3 @@ report contains violation if {

violation := result.fail(rego.metadata.chain(), result.ranged_location_from_text(var))
}

_location(_, part) := result.ranged_location_from_text(part) if part.location

# workaround until https://github.com/open-policy-agent/opa/issues/6860
# is fixed and we can trust that location is included for all ref parts
_location(rule, part) := result.ranged_location_from_text(rule.head) if not part.location
Original file line number Diff line number Diff line change
@@ -164,7 +164,6 @@ test_success_snake_cased_every if {
r == set()
}

# https://github.com/open-policy-agent/opa/issues/6860
test_fail_location_provided_even_when_not_in_ref if {
r := rule.report with input as ast.with_rego_v1(`foo.Bar := true`)
r == expected_with_locations([{

0 comments on commit 29d16c6

Please sign in to comment.