Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add v0 compatibility section to OPA 1.0 doc #5

Merged

Conversation

charlieegan3
Copy link

@charlieegan3 charlieegan3 commented Nov 19, 2024

This covers the v0-compatible mode for the different use cases, leaving the SDK as todo.

Migration paths to come in another PR.

releases:

{{< info >}}
TODO: unsure if support for v0-compatible is to be as broad as v1-compatible?
Copy link
Owner

Choose a reason for hiding this comment

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

I think there is similar coverage for both. If not we should make that change.

Copy link
Owner

@ashutosh-narkar ashutosh-narkar left a comment

Choose a reason for hiding this comment

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

@charlieegan3 this looks great! Few comments 👇

releases:

{{< info >}}
TODO: unsure if support for v0-compatible is to be as broad as v1-compatible?
Copy link
Owner

Choose a reason for hiding this comment

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

Can we remove this? Or do you have any questions here?

TODO: unsure if support for v0-compatible is to be as broad as v1-compatible?
{{< /info >}}

- `bench`: supports `rego.v0` syntax modules, use of `import rego.v1` is optional.
Copy link
Owner

Choose a reason for hiding this comment

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

Do you think this will give users an impression that there is rego.v0 ref and they can do import rego.v0?

support a gradual upgrade path.

The `SetRegoVersion` method on [Module](https://github.com/open-policy-agent/opa/blob/f6103df603789b6123ab98118e6ee01677c4930a/ast/policy.go#L469)
can be used like this:
Copy link
Owner

Choose a reason for hiding this comment

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

```

Similarly, the [Bundle Manifest](https://github.com/open-policy-agent/opa/blob/f6103df603789b6123ab98118e6ee01677c4930a/bundle/bundle.go#L174) Rego version
can be set like this:
Copy link
Owner

Choose a reason for hiding this comment

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

is also an option depending on your context.

The rest of this documentation is designed to meet users where they find
themselves and direct them down the lowest risk path to upgrade to OPA v1.0.
Copy link
Owner

Choose a reason for hiding this comment

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

What about instead of lowest risk path we use something like direct them down the smoothest transition path ...

### Next

Downgrade consumers to v0.x ([Scenario 1](#scenario-1)) until all consumers are
v0, then start the upgrade process again.
Copy link
Owner

Choose a reason for hiding this comment

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

Or they could also go to Scenario 6 🤔 .


#### Pre-requisites

If v1 consumers cannot be run with `--v0-compatible`. When using a v0 consumer
Copy link
Owner

Choose a reason for hiding this comment

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

Nit: Is this sentence complete If v1 consumers cannot be run with `--v0-compatible`.?

rejected by v0.x bundle producers.

Similarly, on the consumer side. If `--v0-compatible` cannot be set on the
consumers, the bundles from v1 producers will not be accepted. `rego.v0` imports
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think we plan to add a rego.v0 import.


### Scenario 9

TODO: explain this scenario represents the user being done!
Copy link
Owner

Choose a reason for hiding this comment

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

Can we please add the text and remove the TODO?


TODO: explain this scenario represents the user being done!

### Scenario 10
Copy link
Owner

Choose a reason for hiding this comment

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

Is this needed?

The guide adds new pages for backwards compatibility and migration
to v1. The v1 docs have been moved into the migration guide instead.

Signed-off-by: Charlie Egan <[email protected]>
@ashutosh-narkar ashutosh-narkar merged commit c72434b into ashutosh-narkar:1.0-docs Nov 28, 2024
23 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