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

オープン 初心者向け
#386 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
backend

調査の方向性

src/lib/adapters/simulated/gitlab.ts を開き、eventsInSlot を読む。まず iid が (slot % 10_000) + 1 である merge request の分岐から始め、次にその隣の release tag の分岐と #383 からの laneSerial の lane を読む。iid と tag は slot 自体から導出し、30 日間のシミュレーションで一意のままにしつつ、実際のアダプターが受け入れる正の整数であり続けるようにし、高ボリュームの lane 範囲が衝突しないようにする。複数日にわたる dedupe key の assertion を src/lib/adapters/simulated/index.test.ts に追加し、その後 npm test -- src/lib/adapters/simulated/index.test.ts、npm run typecheck、npm run lint を実行する。完了とは、デフォルトのボリュームでも MAX_EVENT_VOLUME でも dedupe key が繰り返されず、他のシミュレートされた GitLab イベントとメトリクスが変わらないことである。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
1
フォーク
1
平均マージ
6時間 56分
マージ済み PR(30日)
136

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

eddiejaoude/StackDash のほかの issue

eddiejaoude/StackDash の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。