Display sandbox projects with ancestor chain in credentials UI - #5110
Open
brandonjackson wants to merge 2 commits into
Open
Display sandbox projects with ancestor chain in credentials UI#5110brandonjackson wants to merge 2 commits into
brandonjackson wants to merge 2 commits into
Conversation
The "Projects with access" column on the credentials page and the project picker in the credential and OAuth client forms listed sandboxes by bare name, so they were indistinguishable from top-level projects. Sandboxes are now labelled with their ancestor chain (parent/sandbox), matching Project.display_name/1 used elsewhere in the app. Projects.preload_ancestors/1 accepts a list of projects and loads every ancestor chain in a single recursive query so the credentials table does not issue one query per sandbox. Purged sandboxes already drop out of these lists because deleting a project removes its project_credentials; a test now covers that, along with soft-deleted sandboxes still appearing during their grace period. Closes CON-147 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QvkXbFNgyfpGMBosr4qP1
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QvkXbFNgyfpGMBosr4qP1
Security Review ✅
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes how sandboxes are listed in the credentials UI. The "Projects with access" column on the credentials page, the OAuth clients table, and the project chips in the credential and OAuth client forms showed sandboxes by bare name, so a sandbox looked identical to a top-level project. Sandboxes are now labelled with their ancestor chain, e.g.
parent/sandbox, matching the convention used byProject.display_name/1in the breadcrumbs and project picker.Key changes:
Projects.preload_ancestors/1now also accepts a list of projects and loads every ancestor chain in a single recursive CTE query, so the credentials page does not issue one query per sandbox.CredentialIndexComponentresolves display names once for all distinct projects across credentials and OAuth clients.projects_pickercomponent and the credential / OAuth client form components label selected projects, dropdown options, and the revoke-access confirmation with the ancestor chain.project_credentials, so purged sandboxes drop out of the list, while soft-deleted sandboxes remain visible during their grace period.Closes CON-147
Validation steps
/credentials, check the credential row shows chipsparent-nameandparent-name/sandbox-name.parent-name/sandbox-name.Additional notes for the reviewer
parent:sandboxwith a colon. The existingProject.display_name/1, breadcrumbs, and project picker all join with/, so this PR follows the slash for consistency. Switching to a colon would be a one-line change inProject.display_name/1.AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer)🤖 Generated with Claude Code
https://claude.ai/code/session_019QvkXbFNgyfpGMBosr4qP1