fix(ploeg): correct first deploys reported out of order and finish deploy checks without a new deploy #187

Merged
ryangr0 merged 1 commit from ryangr0/ploeg-out-of-order-deploys into development 2026-10-03 15:12:07 +00:00 AGit
Owner

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 verify on the pinned toolchain (all gates passed).

Ticket: https://vikunja.webgrip.dev/tasks/1763

🤖 Generated with Claude Code

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 verify` on the pinned toolchain (all gates passed). Ticket: https://vikunja.webgrip.dev/tasks/1763 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ploeg): correct first deploys reported out of order and finish deploy checks without a new deploy
Some checks failed
[Workflow] On Pull Request / checks (pull_request) Has been cancelled
[Workflow] On Pull Request / warnings (pull_request) Has been cancelled
[Workflow] On Pull Request / release-policy (pull_request) Has been cancelled
dc80ba43e3
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.

VIK-1763

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ryangr0 force-pushed ryangr0/ploeg-out-of-order-deploys from dc80ba43e3
Some checks failed
[Workflow] On Pull Request / checks (pull_request) Has been cancelled
[Workflow] On Pull Request / warnings (pull_request) Has been cancelled
[Workflow] On Pull Request / release-policy (pull_request) Has been cancelled
to 50ab325bb5
Some checks failed
[Workflow] On Pull Request / checks (pull_request) Has been cancelled
[Workflow] On Pull Request / warnings (pull_request) Has been cancelled
[Workflow] On Pull Request / release-policy (pull_request) Has been cancelled
2026-10-03 12:33:14 +00:00
Compare
ryangr0 merged commit 23581922f8 into development 2026-10-03 15:12:07 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
webgrip/unfold!187
No description provided.