VCS PR lifecycle ingestion: equalize GitLab + Bitbucket with GitHub
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 7
- Forks
- 3
- Avg merge
- 2h 12m
- Merged PRs (30d)
- 30
Description
Follow-up to #122 (#112 phase 1), which landed PR lifecycle ingestion (opened_at / approved_at / merged_at / merge_sha → vcs_pull_requests) for GitHub only. This issue tracks bringing GitLab and Bitbucket to parity so DORA lead-time decomposition (Coding / Review stages) works regardless of provider. Do it when there's a real need (a GitLab/Bitbucket user wants the bottleneck card).
Scope
Mirror the GitHub work in the existing provider-uniform webhook path:
- GitLab (
merge_request+ approval events):merge_requestpayload →opened_at(object_attributes.created_at),merged_at+ merge SHA (merge_commit_shaon actionmerge).- Approvals: the Merge request approval webhook (
object_attributes.action = 'approved') →approved_at. (GitLab emits approvals on the same MR hook with anapprovedaction, or a dedicated event depending on version — confirm.) - Repo key:
project.path_with_namespace.
- Bitbucket (
pullrequest:*events):pullrequest:created→opened_at;pullrequest:fulfilled→merged_at+ merge hash.pullrequest:approved→approved_at.- Repo key:
repository.full_name.
Implementation notes
- The store layer (
RecordPullRequest{Opened,Approved,Merged}) and thevcs_pull_requeststable are provider-agnostic already — passprovider = 'gitlab' | 'bitbucket'. Only the parsers + the webhook routing/dispatch need new code. - Add the lifecycle persistence alongside the existing
handleGitLabMergeRequest/handleBitbucketPullRequest(mirrorrecordGitHubPR), and route the new approval events. - Parser unit tests + an end-to-end handler test per provider (mirror
pr_lifecycle_test.go).
Done when
GitLab and Bitbucket PRs/MRs populate the same lifecycle timestamps as GitHub, with tests, so the phase-2 correlation + bottleneck card are provider-uniform.
Refs #112, #122.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing handleGitLabMergeRequest and handleBitbucketPullRequest paths, then compare them with recordGitHubPR and pr_lifecycle_test.go. Confirm the provider-specific approval webhook payloads before adding parser and handler coverage. Done means both providers persist opened, approved, and merged timestamps plus merge identifiers, with parser and end-to-end tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100