Skip to content

feat(setup): guide setup and bot PAT creation - #402

Open
efraespada wants to merge 4 commits into
developfrom
codex/setup-temporary-github-auth
Open

efraespada wants to merge 4 commits into
developfrom
codex/setup-temporary-github-auth

Conversation

@efraespada

@efraespada efraespada commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Interactive copilot setup now guides operators through creating separate GitHub PATs for repository setup and the workflow bot. It previews permission grants before token creation and verifies a guided bot PAT belongs to the expected account before setup writes it as a Secret.

What changed

  • Add a guided setup PAT flow that gathers permission-affecting choices, previews grants, and reuses those answers in the setup questionnaire.
  • Generate GitHub fine-grained PAT links from setup and workflow permission requirements, with corrected setup links when later inspection reveals additional required grants.
  • Verify the guided setup PAT account and check the workflow PAT’s GitHub account ID against the selected bot before writing a Secret.
  • Document token creation, repository selection, expiry, cleanup, and recovery steps. Add policy, adapter, wizard, CLI, and presenter tests.

Review notes

  • Operators must create tokens and select the intended repository in GitHub; the prefilled links do not create tokens or select repositories. The temporary setup PAT is not revoked automatically and must be deleted by the operator.
  • Guided workflow PATs suggest a 90-day expiry and need renewal before expiration. The guided link is unavailable for plans requiring unsupported fine-grained PAT permissions such as Checks.

@docs-page

docs-page Bot commented Sep 24, 2026

Copy link
Copy Markdown

To preview the documentation for this pull request, visit the following URL:

docs.page/vypdev/copilot~402

Documentation is deployed and generated using docs.page

@vypbot
vypbot self-requested a review September 24, 2026 16:55
@vypbot vypbot added this to vypdev Sep 24, 2026
@vypbot vypbot moved this to In Progress in vypdev Sep 24, 2026

@vypbot vypbot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Current status: All findings originating in this review are resolved.
Last reconciled on 655dcac. See aggregate Bugbot status.

🤖 Bugbot review snapshot

Bugbot reported 1 potential problem when commit ee61a37 was analyzed. This snapshot is historical; use the status block above for current state. 1 finding is linked to changed code.

Findings

  • medium: Use the organization Members form parameter — src/application/policies/setup_pat_creation_url_policy.ts:22

Comment thread src/application/policies/setup_pat_creation_url_policy.ts
@codecov-commenter

codecov-commenter commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.38129% with 74 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.61%. Comparing base (7261967) to head (655dcac).

Files with missing lines Patch % Lines
src/cli/commands/setup.ts 46.73% 30 Missing and 19 partials ⚠️
src/cli/setup_credential_prompt_adapter.ts 84.48% 1 Missing and 8 partials ⚠️
...rc/application/policies/setup_pat_intent_policy.ts 80.00% 0 Missing and 4 partials ⚠️
...rastructure/setup_github_identity_query_adapter.ts 80.00% 1 Missing and 3 partials ⚠️
...application/policies/setup_questionnaire_policy.ts 83.33% 0 Missing and 3 partials ⚠️
...lication/policies/setup_token_permission_policy.ts 76.92% 0 Missing and 3 partials ⚠️
...lication/policies/setup_pat_creation_url_policy.ts 93.33% 0 Missing and 2 partials ⚠️

❌ Your patch status has failed because the patch coverage (73.38%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #402      +/-   ##
===========================================
- Coverage    91.77%   91.61%   -0.17%     
===========================================
  Files          686      690       +4     
  Lines        20484    20743     +259     
  Branches      5582     5670      +88     
===========================================
+ Hits         18799    19003     +204     
- Misses         690      707      +17     
- Partials       995     1033      +38     
Files with missing lines Coverage Δ
...pplication/usecases/setup/setup_wizard_use_case.ts 76.28% <100.00%> (+1.56%) ⬆️
...up/verify_guided_workflow_pat_identity_use_case.ts 100.00% <100.00%> (ø)
src/cli/setup_question_renderer.ts 90.00% <100.00%> (+28.46%) ⬆️
src/domain/setup_questionnaire.ts 0.00% <ø> (ø)
...lication/policies/setup_pat_creation_url_policy.ts 93.33% <93.33%> (ø)
...application/policies/setup_questionnaire_policy.ts 89.72% <83.33%> (+1.42%) ⬆️
...lication/policies/setup_token_permission_policy.ts 96.19% <76.92%> (-1.66%) ⬇️
...rc/application/policies/setup_pat_intent_policy.ts 80.00% <80.00%> (ø)
...rastructure/setup_github_identity_query_adapter.ts 80.00% <80.00%> (ø)
src/cli/setup_credential_prompt_adapter.ts 88.79% <84.48%> (-2.74%) ⬇️
... and 1 more

... and 1 file with indirect coverage changes

🚀 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.

@vypbot

vypbot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Bugbot: review complete

Current status: No active findings on 655dcac.

Pull request · Verified commit · Workflow run

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants