Fix issue reporter "Preview on GitHub" opening repo root instead of the new-issue form#319577
Open
ajasad25 wants to merge 1 commit into
Open
Fix issue reporter "Preview on GitHub" opening repo root instead of the new-issue form#319577ajasad25 wants to merge 1 commit into
ajasad25 wants to merge 1 commit into
Conversation
…ew-issue form When filing against VS Code (not an extension), the wizard issue reporter only appended `/issues/new` to the target URL for extension targets. For VS Code / Marketplace targets routed through a bare repo URL (e.g. a `data.uri` override without the `/issues/new` suffix), the preview URL became `https://github.com/microsoft/vscode?title=...`, which opens the repository landing page rather than the pre-filled new-issue form. Generalize the `/issues/new` handling in `getIssueUrlWithTitle` to apply to any GitHub target URL that does not already point at the new-issue form, and drop the now-redundant `fileOnExtension` argument. Non-GitHub trackers short-circuit as external links earlier and are left untouched. Fixes microsoft#319238 Fixes microsoft#318374
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Removes the fileOnExtension parameter from getIssueUrlWithTitle and instead applies the /issues/new normalization to any GitHub URL, so that non-extension targets (VS Code core / Marketplace) with bare repo URLs also open the pre-filled issue form.
Changes:
- Drop the
fileOnExtensionargument at the call site. - Replace the extension-only guard with
isGitHubUrl(issueUrl)and document why.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #319238
Fixes #318374
Problem
In the wizard issue reporter, "Preview on GitHub" builds a URL like
https://github.com/microsoft/vscode?title=…&body=…— the repository landing page with query params — instead of the new-issue form…/microsoft/vscode/issues/new?title=…. As a result the pre-filled title/body are dropped and the user lands on the repo home.Cause
IssueFormService.getIssueUrlWithTitleonly appended/issues/newwhen filing on an extension (fileOnExtension). For the VS Code / Marketplace targets it trusted that the target URL already ended in/issues/new. That holds for the normal path (product.reportIssueUrl=…/vscode/issues/new), but the wizard target can be a bare repo URL routed throughdata.uri(e.g. the Agents-window "Report Issue" flow and the "VS Code – Insiders" target), so the suffix was never added.Fix
Generalize the
/issues/newhandling to apply to any GitHub target URL that doesn't already point at the new-issue form, and drop the now-redundantfileOnExtensionargument:!/\/issues\/new$/check prevents double-appending for URLs that already target the form (e.g. the defaultproduct.reportIssueUrl, and extension URLs whichgetExtensionIssueUrlalready normalizes), so already-correct flows are unchanged.isGitHubUrlguard leaves non-GitHub external trackers untouched — and those already short-circuit asexternallinks before this point.Scope
This is intentionally limited to the new wizard reporter (
IssueFormService), which is the UI both issues exercise. The legacy reporter (baseIssueReporterService) derives its VS Code target fromproduct.reportIssueUrl(already…/issues/new) and does not consumedata.uri, so it is not affected by these reports. Happy to extend the same hardening there if preferred.Verification
getIssueUrlWithTitle+normalizeGitHubUrlover the bug inputs and edge cases: bare…/vscode→…/vscode/issues/new?title=…; already-/issues/newURLs, trailing slash, and extension URLs are unchanged (no double-append).