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

Move caveat loading into a shared runner to reduce overhead in dispatch #2179

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

josephschorr
Copy link
Member

@josephschorr josephschorr commented Dec 20, 2024

Rather than re-processing the caveat on each iteration of the relationships loop in LR2, we use a caching loader to only process once per caveat

@josephschorr josephschorr requested a review from a team as a code owner December 20, 2024 16:55
@github-actions github-actions bot added area/api v1 Affects the v1 API area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Dec 20, 2024
}

func runExpression(
// RunCaveatExpression runs a caveat expression over the given context and returns the result.
func (cr *CaveatRunner) RunCaveatExpression(
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we might be missing a unit test for this new struct and method.

Copy link
Member Author

Choose a reason for hiding this comment

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

RunSingleCaveatExpression does invoke this method, but I'll add a unit test just the same

Copy link
Member Author

Choose a reason for hiding this comment

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

Added

Copy link
Contributor

@alecmerdler alecmerdler left a comment

Choose a reason for hiding this comment

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

Nice improvement!

@josephschorr josephschorr added this pull request to the merge queue Dec 30, 2024
Merged via the queue into authzed:main with commit 98172d2 Dec 30, 2024
23 checks passed
@josephschorr josephschorr deleted the caveat-opts branch December 30, 2024 18:48
@github-actions github-actions bot locked and limited conversation to collaborators Dec 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/api v1 Affects the v1 API 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.

2 participants