docs(postgres): document direct-policy semantics of user search aggregates#1699
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR adds clarifying documentation comments to two repository query methods. ChangesPolicy Query Method Documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report for CI Build 27408055809Coverage remained the same at 43.285%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Summary
SearchUserProjects/SearchUserOrganizations(admin search aggregates) return only resources the principal holds a direct policy on. The membership listing path (ListProjectsByUseretc.) additionally expands group-held policies and org-level inheritance — so an org admin with no direct project policies sees every org project in listings but zero in search.This divergence is pre-existing and became visible once the listing semantics were made explicit in the membership package. After review, the decision is to keep both behaviors as-is and document them:
Mirroring membership's 3-way inheritance union into the aggregate SQL would add significant complexity for semantics that aren't clearly wanted in admin search; narrowing the listing path would regress end-user behavior.
Changes
Doc comments on
UserProjectsRepository.buildBaseQueryandUserOrgsRepository.buildBaseQueryexplaining the intentional divergence and warning against "fixing" one side to match the other without a product decision. No functional changes.Test plan
go build ./...and postgres repo tests pass (comment-only change)