phase-pr re-triggers CI on every invocation, so a slow build can never be observed green #445
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#445
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Each
iw phase-prinvocation commits a review-state update (chore(<ISSUE>): update review-state for phase NN) and pushes it. On GitLab that push starts a new merge-request pipeline, and the gate then waits on the newest one. When one build takes longer than one poll window the loop cannot converge: the wait expires, the documented recovery is "run the same command again", that run pushes another commit, another pipeline starts, and the gate waits on a build that has just begun.Observed
MR !410 on
CMI/mdr/medeca-modul-poptavky(GitLab, gitlab.e-bs.cz). Build duration 668s against a ~510s poll window produced five pipelines on one branch — 5176, 5177, 5178 (allsuccess), 5179 (running), 5180 (pending) — from four invocations, over four review-state commits (31542745c,bdf9af575,c9adce409,19598688b) stacked on one real code commit (a83fbbfe7).The 30m cumulative budget then expired and the gate reported
Error: CI timed out, leaving review-state atci_failedwhile three builds of the same tree had already passed.Why it misleads twice
ci_failedreads as "CI refused the phase", and the skill's own recovery text says to read the named failing jobs — but no job failed, and there are none to name.--timeoutdoes not help: the budget is measured cumulatively from the first wait, so--timeout 90mon a later invocation still expired at the original 30m mark.Diagnosis without pushing anything further
lists every pipeline on the branch with its status, which makes the churn and the earlier green runs visible at once.
Proposed fix
Either do not push the review-state commit until CI has been observed, or pin the wait to the pipeline id recorded when the PR was created rather than to "the newest pipeline on the branch".
Found during MEDECA-430 (medeca-modul-poptavky); recorded in that issue's
LESSONS.mdentry 14 and promoted at triage.Additional observation from MEDECA-378 (same project, GitLab gitlab.e-bs.cz), phases 02 and 03.
On GitLab merge-result pipelines the re-triggered pipeline does not merely queue alongside the one being waited on — it cancels it.
glab ci listfor phase 03:Every commit after
5b85bc725differs from the previous one only byreview-state.json. The gate then reported "CI timed out" after 30 minutes without a single job having started, while the phase commit itself had already passed in #5211.So the failure mode is worse than "waits on a newer build": the older, green build is actively destroyed by the resume, which is why reading the pipeline list after the fact is the only way to discover the phase was green all along.
Confirms the cumulative-budget note in the original report:
--timeout 90mon a resumed wait did not extend the already-recorded budget.