Repository navigation
Description
Why
Gigapipe's correctness surface has outgrown its test coverage. Today, PRs run a build, untagged unit tests (no race detector), one focused Content-Type regression against a live ClickHouse, and CodeQL — while releases are published by build_release.yml with no test gate at all. The transpilers (LogQL/PromQL/TraceQL → SQL), the hybrid PromQL execution path, the writer's ingestion pipeline, the schema migration scripts, and the recording-rules ruler all carry real regression risk that nothing currently pins.
This initiative builds a layered test harness inside this repository and restructures CI around a two-tier fence:
- Merge gate — a small, fixed set of fast required checks on every PR (build, race-enabled unit tests, lint, golden corpora, conformance, single-node schema migration). Target: under ~10 minutes.
- Release gate — the heavy lanes (parity vs reference Prometheus/Loki/Tempo, full roundtrip corpus walks, e2e stacks, chaos, perf). These trigger on every PR but short-circuit to a green no-op unless the event is a push to master, a nightly schedule, a manual dispatch, or a
release/*PR. A publish preflight inbuild_release.ymlrefuses to release unless every release lane posted green on the exact commit being shipped.
Two principles run through everything:
- Ratchets over hard gates. Where gigapipe deliberately diverges from reference behavior (15s range alignment, downsampled-table semantics), a hard-fail parity gate would be permanently red and get ignored. Instead, parity results are scored against a committed per-case baseline with a per-case reason classification; the gate fails only when a case changes state. Regressions are caught from day one; burndown of known divergences is visible and deliberate.
- Tests version with the code. E2E lives in this repo under
test/e2e/(compose stacks, Go drivers behind build tags, a deterministic all-signal seed generator). The external test repository will not be used; a behavior change and its test update land in the same PR.
A parallel workstream refactors the codebase for testability (constructor injection, one config package, a narrow DB-access seam, process-exit policy only in cmd/) — sequenced behind the black-box safety net so every refactor PR is provably behavior-preserving.
Milestones
Each milestone is a sub-issue of this one, in dependency order:
- M1 — Tooling groundwork + PromQL transpile-determinism fix #918 — M1 — Tooling groundwork + PromQL transpile-determinism fix
- M2 — Write→read roundtrip harness + regression bank #920 — M2 — Write→read roundtrip harness + regression bank (safety net complete)
- M3 — PromQL parity harness + release-gate skeleton + publish preflight #922 — M3 — PromQL parity harness + release-gate skeleton + publish preflight
- M4 — LogQL/TraceQL parity + forced-path differential + query-surface ledger + property tests #923 — M4 — LogQL/TraceQL parity + forced-path differential + query-surface ledger + property tests
- M5 — Profiling (Pyroscope) response-goldens + fixture-format design #919 — M5 — Profiling (Pyroscope) response-goldens + fixture-format design
- M6 — Config extraction + Prometheus read-path refactor + conformance suite #921 — M6 — Config extraction + Prometheus read-path refactor + conformance suite
- M7 — Loki/Tempo read-path refactor + shared/chaccess #967 — M7 — Loki/Tempo read-path refactor + shared/chaccess
- M8 — Writer/lifecycle refactor + ingestion conformance + stack layer #924 — M8 — Writer/lifecycle refactor + ingestion conformance + stack layer
M1 originally included a SQL-text golden corpus per query head. That's been descoped in favor of pinning behavior at two other layers instead — decision pins (M6) for internal routing/pushdown choices, and response-level goldens (M2) for the Loki/Prometheus/Tempo JSON contracts Grafana actually depends on. A static SQL-text contract bakes in today's emitted shape, including shapes that may themselves be bugs, so every fix becomes two edits (code + golden) instead of one. M7 is new: it was split out of the former M6 (now M4) so that milestone's Loki/Tempo constructor-injection work stays sequenced behind M6's (formerly M4's) config-extraction groundwork, rather than either dragging that groundwork forward or leaving a dangling dependency.
Definition of done (initiative level)
- Branch protection requires the merge-gate set on every PR; no release publishes without the preflight verifying green release-gate lanes on the released commit.
- Every generated baseline/golden/inventory is regenerable by a single command,
-merge-gated in.gitattributes, and protected by a regenerate-and-diff check. - Migrated packages carry no package-level mutable state, no
os.Getenvoutside the config package, noos.Exit/policy-panic outsidecmd/, and are constructible in tests with fakes only — enforced by scoped static checks so they cannot regress while the rest of the tree waits.
Activity
Drop SQL-text golden corpus, keep groundwork + determinism fix
rita7lopes commentedon Sep 18, 2026
Updating this epic against decisions made since it was written.
Two corrections to the body:
"releases published by
build_release.ymlwith no test gate at all" is not accurate. Pushes to master runmake e2e-ci(node-clickhouse-cluster.js.yml) and k6. The real gaps are narrower:go.ymlandintegration.ymlarepull_request-only, so they never run on the master commit itself; the cluster lane carriespaths-ignore: ['**.md','**.yml']; andbuild_release.ymlhas noneeds:on any check-run. The publish preflight is still justified — the premise sentence isn't."Tests version with the code. E2E lives in this repo under
test/e2e/. The external test repository will not be used." — reversed. E2E stays in metrico/gigapipe-tests, and continues to run against its currentmain: that suite is the living specification, and testing against its head is deliberate, not an oversight. Policy for this repo is: unit tests alongside the code, Go integration tests intest/integration/, full-stack e2e in gigapipe-tests.A criterion for what belongs in this repo's suites. A test must assert a behaviour that holds regardless of how the code is written — a user-visible outcome, or a function's contract. Tests that only record current shape go red on refactors and catch nothing a behaviour-level test wouldn't catch first, and a negative pin turns a bug into a requirement. The exception is a persisted or wire contract, where today's output genuinely is the contract.
Resequencing. M2 moves to next. The table refactor beginning with #972 is the concrete thing it protects.
New. #991 pins the label-fingerprint contract — three implementations, zero tests, and it is the join key in every deployment's ClickHouse. Folding into M2.
M6 and M7 stay as scoped. The read path is being refactored, not retired: the same queries will read the same data from different tables. Constructor injection, the no-substrate conformance suites, and the
shared/chaccessseam are what make that safe to do.Path note. Milestones referencing
test/e2e/seed/need that path updated — the shared fixture package belongs undertest/integration/now.Guess-Who-sec commentedon Nov 20, 2026
@rita7lopes a short note on the open epic PRs, since several are stacked: here is the order that unblocks the most, in case it helps you pick what to review first. All are green in CI.
Start of a stack (no dependencies):
Stacked (review after the one before it):
Independent (any time): #1070 (k6 builds the PR image), #1097 (M5 profile parser fuzz), #1071 (Loki query_range defaults), #1083, #1084
I'll rebase each stacked PR onto
masteras the ones below it merge. #1069, #1112, #1113, #1114 and #1117 also have open questions for you in their descriptions.Next I'm starting M8 ingestion conformance, as you suggested on #924: one protocol per PR, Loki push first, then Prometheus remote-write.