Skip to content

authentication: Support multiple configured Enterprise hosts - #8996

Merged
TylerLeonhardt merged 3 commits into
mainfrom
agents/vscode-extension-new-setting-spec
Oct 1, 2026
Merged

TylerLeonhardt merged 3 commits into
mainfrom
agents/vscode-extension-new-setting-spec

Conversation

@TylerLeonhardt

@TylerLeonhardt TylerLeonhardt commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Adopt github-enterprise.uris from microsoft/vscode#338080 while preserving one selected Enterprise account/client alongside the separate GitHub.com account. Builds on the session-derived routing in #8984.

  • Resolve plural-setting precedence, explicit [], legacy read fallback, workspace trust, and instance URL validation. Setup writes only the plural setting and preserves existing instances.
  • Add Select Account, which opens account preferences directly for this extension and the github-enterprise provider, or starts sign-in when no Enterprise accounts exist.
  • Show concise, naturally wrapping guidance for mismatched or missing account preferences in both the PR and Login views. Preserve GitHub.com sign-in alongside Enterprise guidance.
  • Render from repository-owned discovery results rather than starting network probes from the views; refresh guidance when discovery completes.
  • Require VS Code ^1.141.0 and document the configuration, compatibility policy, and follow-up phases.

Scope and compatibility

This is the Crawl phase: multiple instances can be configured, but only one Enterprise account is active at a time. Simultaneous per-host clients and multiple accounts per host are follow-ups.

Insiders users are expected to stay current; no compatibility shim is added for early 1.141 snapshots. The scoped picker uses VS Code's _manageAccountPreferencesForExtension(extensionId, providerId) command, verified against its implementation and in a running VS Code window.

Validation

  • npm run compile (desktop, browser, and webviews)
  • TypeScript compilation and command-registration validation
  • npm run lint and staged npm run hygiene
  • Focused configuration, authentication, repository, and view regression suites; the final UI/authentication pass had 77 passing tests
  • Actual VS Code rendering at a 259px sidebar width: mismatch and no-preference messages wrap without horizontal overflow; invalid Enterprise configuration retains public sign-in
  • Verified the native picker opens for GitHub Pull Requests / GitHub Enterprise without intermediate extension/provider selection

Remaining validation

  • Complete real-account switching/sign-in coverage across multiple Enterprise instances in web and remote environments before marking ready for review.

The implementation specification includes exploratory scenarios and the follow-up phases.

Closes #9003

Follow-ups (not closed by this PR): #9004 (Walk), #9005 (Run).

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Real-account switching across web and remote environments remains explicitly unvalidated for this authentication-sensitive change.

Review effort: Balanced
Findings: None

What changed in this PR

Adds multi-host GitHub Enterprise configuration while retaining one selected Enterprise client alongside GitHub.com.

Changes:

  • Implements plural URI configuration, validation, discovery, and additive setup.
  • Adds account-selection and authentication guidance across PR and login views.
  • Expands regression coverage and documents compatibility and rollout constraints.
File Description
src/​authentication/​configuration.ts Resolves and validates Enterprise URI settings.
src/​authentication/​githubServer.ts Recognizes configured Enterprise remotes.
src/​commands.ts Registers Enterprise account selection.
src/​common/​executeCommands.ts Adds command and context constants.
src/​common/​settingKeys.ts Adds the plural URI key.
src/​github/​createPRViewProvider.ts Uses synchronous active-remote filtering.
src/​github/​folderRepositoryManager.ts Refreshes and classifies multi-host remotes.
src/​github/​markdownUtils.ts Adds safe Markdown text escaping.
src/​github/​repositoriesManager.ts Implements setup and account-selection flows.
src/​github/​utils.ts Removes obsolete singular-setting helpers.
src/​view/​prsTreeDataProvider.ts Displays authentication and configuration guidance.
src/​view/​treeNodes/​categoryNode.ts Routes Enterprise login correctly.
src/​test/​authentication/​configuration.test.ts Tests configuration precedence and validation.
src/​test/​github/​authIssuers.test.ts Tests host discovery and client lifecycle.
src/​test/​github/​markdownUtils.test.ts Tests Markdown escaping.
src/​test/​github/​repositoriesManager.test.ts Tests setup and account selection.
src/​test/​view/​prsTree.test.ts Tests PR/login view guidance.
package.json Raises the VS Code floor and contributes the command.
package.nls.json Localizes the new command title.
README.md Documents multi-host configuration and limitations.
documentation/​releasing.md Updates release compatibility guidance.
documentation/​github-enterprise-uris-spec.md Defines rollout requirements and follow-ups.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

TylerLeonhardt and others added 3 commits October 1, 2026 09:10
Honor github-enterprise.uris with legacy read fallback and additive setup. Preserve one selected Enterprise client, expose scoped account selection, and keep authentication guidance responsive and readable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mock native tree views and context commands so unit tests do not wait for UI RPC. Dispose the tree model and repository fixtures and await remote setup to prevent timed-out work from leaking into the next test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep review-comment setup off workbench RPC and dispose its owned resources. Share the tree/context fixture with PR-tree tests. Run the previously misplaced initialization check after setup and await thread creation so initialization cannot finish with incomplete thread data.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Real-account switching across web and remote environments remains explicitly unvalidated.

Review effort: Balanced
Findings: None

@TylerLeonhardt
TylerLeonhardt merged commit a5d08bc into main Oct 1, 2026
7 checks passed
@TylerLeonhardt
TylerLeonhardt deleted the agents/vscode-extension-new-setting-spec branch October 1, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants