Skip to content

Fix issue reporter "Preview on GitHub" opening repo root instead of the new-issue form#319577

Open
ajasad25 wants to merge 1 commit into
microsoft:mainfrom
ajasad25:fix/issue-reporter-new-issue-url
Open

Fix issue reporter "Preview on GitHub" opening repo root instead of the new-issue form#319577
ajasad25 wants to merge 1 commit into
microsoft:mainfrom
ajasad25:fix/issue-reporter-new-issue-url

Conversation

@ajasad25
Copy link
Copy Markdown

@ajasad25 ajasad25 commented Jun 2, 2026

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.getIssueUrlWithTitle only appended /issues/new when 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 through data.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/new handling to apply to any GitHub target URL that doesn't already point at the new-issue form, and drop the now-redundant fileOnExtension argument:

if (this.isGitHubUrl(issueUrl) && !/\/issues\/new(?:[?#].*)?$/i.test(issueUrl)) {
    issueUrl = `${normalizeGitHubUrl(issueUrl)}/issues/new`;
}
  • The !/\/issues\/new$/ check prevents double-appending for URLs that already target the form (e.g. the default product.reportIssueUrl, and extension URLs which getExtensionIssueUrl already normalizes), so already-correct flows are unchanged.
  • The isGitHubUrl guard leaves non-GitHub external trackers untouched — and those already short-circuit as external links 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 from product.reportIssueUrl (already …/issues/new) and does not consume data.uri, so it is not affected by these reports. Happy to extend the same hardening there if preferred.

Verification

  • Simulated getIssueUrlWithTitle + normalizeGitHubUrl over the bug inputs and edge cases: bare …/vscode…/vscode/issues/new?title=…; already-/issues/new URLs, trailing slash, and extension URLs are unchanged (no double-append).

…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
Copilot AI review requested due to automatic review settings June 2, 2026 13:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 fileOnExtension argument at the call site.
  • Replace the extension-only guard with isGitHubUrl(issueUrl) and document why.

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.

Report Issue: VS Code issues "Preview on GitHub" opens repo, not new issue form Filing an issue for Insiders results in invalid preview link

3 participants