Repository navigation
fix: support self-managed GitLab and scope GitLab API calls - #116
Open
katsenkatorz wants to merge 2 commits into
Open
katsenkatorz wants to merge 2 commits into
katsenkatorz wants to merge 2 commits into
Conversation
Remotes on self-managed GitLab instances whose hostname did not contain "gitlab" were classified as an unknown forge, so MR and CI data never loaded. Hosts that glab has a configuration for are now treated as GitLab, since glab is already required for every GitLab call.
The MR and issue lookups called the global /merge_requests and /issues endpoints, which return the user's items across every project. A branch name shared with another project could therefore resolve to the wrong MR, and lookups by number returned 404. They now target the project of the current repository.
PR Summary by QodoDetect self-managed GitLab hosts and scope MR and issue lookups
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
This branch has not been deployed
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 #115.
Two GitLab fixes, one per commit:
gitlabwas classified as an unknown forge, so pressingpsilently ended with no MR for every worktree. When the host is unknown,DetectHostnow asksglab config get api_host --host <host>and treats the host as GitLab if glab has a configuration for it. The lookup is local, fast and cached by the existingsync.Once./merge_requestsand/issuesendpoints, which return the user's items across every project. A branch name shared with another project resolved to the wrong MR, andmerge_requests/<iid>returned 404. They now useprojects/:id/..., which glab resolves to the current repository.Testing
make lint,make docs-checkpass. On macOS, five herdr tests ininternal/multiplexerandinternal/appfail onmaintoo (/varvs/private/varpaths), unrelated to this change.