Skip to content

Update to Rego v0.65.0#147

Merged
matajoh merged 7 commits intomicrosoft:mainfrom
matajoh:update-rego
Jun 12, 2024
Merged

Update to Rego v0.65.0#147
matajoh merged 7 commits intomicrosoft:mainfrom
matajoh:update-rego

Conversation

@matajoh
Copy link
Member

@matajoh matajoh commented Jun 12, 2024

New Features

  • Updated the supported version of Rego to v0.65.0.
  • json.marshal_with_options
  • numbers.range_step
  • rego.v1 import and behaviour, plus a set of tests in regov1.yaml
  • The interpreter now returns more than one Result when appropriate, and separates out the Bindings and Terms.
  • The output of rego is now JSON instead of plain text
  • Added regoOutputSize, regoExpressions, regoBindingsAtIndex, and regoExpressionsAtIndex to the C API
  • Updated the Python and Rust wrappers to use the new API

Breaking Changes

  • Output of rego tool has changed. Any downstream tooling that was parsing that will need to be updated to parse the JSON.
  • rego::wf_result has changed. Any tooling that was using the output node directly will need to be updated
  • the add_* methods on Interpreter, as they now perform parsing, now produce either a nullptr if successful or an error Node. Downstream consumers that were checking the boolean return value will need to be updated. Behavior in the C API is unchanged, but there will now be detailed parse/compile errors when an individual module etc. fails to compile.

Closes #140
Closes #145
Fixes #109
Fixes #110
Fixes #111
Fixes #117
Fixes #121

**New Features**
- Updated the supported version of Rego to v0.65.0.
- `json.marshal_with_options`
- `numbers.range_step`
- `rego.v1` import and behaviour, plus a set of tests in `regov1.yaml`
- The interpreter now returns more than one `Result` when appropriate, and separates out the `Bindings` and `Terms`.
- The output of `rego` is now JSON instead of plain text
- Added `regoOutputSize`, `regoExpressions`, `regoBindingsAtIndex`, and `regoExpressionsAtIndex` to the C API
- Updated the Python and Rust wrappers to use the new API

**Breaking Changes**
- Output of `rego` tool has changed. Any downstream tooling that was parsing that will need to be updated to parse the JSON.
- `rego::wf_result` has changed. Any tooling that was using the output node directly will need to be updated
- the `add_*` methods on `Interpreter`, as they now perform parsing, now produce either a `nullptr` if successful or an error `Node`.
  Downstream consumers that were checking the boolean return value will need to be updated. Behavior in the C API is unchanged, but
  there will now be detailed parse/compile errors when an individual module etc. fails to compile.

Signed-off-by: Matthew Johnson <matjoh@microsoft.com>
matajoh added 6 commits June 12, 2024 14:09
Signed-off-by: Matthew Johnson <matjoh@microsoft.com>
Signed-off-by: Matthew Johnson <matjoh@microsoft.com>
Signed-off-by: Matthew Johnson <matjoh@microsoft.com>
Signed-off-by: Matthew Johnson <matjoh@microsoft.com>
Signed-off-by: Matthew A Johnson <matjoh@microsoft.com>
Signed-off-by: Matthew A Johnson <matjoh@microsoft.com>
@matajoh matajoh merged commit 6f4f038 into microsoft:main Jun 12, 2024
@matajoh matajoh deleted the update-rego branch June 12, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

Comments