Repository navigation
feat(store): domain, group, role, and service user reads skip soft-deleted rows - #1938
Conversation
…leted rows Every read in the domain, group, role, service user, and service user credential repositories goes through fromLive, or adds the live filter where the query aliases the table. Updates keyed by id add the filter too. The policy subquery in ListMissingOrgPolicy only counts live policies. The organization title subqueries in the service user create and delete paths stay on the plain From. They only attribute the audit record, and the trail must stay attributed after the organization is deleted. Domains and service users had no repository test suite, so this adds one for each. Groups and roles get a case in their existing suites.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: raystack/frontier/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 SummarySummary by CodeRabbit
WalkthroughChangesRepository reads and mutations now exclude soft-deleted domains, groups, roles, service users, credentials, and policies. Integration tests verify the behavior across these repositories. Soft-delete repository filtering
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change makes soft-deleted records invisible to repository reads and mutations while preserving live-record behavior; the supplied coverage shows the intended not-found and filtering behavior, so it is ready to merge. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
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 35712212722Coverage increased (+0.8%) to 51.546%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
|
Tested live on a local server built from this branch (main with #1931 and #1936 merged). Fixtures: a verified domain on a live org, two groups with members, a custom org role bound to a user, two service users with Basic credentials and a minted access token, a service user project policy, and a throwaway org with its own service user. Ran every affected RPC before and after setting
One gap worth planning for before service users can be soft-deleted:
Pre-existing internal errors that soft delete makes easier to hit. Each returns 500 instead of not found today, even for a random uuid:
Minor: CreateServiceUserCredential succeeds under a hidden service user (the credential cannot authenticate). ListServiceUserCredentials still lists a hidden service user's credentials. DeleteServiceUserCredential on a hidden credential hard-deletes it and reports success. ListProjectGroups and ListProjectServiceUsers drop the principal from the list but keep it in No behaviour change today since no row has |
Last of three PRs that make the identity repositories skip soft-deleted rows. Follows #1931 and #1936.
What
fromLive, or addslive("s")where the query aliases the table.livefilter. The policy subquery inListMissingOrgPolicyonly counts live policies.From. They only attribute the audit record.ON CONFLICTupsert is unchanged. It moves with the unique constraint in a later PR.Behaviour change
None today. No row has
deleted_atset yet.Tested
Domains and service users had no repository suite, so this adds one for each. Groups and roles get a case in their existing suites. Each test soft-deletes a row and checks every get, list, and update skips it, comparing counts before and after. Store package passes with
-race.