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

v1 SDK - full move #7192

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

johanfylling
Copy link
Contributor

An alternative to the v1 SDK PR and the v0 global-toggle PR.

  • v1 SDK: Somewhat messy, where some parts of the go API is moved to v1, but some (most) aren't.
  • v0 global-toggle: Contentious:
    • devs need to make code changes to remain on v0 behavior
    • global toggle forces lib devs to not rely on default rego-version if there is a risk of competing OPA dependencies that rely on different default
    • If default rego-version is set to v0 instead of v1, OPA 1.0 doesn't fully commit to one version, and will be stuck in the past.

This 3rd option moves all (with some exceptions) of OPA proper to the v1 package, and old root packages only contains type aliases and proxy functions.

Pros:

  • Cleaner interface than the original v1 SDK option
  • No global toggle; devs select what rego-version is the default through import paths

Cons:

  • Most packages, types, and functions will now have two options: one in the root for v0; and one under the v1 package for v1. Devs will need to make sure they're not mixing-and-matching their imports improperly. IDE auto-complete can lead you astray.
  • Somewhat larger maintainer burden (because of above point)

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
for:

* compiler
* parser
* bundle compiler
* rego SDK
* OPA SDK

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
@johanfylling
Copy link
Contributor Author

Conflicting files
ast/builtins.go
ast/index.go
ast/internal/scanner/scanner.go
ast/map.go
ast/term.go
debug/debugger.go
format/format.go
rego/rego.go
storage/disk/config_test.go
storage/disk/disk_test.go
storage/disk/partition_test.go
storage/disk/paths_test.go
topdown/builtins.go
topdown/crypto_test.go
topdown/errors_test.go
topdown/eval.go
topdown/eval_test.go
topdown/exported_test.go
topdown/http.go
topdown/http_test.go
topdown/input_test.go
topdown/json_test.go
topdown/jsonschema_test.go
topdown/lineage/lineage_test.go
topdown/object.go
...

Oh bother, this'll be fun 😩 ..

Conflicts:
	ast/builtins.go
	ast/index.go
	ast/map.go
	ast/term.go
	debug/debugger.go
	format/format.go
	rego/rego.go
	topdown/builtins.go
	topdown/http.go
	topdown/query.go
	types/types.go
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
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