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

Added namespaced scopes #80

Merged
merged 12 commits into from
Mar 22, 2024
Merged

Added namespaced scopes #80

merged 12 commits into from
Mar 22, 2024

Conversation

jaredoconnell
Copy link
Contributor

@jaredoconnell jaredoconnell commented Feb 21, 2024

Changes introduced with this PR

This PR adds namespaced references, allowing scopes only under a certain namespace to apply.
This allows referencing objects from other scopes without ID collisions.

To make this work, references have an optional namespace field, and ApplyScope has a namespace field so that it knows which refs it applies to.
Since an apply scope may happen after initial construction of the scope, an additional method, ValidateReferences, is added to ensure that all scopes are applied.

As designed, an empty string is considered the default scope. Let me know if you think that should be changed.

Example of use: arcalot/arcaflow-engine#167

By contributing to this repository, I agree to the contribution guidelines.

Copy link

@dbutenhof dbutenhof left a comment

Choose a reason for hiding this comment

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

A few first impressions on a quick skim through...

schema/ref.go Outdated Show resolved Hide resolved
schema/ref.go Outdated Show resolved Hide resolved
webbnh

This comment was marked as resolved.

@jaredoconnell
Copy link
Contributor Author

I updated the link to point to a draft PR instead.

webbnh

This comment was marked as resolved.

webbnh

This comment was marked as resolved.

Copy link
Contributor

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

GTG

schema/ref.go Show resolved Hide resolved
@jaredoconnell jaredoconnell merged commit 6f51550 into main Mar 22, 2024
3 checks passed
@jaredoconnell jaredoconnell deleted the namespaced-scopes branch March 22, 2024 16:59
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.

None yet

4 participants