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

Check data structure improvements #2037

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

josephschorr
Copy link
Member

Moves around and cleans up some data structures used in check

@josephschorr josephschorr requested a review from a team as a code owner August 20, 2024 20:17
@github-actions github-actions bot added the area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) label Aug 20, 2024
tstirrat15
tstirrat15 previously approved these changes Aug 21, 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 comments, otherwise LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

Are there there any meaningful changes between this and the deleted file?

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; it was moved

@@ -100,9 +100,7 @@ func (tss *TrackingSubjectSet) getSetForKey(key string) datasets.BaseSubjectSet[
fs.excludedSubjects = excludedSubjects
fs.caveatExpression = caveatExpression
for _, source := range sources {
if source.relationships != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why isn't this check necessary anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved it into the set impl

return iHasCaveat && !jHasCaveat
})

chunkCount := 0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

The float here surprises me - is that intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes; we use it for the Prometheus metric below

internal/developmentmembership/onrset_test.go Show resolved Hide resolved
internal/graph/check.go Show resolved Hide resolved
internal/graph/check.go Show resolved Hide resolved
internal/graph/check.go Show resolved Hide resolved
internal/graph/check.go Show resolved Hide resolved
internal/graph/checkdispatchset_test.go Show resolved Hide resolved
internal/graph/checkdispatchset_test.go Show resolved Hide resolved
This new set does all the tracking and mapping previously handled by the ONRTypeSet and a custom multimap, in a more compact and better tested implementation

This also allows us to avoid requiring all results for those redispatches that do not have caveats, even if one of the subject types does
@josephschorr
Copy link
Member Author

Updated

@vroldanbet vroldanbet added this pull request to the merge queue Sep 3, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 3, 2024
@josephschorr josephschorr added this pull request to the merge queue Sep 3, 2024
Merged via the queue into authzed:main with commit b45ed66 Sep 3, 2024
22 checks passed
@josephschorr josephschorr deleted the check-improvements branch September 3, 2024 17:45
@github-actions github-actions bot locked and limited conversation to collaborators Sep 3, 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.

3 participants