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

Ensure the validationfile loader passes the full caveats to the typesystem #2042

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

josephschorr
Copy link
Member

Fixes #2001

@josephschorr josephschorr requested a review from a team as a code owner August 26, 2024 21:28
@github-actions github-actions bot added the area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) label Aug 26, 2024
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

See questions, otherwise LGTM

@@ -121,6 +124,7 @@ func PopulateFromFilesContents(ctx context.Context, ds datastore.Datastore, file
ts, err := typesystem.NewNamespaceTypeSystem(objectDef,
typesystem.ResolverForDatastoreReader(rwt).WithPredefinedElements(typesystem.PredefinedElements{
Namespaces: objectDefs,
Caveats: caveatDefs,
Copy link
Contributor

Choose a reason for hiding this comment

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

I take it this was the root of it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Likely, yes, although I wasn't able to fully reproduce

Comment on lines +9 to +11
caveat some_caveat(somecondition int) {
somecondition == 42
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Was the issue that the caveat was defined below the resource?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, but I figured I'd add a test just the same

@josephschorr josephschorr added this pull request to the merge queue Aug 29, 2024
Merged via the queue into authzed:main with commit 9117c68 Aug 29, 2024
22 checks passed
@josephschorr josephschorr deleted the validationfile-load-fixes branch August 29, 2024 16:28
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failed to create datastore: failed to load bootstrap files: could not lookup caveat
2 participants