Repository navigation
fix(ci): prune marks, sweep approvals, replace usage period, fold sweep triggers (D-1319, D-1342, D-1317, D-1320) - #531
Conversation
|
Review fix (cd0370c): |
|
Review fixes pushed in c2eb91e.
Checks: |
|
Fixed in fb1ce55: the re-send no longer rebuilds the state from evidence. It replays the state of the newest recorded outbox payload for the commit (the status the run was authorized to post, after the release veto and publish gates). A done row with no recorded decision is not folded into, so the sweep builds the head instead. Test: a passing gate with a failed publication re-sends failure; against the base code it re-sent success (also covers no recorded decision, and success recorded for a failed run). cmd, store, coordinator, cmd/agent pass; internal/run fails only on the disk-floor environment check unrelated to this change. |
…ust rows (D-1342)
… (D-1342) The test called sweepApprovals directly, so removing the call from maintain still passed. It now runs maintain on the fake clock and asserts the void row appears after a beat.
… re-sent (D-1320) A done intake row covers partial, unbound and cancelled runs, which never post a status. Folding a sweep into one re-sent nothing and held off the rebuild for 72 h. The fold now requires a whole-gate GitHub row whose newest evidence is bound, of its own revision, with a pass, fail or error result; otherwise the sweep enqueues a new run. Docs name economics.ReplaceUsage.
…t (D-1320) A failed release publication vetoes a passing run in the status outbox only, so rebuilding the state from evidence re-sent success. The sweep now replays the state of the newest recorded outbox payload, and a done row with no recorded decision is not folded into (the head is built instead).
fb1ce55 to
f26a0a4
Compare
|
Rebased onto origin/main and resolved merge conflicts in free/ci/internal/store/sched_ledger_budget.go (kept main's ledgerValues validation + pruneLedger alongside branch's ReplaceUsage helper) and free/ci/cmd/serve_wire.go (kept both serveNetscope and cfg.Rereport). Module builds with -mod=vendor; force-pushed to dw10-plugins-12. |
Four open debt rows, one commit each. All in
free/ci.D-1319: provider marks never pruned
Store.ProviderMarkPrune(ctx, name, keyPrefix, olderThan)deletes old marks of one name (empty prefix means every key).DedupPrune) appliesDefaultMarkRetention:github-reconcilerun|anddemand|marks 7 days, every other mark of that name (term, enq, redeliver) 30 days.Config.MarkRetentionoverrides it; an empty slice keeps everything.github-reconcileis a literal in the coordinator becausereconcileimportscoordinator; a test inreconcilefails if the two names drift.prunewith a fake clock, name-drift test.D-1342: approval voids and trust rows
Store.SweepApprovalswith thetrust/sourcevoid rule, soapproval.voidaudit rows no longer wait forci runs pending, a facts write or a new approval.DeletePipelinesalso deletestrust_approvalsandtrust_run_factsrows of the pruned pipelines (inside the existing batch transaction). A standing approval of a pruned run is deleted without a void row; itsapproval.grantaudit row stays.D-1317: usage ledger keeps stale provider rows
Store.ReplaceUsage(provider, fromDay, toDay, rows)deletes the provider's rows in the day range and inserts the new ones in one transaction;economics.ReplaceUsagevalidates each line likeRecordUsage.Importer.Replace, defaulteconomics.ReplaceUsage; replaces the per-lineRecordhook). A rename of repo or sku, or a changedbilling_account, no longer double counts.D-1320: head-scan enqueue does not fold into a finished row
Delivery.Reconcile(set by the head scan) becomesIntakeRequest.Reconcile: such a trigger folds into adonerow of the same source and semantic key inside the 72 h horizon, whatever the event. Failed rows never absorb it; non-reconcile, non-webhook triggers behave as before.Config.Rereport(row).ci servewires it to re-send the stored result through the status outbox (report.Sender.Repost, new seq).boundand has result pass, fail or error. Partial, unbound and cancelled runs never posted a status, so none is sent. The description names the run, never evidence text that a publication profile might filter.Clockout ofcoordinator/server.gointoclock.go: the D-1319 field pushed it over the 300-line gate.rereportDonestates and skips against a real store.Commands
Run in
free/ciwith-mod=vendorand a privateGOCACHE:go build ./...,go veton the touched packages: clean.go test ./...(whole module): everything passes except three tests that do not touch this change.internal/logsTestFollowDeliversEachLineWithinASecondAcrossRotationis a timing flake that passed on rerun.internal/legacyTestSecretsEnvLiveKeyGateTrackedValueOnly(a global gitignore hides.environments/prod/.env) andcmd/agentTestServeStdioExitsNonZeroWithE663OnAProdStackMarkerfail identically on a cleanorigin/main.python3 scripts/ci/check-file-size.py: clean.