fix(ploeg): correct first deploys reported out of order and finish deploy checks without a new deploy #187
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ryangr0/ploeg-out-of-order-deploys"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Deploy candidates excluded every pull request already marked for the
environment, so when deploy D1 (t1) was reported after D2 (t2 > t1) the
pull request kept t2 as its first deploy: MarkDeployed could replace it
with the earlier time, but the candidate was never offered. One report
also stopped after 50 candidates or 20 seconds, and failed comparisons
waited for the next deploy of that environment.
A pull request is now a candidate unless the environment already has a
deploy of it at or before this deploy's time, so an earlier deploy
reported late corrects the first-deploy time. Migration 0037 records each
conclusive comparison per (deploy, pull request) in deployment_checks, so
repeated reports compare nothing again, and keeps a deploy pending until
every candidate was compared. ploegd sweeps pending deploys every minute
under a five-minute claim: a pass that compared something resumes at
once, a pass where every comparison failed waits one minute doubling to
an hour, and twelve failed passes in a row give the deploy up. ADR-0047,
the deploy-api contract and the pipeline how-to describe the new
behavior.
Migration 0037 (deployment_checks table; checked_at/check_after/check_attempts on deployments). A late, earlier deploy now corrects first-deploy time; each (deploy, PR) is compared once; leftovers beyond 50 candidates or after a forge outage are finished by a new one-minute deploy-check sweep with backoff (gives up after 12 failed passes, ~7 h). Pre-existing deploys start pending and are swept once after upgrade. deployment_checks has no retention yet.
Verified with
mise run verifyon the pinned toolchain (all gates passed).Ticket: https://vikunja.webgrip.dev/tasks/1763
🤖 Generated with Claude Code
dc80ba43e350ab325bb5