Skip to content

Activate sharding pipeline — wire DurationStore, add tests, clean dead column#230

Merged
MichielDean merged 7 commits into
mainfrom
feat/sc-kcdwu
Apr 14, 2026
Merged

Activate sharding pipeline — wire DurationStore, add tests, clean dead column#230
MichielDean merged 7 commits into
mainfrom
feat/sc-kcdwu

Conversation

@MichielDean
Copy link
Copy Markdown
Owner

Closes droplet sc-kcdwu.

Cistern Agent added 6 commits April 14, 2026 09:35
…eamAndTest, add tests

- Wire DurationStore.UpsertFromResults into ReportsHandler.Create (inside transaction)
- Add DurationStore.GetByTeamAndTest with targeted WHERE test_name =  query
- Update ShardingHandler.GetDuration to use GetByTeamAndTest instead of O(N) Go filter
- Refactor UpsertFromResults to accept DBTX interface (pgxpool.Pool or pgx.Tx)
- Add DurationStore field to ReportsHandler, wire in routes.go
- Add comprehensive DurationStore integration tests (14 tests)
- Add test_duration_history to integration test truncation list
- Verified triage_status column IS wired (triage job writes it) - no migration needed
…ion response shape

1. GetByTeamMap uses composite key (testName\0suite) to avoid silently
   dropping entries with same test_name across different suites. Added
   DurationMapKey helper and updated EnrichWithHistory to aggregate
   durations across suites from composite-keyed map.

2. UpsertFromResults ON CONFLICT now updates p95_duration_ms using
   GREATEST(previous_p95, new_duration) instead of leaving it at the
   initial value forever.

3. GetDuration handler always returns a JSON array for consistent API
   shape, removing the single-object vs bare-array inconsistency.

All unit tests pass with -race.
…erbose anonymous struct in EnrichWithHistory
@MichielDean MichielDean enabled auto-merge (squash) April 14, 2026 15:56
@MichielDean MichielDean merged commit 631fff8 into main Apr 14, 2026
11 checks passed
@MichielDean MichielDean deleted the feat/sc-kcdwu branch April 14, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant