Repository navigation
feat(infra): rank Kubernetes workloads by replica health and restarts - #1483
Confidence 8/10 · No issues found
🟢 Confidence 8/10 · likely safe to merge
The head delta is a behaviour-preserving refactor of the seed helper and every e2e assertion recomputed by hand holds; the new suite just never runs in CI.
quality 98/100 · 1 note · tests covered · risk medium
The workload list now ranks by replica shortfall, failed job pods, restarts and the worst pod's peak, and adds Jobs as a fourth workload kind. The delta since the last review is a no-op refactor of the e2e seed helper; the change is safe to merge.
listWorkloadsQueryorders by shortfall, failed pods, restarts, peak saturation- Restarts are per-container deltas of
k8s.container.restarts, not sample sums - Jobs join
WorkloadKind, the API schema and both workload routes - Workload rows drop the
avg*fields for replicas, restarts and peaks
Before merge
- Manual · Wire
k8s-workloads.clickhouse.e2e.test.tsinto theclickhouse-schema-e2ejob in.github/workflows/ci.yml, or nothing runs it in CI
Findings
🔵 Note · F4 · New e2e suite is skipped by every CI job
tests · packages/backend/src/services/warehouse/k8s-workloads.clickhouse.e2e.test.ts:146
The suite is gated on CLICKHOUSE_E2E === "1" (clickhouse-e2e-support.ts:15), the backend test lanes never set it, and the clickhouse-schema-e2e job runs its files by name (.github/workflows/ci.yml:489-529) without this one. So a regression in listWorkloadsQuery passes CI; add the file to that job's bun run --filter=@maple/backend test -- line (and to the root ch:test script) so it actually runs.
What was checked
- Recomputed the seed by hand: checkout restarts 11 (4+2+0+5), api 9, and each
lastTerminatedReasonfollows the container whose restart counter hit its high-water mark last (infra.ts:1165,1205) - No consumer is left reading the removed
avgCpuLimitPct/avgMemoryLimitPct/avgCpuUsage:apps/ai/src/mcp/lib/infra-inspect.ts:459reads the unchangedworkloadDetailSummaryQuery WORKLOAD_ATTR_KEYandworkloadAttrKeycover all four kinds, so the job path resolvesk8s.job.name(infra.ts:412)
0a955d2 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Annotations
maple-review-bot / Maple / review
tests: New e2e suite is skipped by every CI job
The suite is gated on `CLICKHOUSE_E2E === "1"` (`clickhouse-e2e-support.ts:15`), the backend test lanes never set it, and the `clickhouse-schema-e2e` job runs its files by name (`.github/workflows/ci.yml:489-529`) without this one. So a regression in `listWorkloadsQuery` passes CI; add the file to that job's `bun run --filter=@maple/backend test --` line (and to the root `ch:test` script) so it actually runs.