chore(deps): bump OPA to v1.19.0 and regenerate compliance fixtures - #181
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theand/orkeywordsstrings/test-splitn.json—strings.split_naggregates,arithmeticandstrings/format-intChanges to existing fixtures are upstream metadata only: fuller
object/dynamictype info on thejson.filterandjson.removedecls, anobject.subsetdescription tweak, andstmtlocations now serializing asrow: 0, col: 0.format_intprecisionformat_introutedRegoBigIntandRegoDecimalvalues throughLong.toString(longValue()), so integers wider than 64 bits wrapped —format_int(18446744073709551617, 10)returned"1". It now formats theBigIntegerdirectly and truncates decimals toward zero viaBigDecimal.toBigInteger(), matching OPA's round-down-to-integer semantics.Builtin name in builtin errors
Under strict builtin errors,
invokeBuiltinrethrowsTypeErrorasnew 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). TheBuiltinErrorbranch rethrew unchanged, soto_number("foo")surfaced aseval_builtin_error: invalid syntaxwith no indication of which builtin failed.BuiltinErrornow has the same name-wrapping constructor asTypeError, tracking the raw cause so nested rethrows don't double-prefix. This is what the two newlogic_operatorsshort-circuit cases were asserting on.Testing
./gradlew testis green across all modules;:opa-evaluator:testis 2719/2719 passing.