Repository navigation
Conversation
Keep repository writes separately authorized while allowing signed-in repository viewers to compose and copy kickoff prompts. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Treat a hidden repository during the Copilot handoff check as a denial, show Create to mock readers, and align the mock flow documentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Align mock Create and Branch from here with the visibility-based kickoff policy and update navigation tests that still expected readers to lack Create. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Kickoff authorization interacts with GitHub, Entra, administrator sessions, visibility rules, and separate mutation gates, requiring review beyond the limited straightforward-change scope.
No open issues 🎉
What changed in this PR
This PR separates starting a prototype session from repository write access. Following the workflow introduced in #305, signed-in members who can see a repository can prepare prompts and continue in Copilot, while repository mutations remain separately permission-gated.
Changes:
- Replace write-based handoff checks with repository visibility checks.
- Enable reader Create and branching flows, with distinct errors for lost access and unavailable access checks.
- Update regression coverage, Storybook states, and frontend documentation.
| File | Description |
|---|---|
hub/server/routes/api/repositories/templates/index.ts |
Use visibility for template creation and handoff eligibility. |
hub/server/routes/api/repositories/templates/index.test.ts |
Cover visible members, denied access, provider failures, and revoked sessions. |
hub/server/routes/api/repositories/templates/index.db.test.ts |
Check reader handoffs remain separate from listing management. |
hub/server/routes/api/repositories/prototypes/show/get/index.ts |
Allow visible hosted members to start from prototypes. |
hub/server/routes/api/repositories/prototypes/show/get/index.test.ts |
Cover reader branching eligibility and visibility failures. |
hub/server/routes/api/product/template-repository-access/index.ts |
Remove the write-based Copilot handoff helper. |
hub/server/routes/api/product/can-start-prototype-session/index.ts |
Add a shared visibility-based session eligibility helper. |
hub/docs/frontend.md |
Document reader handoffs and separate mutation permissions. |
hub/client/pages/new-prototype-page/stories.tsx |
Replace the disabled reader story with submit-time error states. |
hub/client/hooks/use-copilot-handoff/index.ts |
Make access-check error wording provider-neutral. |
hub/client/application/hub/view-models/repository-workspace/index.ts |
Expose Create navigation in mock reader flows. |
hub/client/application/hub/view-models/prototype-show-data/index.ts |
Enable mock branching independently of write capabilities. |
hub/client/application/hub/routes/sidebar-consistency.test.tsx |
Expect Create navigation for readers. |
hub/client/application/hub/routes/sharing-navigation.test.tsx |
Preserve Create navigation when sharing access is denied. |
hub/client/application/hub/routes/session-flow.test.tsx |
Expect readers to see Branch from here. |
hub/client/application/hub/routes/real-prototype-index.test.tsx |
Cover Default and selected-template handoffs without write capabilities. |
hub/client/application/hub/routes/expanded-flows.test.tsx |
Check reader handoffs while retaining listing-write denial. |
hub/client/application/hub/requests/authorize-copilot-handoff/index.ts |
Treat hidden-repository responses as handoff denial. |
hub/client/application/hub/requests/authorize-copilot-handoff/index.test.ts |
Distinguish access denial from unavailable checks. |
hub/client/application/hub/mocks/create-product-store/index.ts |
Allow creation from mock template catalogs and details. |
Review effort: Balanced (adaptive)
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.
Why
Signed-in Hub members who can see a repository were told "You do not have permission to create prototypes in this repository." on the Create page, and the brief, template picker, and submit button were disabled. Hub was asking GitHub for write access before letting someone start a prototype. Starting a prototype does not write to the repository: it builds a prompt and hands it to the GitHub Copilot app, or lets the user copy it. GitHub read-only users, Entra-backed members, and Hub administrators with legitimate repository visibility should be able to start one. This follows up the policy discussion on #305.
What changes
Creating a prototype and using Open Copilot App or Copy prompt now require only that the signed-in member can see the repository. This applies to the Default template and to selected templates. Hub still hides repositories a member cannot see, and Hub administrator authority does not grant visibility or GitHub write access.
Pushing a prototype branch and other repository changes, such as registering or managing prototypes and sharing, still require Write, Maintain, or Admin. A read-only member can start a session in the Copilot app, but GitHub may refuse their push until they have write access. Maintain is already treated as write access.
If a member loses access between loading the page and submitting, Hub shows "You do not have permission to create a prototype in this repository." and keeps the brief. If Hub cannot check access, it shows "Hub could not check repository access. Try again." In the mock flows, readers now see Create and Branch from here. The Create page still disables submission if the API reports
canCreate: false, so that response field stays meaningful. The server no longer returnsfalsefor a visible repository.flowchart LR subgraph Before A1[Visible repository] --> B1{GitHub write?} B1 -- no --> C1[Create disabled] B1 -- yes --> D1[Copilot app or Copy prompt] end subgraph After A2[Visible repository] --> D2[Copilot app or Copy prompt] D2 --> E2{Push branch} E2 -- Write, Maintain, Admin --> F2[Accepted] E2 -- Read, Triage --> G2[Refused by GitHub] endThe
ReadOnlyCreate story showed the old disabled page, which can no longer happen, so it has been removed. TheAccessChangedandAccessUnavailablestories now show the two submit-time errors.Known gaps: this has not been reproduced against a deployed Hub, and the Linux-only tests that read
/procwere not run on macOS.Storybook screenshots
Each screenshot uses the light theme at a 1280×900 viewport. The brief was typed into the page and then submitted.
Hub/Pages/Repositories/Create / Submitted: a member who can see the repository submits a brief and gets the Copilot app handoff.
Hub/Pages/Repositories/Create / Access Changed: access was lost before submitting. The denial is shown and the brief is kept.
Hub/Pages/Repositories/Create / Access Unavailable: Hub could not check access. The error is shown and the brief is kept.