Skip to content

feat: add GitLab support to chatd gitprovider#25652

Merged
johnstcn merged 2 commits into
cj/gitsync-gitlab-1from
cj/gitsync-gitlab-2
May 25, 2026
Merged

feat: add GitLab support to chatd gitprovider#25652
johnstcn merged 2 commits into
cj/gitsync-gitlab-1from
cj/gitsync-gitlab-2

Conversation

@johnstcn
Copy link
Copy Markdown
Member

@johnstcn johnstcn commented 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 by @johnstcn

Implement GitLab support for the gitprovider package, enabling
PR status, diff fetching, branch-to-MR resolution, and URL
parsing/building for GitLab repositories.

- Add gitlab.go with full Provider interface implementation
- Handle nested groups, forks, and self-hosted instances
- Add rate limit detection on both library and raw HTTP paths
- Add unit tests covering error paths, URL parsing, and state mapping
- Update git-providers documentation with GitLab configuration
@github-actions
Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/ai-coder/agents/platform-controls/git-providers.md

@johnstcn johnstcn changed the title feat(coderd/externalauth/gitprovider): add GitLab provider feat(coderd): add GitLab provider May 25, 2026
@johnstcn johnstcn marked this pull request as ready for review May 25, 2026 15:53
Copilot AI review requested due to automatic review settings May 25, 2026 15:53
@johnstcn johnstcn changed the title feat(coderd): add GitLab provider feat: add GitLab May 25, 2026
@johnstcn johnstcn changed the title feat: add GitLab feat: add GitLab support to chatdgitprovider May 25, 2026
@johnstcn johnstcn changed the title feat: add GitLab support to chatdgitprovider feat: add GitLab support to chatd gitprovider May 25, 2026

This comment was marked as off-topic.

Part of CODAGT-146

Add go-vcr based integration tests for the GitLab provider, covering all
four provider interface methods against recorded API responses.

Test coverage:
- `FetchPullRequestStatus`: 4 fixtures (open/mergeable, open/conflicts,
nested/merged, nested/closed from fork)
- `FetchPullRequestDiff`: 4 fixtures
- `FetchBranchDiff`: 3 fixtures (open MR branch, deleted after merge,
fork branch not on target)
- `ResolveBranchPullRequest`: 3 fixtures

Includes cassette YAML files with sanitized GitLab API responses,
`.gitattributes` marking them as generated, and `typos.toml` exclusion.

Stacked on #25652. Part 3 of 3.

> Generated with [Coder](https://coder.com) by @johnstcn
@johnstcn johnstcn merged commit 8f092e0 into cj/gitsync-gitlab-1 May 25, 2026
8 checks passed
@johnstcn johnstcn deleted the cj/gitsync-gitlab-2 branch May 25, 2026 16:09
@github-actions github-actions Bot locked and limited conversation to collaborators May 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants