Skip to content

SMQ-2704 - Update listing of group hierarchy #2710

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

felixgateru
Copy link
Contributor

What type of PR is this?

This is a refactor as it updates the list groups hierarchy fucntionality to follow the new listing methodology

What does this do?

This pr refactors listing groups for a user from SpiceDB to the groups repo method.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Yes, I have updated tests for my changes.

Did you document any new/modified feature?

No

Notes

None

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.48%. Comparing base (2bee2ef) to head (f1a7a63).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2710      +/-   ##
==========================================
- Coverage   42.13%   41.48%   -0.65%     
==========================================
  Files         351       24     -327     
  Lines       48109     5093   -43016     
==========================================
- Hits        20269     2113   -18156     
+ Misses      25631     2814   -22817     
+ Partials     2209      166    -2043     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@felixgateru felixgateru marked this pull request as ready for review February 14, 2025 13:23
@felixgateru felixgateru requested a review from a team as a code owner February 14, 2025 13:23
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Comment on lines 183 to 189
return HierarchyPage{}, errors.Wrap(svcerr.ErrViewEntity, err)
}
hids := svc.getGroupIDs(hp.Groups)
ids, err := svc.filterAllowedGroupIDsOfUserID(ctx, session.DomainUserID, "read_permission", hids)
ids, err := svc.filterAllowedGroupIDsOfUserID(ctx, session.DomainID, session.UserID, hids)
if err != nil {
return HierarchyPage{}, errors.Wrap(svcerr.ErrViewEntity, err)
}
Copy link
Contributor

@arvindh123 arvindh123 Mar 13, 2025

Choose a reason for hiding this comment

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

We should use different approach, This is legacy way which is inefficient and will not scale.
We should follow the approach used for listing groups.
I will come up with SQL, or idea to approach this..

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.

Update listing of groups by userID
2 participants