Skip to content

chore(deps): bump OPA to v1.19.0 and regenerate compliance fixtures - #181

Merged
sspaink merged 3 commits into
open-policy-agent:mainfrom
sspaink:bumpopa
Jul 30, 2026
Merged

chore(deps): bump OPA to v1.19.0 and regenerate compliance fixtures#181
sspaink merged 3 commits into
open-policy-agent:mainfrom
sspaink:bumpopa

Conversation

@sspaink

@sspaink sspaink commented Jul 30, 2026

Copy link
Copy Markdown
Member

Bumps the compliance-test generator to OPA v1.19.0 and regenerates the Rego compliance fixtures via tools/generate-compliance-tests/regenerate.sh, plus the two SDK fixes the new fixtures surfaced.

New upstream coverage

  • logic_operators/ — 20 files for the and/or keywords
  • strings/test-splitn.jsonstrings.split_n
  • bignum cases in aggregates, arithmetic and strings/format-int

Changes to existing fixtures are upstream metadata only: fuller object/dynamic type info on the json.filter and json.remove decls, an object.subset description tweak, and stmt locations now serializing as row: 0, col: 0.

format_int precision

format_int routed RegoBigInt and RegoDecimal values through Long.toString(longValue()), so integers wider than 64 bits wrapped — format_int(18446744073709551617, 10) returned "1". It now formats the BigInteger directly and truncates decimals toward zero via BigDecimal.toBigInteger(), matching OPA's round-down-to-integer semantics.

Builtin name in builtin errors

Under strict builtin errors, invokeBuiltin rethrows TypeError as new TypeError(name, e) so the message carries the failing builtin, matching OPA's <builtin>: <message> convention seen across the fixtures (div: divide by zero, array.concat: operand 1 must be array but got object). The BuiltinError branch rethrew unchanged, so to_number("foo") surfaced as eval_builtin_error: invalid syntax with no indication of which builtin failed.

BuiltinError now has the same name-wrapping constructor as TypeError, tracking the raw cause so nested rethrows don't double-prefix. This is what the two new logic_operators short-circuit cases were asserting on.

Testing

./gradlew test is green across all modules; :opa-evaluator:test is 2719/2719 passing.

sspaink added 2 commits July 30, 2026 15:51
Bump the generator's OPA dependency to v1.19.0 and re-run
tools/generate-compliance-tests/regenerate.sh.

New upstream coverage:
- logic_operators/ for the `and`/`or` keywords
- strings/test-splitn.json for strings.split_n
- bignum cases in aggregates, arithmetic and strings/format-int

Existing fixtures pick up upstream metadata changes only: fuller
object/dynamic type info on the json.filter and json.remove decls, an
object.subset description tweak, and zeroed stmt locations.

Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
format_int routed RegoBigInt and RegoDecimal values through
Long.toString(longValue()), so integers wider than 64 bits wrapped:
format_int(18446744073709551617, 10) returned "1".

Format the BigInteger directly, and truncate decimals toward zero via
BigDecimal.toBigInteger() to match OPA's round-down-to-integer
semantics. Covered by the new strings/format_int bignum fixture.

Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
Under strict builtin errors, TypeError is rethrown as
`new TypeError(name, e)` so the message carries the failing builtin,
matching OPA's `<builtin>: <message>` format. The BuiltinError branch
rethrew the exception unchanged, so `to_number("foo")` surfaced as
`eval_builtin_error: invalid syntax` with no indication of which
builtin failed.

Give BuiltinError the same name-wrapping constructor as TypeError,
tracking the raw cause so nested rethrows do not double-prefix, and use
it when propagating from invokeBuiltin. Fixes the two new
logic_operators short-circuit compliance cases.

Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
@sspaink
sspaink marked this pull request as ready for review July 30, 2026 20:56
@sspaink
sspaink requested a review from a team as a code owner July 30, 2026 20:56
@sspaink
sspaink merged commit cfac079 into open-policy-agent:main Jul 30, 2026
19 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.

1 participant