Skip to content

Add preconfigured Copilot PAT onboarding in gh aw add-wizard - #45987

Merged
mnkiefer merged 10 commits into
mainfrom
copilot/add-preconfigured-copilot-authentication
Jul 16, 2026
Merged

Add preconfigured Copilot PAT onboarding in gh aw add-wizard#45987
mnkiefer merged 10 commits into
mainfrom
copilot/add-preconfigured-copilot-authentication

Conversation

CopilotAI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

add-wizard now supports a lower-friction Copilot auth setup when org billing is unavailable: it guides users to a prefilled fine-grained PAT page, accepts token input securely, and preserves strict token-format validation before storing COPILOT_GITHUB_TOKEN. It also keeps the org-billing path unchanged when copilot-requests auth is available.

  • Copilot PAT flow hardening

    • Added a dedicated preconfigured PAT creation URL generator for Copilot with:
      • token name prefilled to COPILOT_GITHUB_TOKEN
      • only Copilot Requests read permission requested
    • Keeps masked token entry (EchoModePassword) and existing github_pat_ validation semantics.
  • Advance-consent UX

    • Added an explicit “open browser now?” consent gate before attempting to launch the preconfigured PAT page.
    • If accepted, setup continues directly to token paste input without another confirmation gate.
    • If browser launch is unavailable, the wizard falls back to a manual URL path with clear guidance.
  • Docs and contract coverage

    • Updated CLI setup docs to reflect the new preconfigured PAT onboarding path.
    • Added focused unit coverage for the Copilot PAT URL contract (expected path/params, no unrelated permission params).
funcbuildCopilotPATCreationURL() string {
constbaseURL="https://github.com/settings/personal-access-tokens/new"values:= url.Values{}
values.Set("name", constants.CopilotGitHubToken)
values.Set("user_copilot_requests", "read")
returnbaseURL+"?"+values.Encode()
}

Generated by 👨‍🍳 PR Sous Chef · 26.2 AIC · ⌖ 8.22 AIC · ⊞ 7.5K ·
Comment /souschef to run again

CopilotAIand others added 2 commits July 16, 2026 12:44
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

FieldValue
Categoryfeature
Risk🟢 Low
Score18 (impact 10 + urgency 3 + quality 5)
Actiondefer

Rationale: DRAFT WIP — only 1 file changed (+7/-2) with a checklist; implementation not yet started. Defer until author completes the work and removes draft status.

Generated by 🔧 PR Triage Agent · 32.8 AIC · ⌖ 4.9 AIC · ⊞ 5.6K ·

@mnkiefer

Copy link
Copy Markdown
Collaborator

@copilot Revert changes to .github/workflows/cli-consistency-checker.lock.yml as they are unrelated to this PR.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
CopilotAI changed the title [WIP] Add preconfigured Copilot authentication to gh aw add-wizardAdd preconfigured Copilot PAT onboarding in gh aw add-wizardJul 16, 2026
CopilotAI requested a review from mnkieferJuly 16, 2026 13:02
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>

CopilotAI commented Jul 16, 2026

Copy link
Copy Markdown
ContributorAuthor

@copilot Revert changes to .github/workflows/cli-consistency-checker.lock.yml as they are unrelated to this PR.

Addressed in b1f3036.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @copilot-swe-agent 👋 — great work on the lower-friction Copilot auth setup in add-wizard! The preconfigured PAT URL generator with the consent gate is a clean UX improvement, and the changes are well-scoped across engine_secrets.go, its test file, and the docs update.

This PR looks ready for review — it's focused, includes tests, has a clear description, and adds no new dependencies. Nothing blocking here. ✅

Generated by ✅ Contribution Check · 100.5 AIC · ⌖ 8.71 AIC · ⊞ 6.2K ·

@mnkiefer
mnkiefer requested a review from CopilotJuly 16, 2026 14:41
@mnkiefer
mnkiefer marked this pull request as ready for review July 16, 2026 14:41

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

Pull request overview

Adds preconfigured Copilot PAT onboarding to add-wizard, alongside several unrelated Git/PR and tooling changes.

Changes:

  • Adds PAT URL generation, browser launch, validation, and secret replacement.
  • Updates Copilot billing behavior, tests, and documentation.
  • Changes PR branch handling and refreshes Serena configuration.
Show a summary per file
FileDescription
pkg/cli/pr_helpers.goSimplifies push error propagation.
pkg/cli/git.goReuses existing local branches.
pkg/cli/git_test.goTests branch reuse.
pkg/cli/engine_secrets.goImplements Copilot PAT onboarding and replacement.
pkg/cli/engine_secrets_test.goTests PAT URL construction.
pkg/cli/copilot_billing_check.goTreats unknown billing states as inconclusive.
pkg/cli/copilot_billing_check_test.goUpdates billing-state expectations.
pkg/cli/bootstrap_profile_runner.goRemoves browser-disable override.
pkg/cli/bootstrap_profile_runner_test.goExpects browser opening to remain enabled.
pkg/cli/add_workflow_pr.goFilters existing workflows before PR creation.
pkg/cli/add_workflow_pr_test.goTests workflow filtering and tracking.
pkg/cli/add_interactive_git.goHandles no-PR results.
pkg/cli/add_interactive_engine.goExplicitly selects PAT by default.
docs/src/content/docs/setup/cli.mdDocuments PAT onboarding.
docs/src/content/docs/reference/glossary.mdUpdates token glossary entry.
.serena/project.ymlRefreshes Serena configuration.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 16/16 changed files
  • Comments generated: 6
  • Review effort level: Medium

Comment threadpkg/cli/engine_secrets.go Outdated
Comment threadpkg/cli/git.go Outdated
Comment threadpkg/cli/bootstrap_profile_runner_test.go Outdated
Comment threadpkg/cli/engine_secrets.go Outdated
Comment threadpkg/cli/engine_secrets.go
Comment threadpkg/cli/add_workflow_pr.go Outdated
@mnkiefer

Copy link
Copy Markdown
Collaborator

@copilot Address all open review comments and run the pr-finisher skill.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address the unresolved review feedback below, fix the failing checks, and rerun CI once the branch is up to date.

Unresolved review threads:

Failed checks:

Generated by 👨🍳 PR Sous Chef
Comment /souschef to run again

Generated by 👨‍🍳 PR Sous Chef · 26.2 AIC · ⌖ 8.22 AIC · ⊞ 7.5K ·
Comment /souschef to run again

- Add explicit consent gate before browser open in promptForCopilotPATUnified
- Revert unsafe branch reuse: restore createAndSwitchBranch to fail on existing branch
- Restore GH_AW_BOOTSTRAP_NO_OPEN_BROWSER env override and parseBootstrapBool
- Use constants.CopilotGitHubToken as PAT name in buildCopilotPATCreationURL
- Add injectable engineSecretsPromptFn/engineSecretsUploadFn for testability
- Add TestEnsureSecretAvailable_CopilotRepromptsWithOverwrite coverage
- Revert unrelated filterExistingWorkflowsForPR behavior change in add_workflow_pr
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer
mnkiefer merged commit 117acb7 into mainJul 16, 2026
@mnkiefer
mnkiefer deleted the copilot/add-preconfigured-copilot-authentication branch July 16, 2026 15:26
Copilot stopped work on behalf of mnkiefer due to an error July 16, 2026 15:26
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.11

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add preconfigured Copilot authentication to gh aw add-wizard

4 participants

@mnkiefer@gh-aw-bot