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

Aperta Adatta ai principianti
#386 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Apri src/lib/adapters/simulated/gitlab.ts e leggi eventsInSlot, iniziando dal ramo merge request in cui l'iid è (slot % 10_000) + 1, poi dal ramo del tag di release accanto e dalle lane laneSerial di #383. Ricava gli iid e i tag dallo slot stesso in modo che rimangano univoci su 30 giorni simulati e allo stesso tempo restino interi positivi accettati dall'adattatore reale, ed evita che l'intervallo di lane ad alto volume entri in collisione. Aggiungi l'asserzione delle chiavi di deduplica su più giorni a src/lib/adapters/simulated/index.test.ts, poi esegui npm test -- src/lib/adapters/simulated/index.test.ts, npm run typecheck e npm run lint. Fatto significa nessuna chiave di deduplica ripetuta al volume predefinito o a MAX_EVENT_VOLUME, con gli altri eventi GitLab simulati e le metriche invariati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
1
Fork
1
Merge medio
6h 56m
PR unite (30g)
136

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eddiejaoude/StackDash

Tutte le issue di eddiejaoude/StackDash

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.