Skip to content

Fix create pull request failing for remotes with no provider - #59883

Closed
fly2xj wants to merge 2 commits into
zed-industries:mainfrom
fly2xj:fix/create-pull-request-unknown-host
Closed

Fix create pull request failing for remotes with no provider#59883
fly2xj wants to merge 2 commits into
zed-industries:mainfrom
fly2xj:fix/create-pull-request-unknown-host

Conversation

@fly2xj

@fly2xj fly2xj commented Jun 25, 2026

Copy link
Copy Markdown

Summary

The post-push toast's "Create Pull Request" button regressed in #53913: it now always dispatches the git::CreatePullRequest action, which parses the remote URL through the GitHostingProviderRegistry. For remotes whose host has no registered provider (e.g. internal GitLab instances such as git.woa.com), parse_git_remote_url returns None and the button fails with:

Unsupported remote URL: git@git.woa.com:ybtm-client/dtm-harness.git
Root cause

Before #53913, the "Create Pull Request" button only appeared when git's push output contained a create-PR/MR link (e.g. GitLab's remote: To create a merge request for ..., visit: ), and clicking it opened that URL directly via cx.open_url(&link) — no remote-URL parsing, so it worked for any host.

#53913 changed the button to always appear and to dispatch git::CreatePullRequest, which routes through create_pull_request() → git::parse_git_remote_url(). That walks Zed's hosting-provider registry, and no provider matches hosts like git.woa.com (an internal GitLab instance; GitLab's self-hosted detection requires host.contains("gitlab")). So parse_git_remote_url returns None and the error is surfaced to the user.

Fix

Restore the stderr-link path alongside the new always-show button, preferring git's own output when present:

remote_output.rs: re-added a PushPrLink { link } SuccessStyle variant and an extract_pull_request_link helper that scans only remote:-prefixed lines (so unrelated links such as OpenSSH's post-quantum warning are ignored). This works for any host because the server produces the URL itself.
git_panel.rs: when PushPrLink is produced, the "Create Pull Request" button opens that URL directly; otherwise it falls back to dispatching CreatePullRequest (the provider-based path, for known hosts without a stderr link). The ToastWithLog "View Log" fallback for non-push actions is preserved.
Re-added the linkify dependency to git_ui.
Testing

Updated the three existing push tests to assert PushPrLink with the correct extracted URLs.
Added test_push_internal_host_merge_request_link — a regression guard mirroring the reported git.woa.com scenario.
All 116 git_ui lib tests pass; ./script/clippy -p git_ui and cargo fmt are clean.
Release Notes:

Fixed the "Create Pull Request" button on the post-push toast failing with "Unsupported remote URL" for remotes whose host has no registered git hosting provider (e.g. internal GitLab instances).

The post-push toast's "Create Pull Request" button regressed in zed-industries#53913:
it now always dispatches the git::CreatePullRequest action, which parses
the remote URL through the GitHostingProviderRegistry. For remotes whose
host has no registered provider (e.g. internal GitLab instances such as
git.woa.com), parse_git_remote_url returns None and the button fails
with "Unsupported remote URL".

Restore the pre-regression path: when git's push output contains a
create/view pull/merge request link on a remote: line, open that URL
directly instead of relying on a matching provider. Fall back to the
provider-based action only when no link is present, so known hosts
without a stderr link still work.
@cla-bot

cla-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @fly2xj on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jun 25, 2026
@fly2xj

fly2xj commented Jun 25, 2026

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 25, 2026
@cla-bot

cla-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@yara-blue

Copy link
Copy Markdown
Contributor

This is closed as it is in violation of our AI policy. Please read and adhere to our contributing doc.

@yara-blue yara-blue closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants