Repository navigation
fix(gitlab): reads reach a self-managed GitLab served on a custom port - #40333
Closed
ahmedisam99 wants to merge 1 commit into
Closed
ahmedisam99 wants to merge 1 commit into
ahmedisam99 wants to merge 1 commit into
Conversation
Repository keys drop the port, so a merge request on a GitLab served at http://host:9999 was read with GITLAB_HOST=host, which glab sends to https://host:443. A host without a port is now spelled as the checkout's one HTTP remote on that host spells it. Fixes pingdotgg#40306 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Thanks for this. #40321 makes the same change and is the one being kept. #40321 addresses the same dropped-port failure using the project's already-resolved HTTP remote. That keeps the fix smaller and avoids another Git lookup and a separate cache. Your diagnosis also establishes why this breaks merged-thread settlement: the failed reads leave the linked merge request without a current snapshot. That evidence remains useful for validating the shared fix. Closing as a duplicate. |
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.
Problem
On a self-managed GitLab served on a custom port (origin
http://10.129.10.143:9999/group/project.git), every merge request read fails, so PR watches never wake and merged threads never auto-settle (#40306). Repository keys drop the port, andGitLabClipasses that port-less host to glab asGITLAB_HOST, so glab callshttps://10.129.10.143:443and getsconnection refused.Change
GitLabClinow checks a host that has no port against the checkout glab runs in. When exactly one HTTP(S) remote of that checkout has the same hostname with an explicit port, glab gets thathost:port. In every other case the host is passed as before:isChangeRequestAuthorityOfProjectuses.Each checkout's remotes are cached for a minute, so the watch and sync sweeps don't start
gitbefore every glab call. Repository keys and stored links keep their port-less hosts; only the host handed to glab changes.Scope
Fixes #40306: every merge request read fails on a GitLab served on a custom port.
Verification
t3 serve0.1.11 server whose GitLab is served over HTTP on port 9999. EveryPullRequestWatchReactorandPullRequestSyncReactorread of the MR failed with "GitLab CLI command failed", and the link keptsnapshot: null. I reran the failingglab api projects/<path>/merge_requests/<n>by hand. WithGITLAB_HOST=10.129.10.143it failed with connection refused on port 443. WithGITLAB_HOST=10.129.10.143:9999it returned the merged MR.GitLabCli.test.tscases check that:vp run testinpackages/source-control-gitlab: all 303 tests pass.vp run check:changed: format, lint, knip, typecheck of 11 packages, and tests all pass.🤖 Generated with Claude Code using Claude Opus 5.5.