git_ui: Fix create pull request for remotes with no provider - #59880
Closed
fly2xj wants to merge 1 commit into
Closed
git_ui: Fix create pull request for remotes with no provider#59880fly2xj wants to merge 1 commit into
fly2xj wants to merge 1 commit into
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: jannisxiong.
|
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.
fly2xj
force-pushed
the
fix/create-pull-request-unknown-host
branch
from
June 25, 2026 07:35
e8a5d5d to
206e16b
Compare
|
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'. |
Author
|
@cla-bot check |
|
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'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
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.
Summary
The post-push toast's "Create Pull Request" button regressed in #53913: it now always dispatches the
git::CreatePullRequestaction, which parses the remote URL through theGitHostingProviderRegistry. For remotes whose host has no registered provider (e.g. internal GitLab instances such asgit.woa.com),parse_git_remote_urlreturnsNoneand the button fails with: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: <url>), and clicking it opened that URL directly viacx.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 throughcreate_pull_request()→git::parse_git_remote_url(). That walks Zed's hosting-provider registry, and no provider matches hosts likegit.woa.com(an internal GitLab instance; GitLab's self-hosted detection requireshost.contains("gitlab")). Soparse_git_remote_urlreturnsNoneand 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 aPushPrLink { link }SuccessStylevariant and anextract_pull_request_linkhelper that scans onlyremote:-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: whenPushPrLinkis produced, the "Create Pull Request" button opens that URL directly; otherwise it falls back to dispatchingCreatePullRequest(the provider-based path, for known hosts without a stderr link). TheToastWithLog"View Log" fallback for non-push actions is preserved.linkifydependency togit_ui.Testing
PushPrLinkwith the correct extracted URLs.test_push_internal_host_merge_request_link— a regression guard mirroring the reportedgit.woa.comscenario.git_uilib tests pass;./script/clippy -p git_uiandcargo fmtare clean.Release Notes: