mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
579daaff70
Fixes CODAGT-146 Add GitLab support to the gitprovider package for gitsync/chatd PR diff flows. This is a squashed stack of 3 PRs: #25651 - refactor(coderd/externalauth): prepare gitprovider for multi-provider 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 #25652 - feat(coderd/externalauth/gitprovider): add GitLab provider - Implement full Provider interface: FetchPullRequestStatus, FetchPullRequestDiff, FetchBranchDiff, ResolveBranchPullRequest - Handle nested groups, forks, and self-hosted instances - Rate limit detection on both library and raw HTTP paths - URL parsing/building with NormalizePullRequestURL support - Unit tests covering error paths, URL parsing, state mapping - Document GitLab configuration and known limitations #25653 - test(coderd/externalauth/gitprovider): add GitLab VCR integration tests - FetchPullRequestStatus: 4 fixtures (open, conflicts, merged, closed) - FetchPullRequestDiff: 4 fixtures - FetchBranchDiff: 3 fixtures (open, deleted, fork) - ResolveBranchPullRequest: 3 fixtures - go-vcr cassettes with sanitized GitLab API responses
31 lines
1.0 KiB
YAML
Generated
31 lines
1.0 KiB
YAML
Generated
---
|
|
version: 2
|
|
interactions:
|
|
- id: 0
|
|
request:
|
|
proto: HTTP/1.1
|
|
proto_major: 1
|
|
proto_minor: 1
|
|
content_length: 0
|
|
host: gitlab.com
|
|
headers:
|
|
Authorization:
|
|
- stripped
|
|
User-Agent:
|
|
- stripped
|
|
url: https://gitlab.com/api/v4/projects/test-group9945421%2Ftest-subgroup%2Fanother-test-project/merge_requests/1/raw_diffs
|
|
method: GET
|
|
response:
|
|
proto: HTTP/2.0
|
|
proto_major: 2
|
|
proto_minor: 0
|
|
content_length: -1
|
|
uncompressed: true
|
|
body: 'diff --git a/README.md b/README.md\nindex c1dc7b34c381ad6f417bb3f11dba4b1e8f076ff4..b48d45443e349c6dd113da4bb7546504a07a5cce 100644\n--- a/README.md\n+++ b/README.md\n@@ -1,6 +1,6 @@\n # another-test-project\n \n-\n+This is another test project for testing stuff.\n \n ## Getting started\n \n'
|
|
headers:
|
|
Content-Type:
|
|
- text/plain
|
|
status: 200 OK
|
|
code: 200
|
|
duration: 100.000000ms
|