feat(integrations): push GitLab pipeline, deployment, release, and merge request events by webhook

Đang mở
#428 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
22/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
gitlab, nextjs, playwright, typescript
Lĩnh vực
api, backend, documentation

Hướng nghiên cứu

Start with docs/providers/gitlab.md ("Permissions", "Permission risks") and the accepted contract from #28, then read src/lib/adapters/gitlab/ to see how the OAuth scopes and existing polling event types are shaped. The work spans token verification, webhook creation/deletion, deduplication on the delivery id header, and mapping payloads onto the existing event types, plus unit tests on recorded sanitized payloads and a Playwright spec for both setup paths. Done means both setup paths land a pipeline event in the timeline within a minute, a repeated delivery shows once, and npm run lint, npm run typecheck, npm test pass. Two unknowns are unresolved in the issue (delivery-id header stability, api vs read_api coexistence) and it depends on #28 and #426, so confirm those before starting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area: integrations blocked enhancement impact: medium priority: P1 size: M

Context

Decision on #424 (2026-11-14): GitLab offers automatic setup as an opt-in and setup by hand. GitLab has no read-only scope that can create a webhook: automatic setup needs api, which is read and write on every project the user can reach, while the adapter holds read_api (docs/providers/gitlab.md, "Permissions"). The panel in #426 warns about this before asking, and points users who want DevMacro to stay read-only to setup by hand.

Item Value
Create Project webhooks, one per project, through the API with api, or by hand in the project's Settings > Webhooks (Maintainer role). Group webhooks need a paid GitLab tier
Verification A secret token DevMacro generates, sent back in X-Gitlab-Token and compared in constant time. It is a shared secret, not a body signature
Events for the timeline Pipeline, deployment, release, and merge request events: the adapter's gitlab.pipeline.succeeded, gitlab.pipeline.failed, gitlab.deployment.succeeded, gitlab.deployment.failed, gitlab.release.published, gitlab.merge_request.merged
Not pushed Compute minutes and storage. Polling stays

Plan

  1. Declare GitLab's webhook in the #28 contract: automatic setup needs api, DevMacro generates the secret token, steps for setup by hand per project.
  2. Automatic: after the opt-in consent for api, create a project webhook with DevMacro's URL, the secret token, and the four event kinds on every project the connection reads. Delete them on disconnect. Projects added later get a webhook on the next sync.
  3. By hand: show the URL, the secret token, and the steps per project, and which projects have received a delivery.
  4. Verify X-Gitlab-Token, deduplicate on GitLab's per-delivery id header, map deliveries to the connection by the per-connection URL.
  5. Deliveries become the existing event types, so polling and webhooks show one entry.
  6. Docs: docs/providers/gitlab.md ("Permissions", "Permission risks" for api, "Webhooks", self-hosted registration with the api scope allowed on the OAuth app).

Acceptance criteria

  • The opt-in write access warning from #426 shows before GitLab's consent screen.
  • Automatic setup creates a webhook on each project, and a pipeline event reaches the timeline within a minute.
  • Setup by hand works per project without requesting api.
  • Disconnect deletes automatic webhooks.
  • A wrong or missing token is rejected and logged without the body; a repeated delivery is ignored.
  • An event seen by webhook and by polling shows once.
  • Unit tests on recorded, sanitized payloads from GitLab's documented samples. No live calls in CI.
  • Playwright e2e: both setup paths for the simulated GitLab provider.

Unverified

  • The header GitLab uses for a unique delivery id (X-Gitlab-Event-UUID or an idempotency header), and whether it is stable across retries.
  • Whether an api grant and a read_api grant for the same user and app can coexist, or the second replaces the first.

Files and areas

  • src/lib/adapters/gitlab/, docs/providers/gitlab.md, docs/operations/oauth-apps.md.
  • Non-goals: group webhooks, pushing compute minutes or storage.

Verification

  • npm run lint, npm run typecheck, npm test
  • Playwright spec for both setup paths.

Depends on

  • #28 Ingest provider webhooks
  • #426 Webhook setup panel

Branch: <issue-number>-gitlab-webhooks
Closes with a Closes #<issue-number> footer on the commit or pull request.

Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown

Ngôn ngữ chính
TypeScript
Star
1
Fork
1
Merge trung bình
6 giờ 56 phút
Pull request đã merge (30 ngày)
136

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eddiejaoude/StackDash

Tất cả issue của eddiejaoude/StackDash

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.