fix(integrations): stop simulated GitLab merge request iids repeating

Đang mở Phù hợp với người mới
#386 0 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend

Hướng nghiên cứu

Mở src/lib/adapters/simulated/gitlab.ts và đọc eventsInSlot, bắt đầu với nhánh merge request trong đó iid là (slot % 10_000) + 1, rồi đến nhánh release tag bên cạnh và các lane laneSerial từ #383. Suy ra iid và tag từ chính slot để chúng vẫn duy nhất trong 30 ngày mô phỏng đồng thời vẫn là số nguyên dương mà adapter thật chấp nhận, và giữ cho dải lane lưu lượng cao không bị trùng. Thêm assertion về dedupe key nhiều ngày vào src/lib/adapters/simulated/index.test.ts, sau đó chạy npm test -- src/lib/adapters/simulated/index.test.ts, npm run typecheck và npm run lint. Hoàn thành nghĩa là không có dedupe key lặp lại ở lưu lượng mặc định hay MAX_EVENT_VOLUME, với các sự kiện GitLab mô phỏng khác và các metric không thay đổi.

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

Mô tả

area: integrations bug priority: P3 size: S

Context

Found by the Fable review of #384 (round 1, review https://github.com/eddiejaoude/DevMacro/pull/384#pullrequestreview-5887811699). It exists on main and is not caused by #383.

The simulated GitLab profile numbers its merged merge requests (slot % 10_000) + 1 (src/lib/adapters/simulated/gitlab.ts, the merge request branch of eventsInSlot). Slots are 10 seconds, so the iid repeats every 10,000 slots (about 27.8 hours). The real GitLab adapter builds the merge request event's dedupe key from the iid, so a later merge request that lands on a repeated iid in the same project produces the same dedupe key, and the store's upsert drops it as a duplicate. The timeline then silently loses an occasional merged event. Release tags (v1.<minor>.<patch>) have only about 500 possible values and repeat the same way.

Plan

  1. Give default-volume merge requests an iid that does not repeat within any realistic window, for example one derived from the slot itself rather than the slot modulo 10,000, keeping it a positive integer the real adapter accepts.
  2. Do the same for release tags, or include enough of the slot to keep the tag unique per project.
  3. Keep the higher-volume lanes added in #383 (laneSerial) clear of the new default range.
  4. Add a test that runs the simulated GitLab profile over several UTC days and asserts no dedupe key repeats.

Acceptance criteria

  • Over at least 30 simulated days, no simulated GitLab merge request or release event repeats a dedupe key at the default volume or at MAX_EVENT_VOLUME.
  • Other simulated GitLab events and metrics are unchanged.
  • Playwright e2e coverage is not needed: this is pure simulated-adapter generation with no browser flow.

Files and areas

In scope: src/lib/adapters/simulated/gitlab.ts, src/lib/adapters/simulated/index.test.ts.

Non-goals: the real GitLab adapter, other simulated providers, event volume.

Verification

npm test -- src/lib/adapters/simulated/index.test.ts
npm run typecheck
npm run lint

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

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

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.