Skip to content

Remove the GHPR uri opening workaround in favor of external URI opener - #334222

Merged
Alex Ross (alexr00) merged 2 commits into
mainfrom
alexr00/live-monkey
Sep 3, 2026
Merged

Remove the GHPR uri opening workaround in favor of external URI opener#334222
Alex Ross (alexr00) merged 2 commits into
mainfrom
alexr00/live-monkey

Conversation

@alexr00

Copy link
Copy Markdown
Member

Copilot AI balanced review requested due to automatic review settings September 3, 2026 10:23
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) September 3, 2026 10:23
@alexr00 Alex Ross (alexr00) self-assigned this Sep 3, 2026

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

🟡 Changes recommended

The critical validation-ordering issue must be fixed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 High severity

New issues introduced by this change (1)
Severity Finding
High severity src/​vs/​editor/​browser/​services/​openerService.ts — Deferring validation here applies to the entire _openers chain, not only to the contributed…
What changed in this PR

Replaces the GHPR-specific URI workaround with contributed external URI openers.

Changes:

  • Routes pull requests through IOpenerService.
  • Defers validation during external-opener handling.
  • Updates opener and pull-request action tests.
File Description
src/​vs/​sessions/​contrib/​github/​test/​browser/​pullRequestActions.test.ts Updates pull-request action coverage.
src/​vs/​sessions/​contrib/​github/​browser/​pullRequestActions.ts Removes the GHPR-specific workaround.
src/​vs/​platform/​opener/​common/​opener.ts Documents opener validation behavior.
src/​vs/​editor/​test/​browser/​services/​openerService.test.ts Tests opener ordering and fallback.
src/​vs/​editor/​browser/​services/​openerService.ts Reorders validation, currently allowing regular openers to bypass trusted-domain validation.
Suppressed comments (1)

src/vs/editor/browser/services/openerService.ts:190

  • allowContributedOpeners uses the string sentinel 'default' to force VS Code's standard opener (vscode.proposed.externalUriOpener.d.ts:153-155), and the error fallback already passes that value (mainThreadUriOpeners.ts:80-84). This truthiness check treats the sentinel as enabling contributed openers, so those fallback opens now run registered openers before trusted-domain validation instead of retaining the validation-first path. Exclude the default sentinel from deferred validation (preferably via a shared platform constant) and cover this case with a regression test.
		const deferValidation = !!options?.allowContributedOpeners && shouldOpenExternal(target, options);
		if (!options?.skipValidation && !deferValidation) {
			const validationTarget = this._resolvedUriTargets.get(targetURI) ?? target; // validate against the original URI that this URI resolves to, if one exists
			if (!(await this._validate(validationTarget, options))) {
				return false;

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

Comment thread src/vs/editor/browser/services/openerService.ts Outdated
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 72e64a54 Current: ad734c1d

Errored (8)

Fixtures that failed to render — no screenshot was produced.

sessions/remoteHostUnavailable/remoteHostUnavailableEmptyState/HostNotRunning/Dark — unknown error (no image hash produced)
unknown error (no image hash produced)
sessions/remoteHostUnavailable/remoteHostUnavailableEmptyState/HostNotRunning/Light — unknown error (no image hash produced)
unknown error (no image hash produced)
sessions/remoteHostUnavailable/remoteHostUnavailableEmptyState/HostNotRunningAutoStart/Dark — unknown error (no image hash produced)
unknown error (no image hash produced)
sessions/remoteHostUnavailable/remoteHostUnavailableEmptyState/HostNotRunningAutoStart/Light — unknown error (no image hash produced)
unknown error (no image hash produced)
sessions/remoteHostUnavailable/remoteHostUnavailableEmptyState/HostDisconnected/Dark — unknown error (no image hash produced)
unknown error (no image hash produced)
sessions/remoteHostUnavailable/remoteHostUnavailableEmptyState/HostDisconnected/Light — unknown error (no image hash produced)
unknown error (no image hash produced)
sessions/remoteHostUnavailable/remoteHostUnavailableEmptyState/Connecting/Dark — unknown error (no image hash produced)
unknown error (no image hash produced)
sessions/remoteHostUnavailable/remoteHostUnavailableEmptyState/Connecting/Light — unknown error (no image hash produced)
unknown error (no image hash produced)

@alexr00
Alex Ross (alexr00) marked this pull request as draft September 3, 2026 10:36
auto-merge was automatically disabled September 3, 2026 10:36

Pull request was converted to draft

@alexr00
Alex Ross (alexr00) marked this pull request as ready for review September 3, 2026 15:04
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) September 3, 2026 15:04

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved after a GPT Luna security-only preflight in the VS Code Security Code Review app.

@alexr00
Alex Ross (alexr00) merged commit 01db5cd into main Sep 3, 2026
40 checks passed
@alexr00
Alex Ross (alexr00) deleted the alexr00/live-monkey branch September 3, 2026 15:15
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved after manual review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants