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

Don't explode grants from the DB #5104

Merged
merged 8 commits into from
Sep 17, 2024
Merged

Conversation

jefferai
Copy link
Member

@jefferai jefferai commented Sep 12, 2024

This stops us from doing a Cartesian product on grants and scopes. Unfortunately, the DB part was easy; a lot of other code relied on the idea that any grant from the DB would be exploded, so the vast majority of the changes are adapting the rest of the system.

This removes the Cartesian product in the DB for GrantsForUser in favor
of returning the actual grant scope information and dealing with it in
application code.

Pagination for resolvable aliases is yet to come, the rest should be
done and pass local tests.
Copy link
Member

@tmessi tmessi left a comment

Choose a reason for hiding this comment

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

Added some comments for some minor things I noticed. I'm still looking at the query itself and I'll take another look when the rest of the tests are added.

internal/perms/grants_test.go Outdated Show resolved Hide resolved
internal/alias/target/repository_alias_list_resolvable.go Outdated Show resolved Hide resolved
internal/perms/acl.go Outdated Show resolved Hide resolved
internal/perms/acl.go Outdated Show resolved Hide resolved
internal/perms/acl.go Outdated Show resolved Hide resolved
internal/perms/acl.go Outdated Show resolved Hide resolved
internal/perms/acl.go Outdated Show resolved Hide resolved
internal/iam/repository_role_grant_test.go Show resolved Hide resolved
@jefferai jefferai marked this pull request as ready for review September 13, 2024 21:04
@jefferai jefferai merged commit 7556359 into llb-cache-speedup Sep 17, 2024
55 checks passed
@jefferai jefferai deleted the jefferai-no-splode branch September 17, 2024 14:07
jefferai added a commit that referenced this pull request Sep 18, 2024
This removes the Cartesian product in the DB for GrantsForUser in favor
of returning the actual grant scope information and dealing with it in
application code.
tmessi pushed a commit that referenced this pull request Sep 23, 2024
This removes the Cartesian product in the DB for GrantsForUser in favor
of returning the actual grant scope information and dealing with it in
application code.
tmessi pushed a commit that referenced this pull request Sep 24, 2024
This removes the Cartesian product in the DB for GrantsForUser in favor
of returning the actual grant scope information and dealing with it in
application code.

(cherry picked from commit 913cd53)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants