Repository navigation
refactor: prepare gitprovider for multi-provider support - #25651
Merged
Merged
Conversation
… support - Change gitprovider.New to return (Provider, error) - Extract shared helpers (parseRetryAfter, checkRateLimitError, countDiffLines, escapePathPreserveSlashes) from github.go - Update all callers (db2sdk, exp_chats, gitsync) for new signature - Add error logging for provider construction failures - Thread context through provider resolution
johnstcn
marked this pull request as ready for review
May 25, 2026 15:53
kylecarbs
approved these changes
May 25, 2026
Part of CODAGT-146 Implement GitLab support for the `gitprovider` package, enabling PR status, diff fetching, branch-to-MR resolution, and URL parsing/building for GitLab repositories. Capabilities: - `FetchPullRequestStatus`: MR metadata, approval state, diff stats via `ListMergeRequestDiffs` - `FetchPullRequestDiff` / `FetchBranchDiff`: raw diffs with size guards and rate limit detection on raw HTTP paths - `ResolveBranchPullRequest`: find open MRs for a branch - URL parsing/building: handles nested groups, forks, and self-hosted instances Also updates `docs/ai-coder/agents/platform-controls/git-providers.md` with GitLab configuration and known limitations. Stacked on #25651. Part 2 of 3. > Generated with [Coder](https://coder.com) by @johnstcn
Contributor
Documentation CheckUpdates Completed
The documentation has been properly updated to reflect GitLab support, including configuration examples for both gitlab.com and self-hosted instances, scope requirements ( Automated review via Coder Agents |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Part of CODAGT-146
Mechanical refactor preparing the
gitproviderpackage for additional provider implementations.Changes:
gitprovider.Newnow returns(Provider, error)instead of justProviderparseRetryAfter,checkRateLimitError,countDiffLines,escapePathPreserveSlashes) out ofgithub.gointogitprovider.godb2sdk,exp_chats,gitsync) for the new signatureresolveExternalAuthThis is part 1 of a 3-PR stack adding GitLab support to gitsync:
cj/gitsync-gitlab-2: GitLab provider implementation + unit testscj/gitsync-gitlab-3: VCR integration tests + cassettesNote:
TestGetChatDiffContents/SuccessWithCachedRepositoryReferenceis failing in this PR, but passes in the next PR up the stack.