Remove the GHPR uri opening workaround in favor of external URI opener - #334222
Conversation
There was a problem hiding this comment.
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
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
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
allowContributedOpenersuses 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.
Screenshot ChangesBase: Errored (8)Fixtures that failed to render — no screenshot was produced.
|
Pull request was converted to draft
Henning Dieterichs (hediet)
left a comment
There was a problem hiding this comment.
Approved after a GPT Luna security-only preflight in the VS Code Security Code Review app.
Henning Dieterichs (hediet)
left a comment
There was a problem hiding this comment.
Approved after manual review

See microsoft/vscode-pull-request-github#8922