phase-pr reports CI green on GitLab because it queries pipelines by branch ref, never seeing merge_request_event pipelines #517
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#517
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?
Found on MEDECA-453 (medeca-modul-poptavky, GitLab at gitlab.e-bs.cz).
Symptom
./iw phase-prexited 0 for MR !444 and set review-state toawaiting_review, whose documented meaning is 'CI is green, or there is no CI'. At that moment the MR's pipeline was still running:Cause
The gate enumerates pipelines by branch ref:
This project's pipelines run with
source: merge_request_eventonref: refs/merge-requests/444/head, where the gate never looks. An empty result means 'looked in the wrong place' as readily as 'no CI configured', so exit 0 from this gate is not evidence that anything passed.Impact
phase-prcan hand a still-running or failing MR tophase-merge, whose contract is to merge what the gate proved. In this session the phase MR was merged after the pipeline was polled by id by hand; without that manual step the merge would have been unguarded.Suggested fix
Resolve a GitLab MR's pipeline through the merge request (
/merge_requests/:iid/pipelines) or by commit SHA, not by branch ref, and distinguish 'no pipeline found' from 'pipeline green' — the two should not share an exit code. The same reasoning applies tophase-mergeandci-gate.Workaround used: poll the pipeline by id and read its terminal status directly.
Type: bug
Filed from:
/home/mph/Devel/projects/medeca-modul-poptavky-MEDECA-453on branchMEDECA-453Intake: needs-human
Workflow: diagnostic
Reason: G1 — the analysis holds 2 CLARIFY markers (which pipelines existed for MR !444; GitLab head_pipeline contract when a commit has several pipelines)
Analysis: project-management/issues/IW-517/analysis.md on branch IW-517
Analysis review: unsound (2 blocking findings)
PhasePr.scala:477andCiGateCommand.scala:188passclearCiGatedSha = gatedSha.isEmpty, andPhasePr.scala:353clears it on the failure path — on NoCi the field is already cleared.Defect 1 stands and is reproduced. Defect 2 is struck. Recorded under ## Review Notes on branch IW-517.
Verdict unchanged: needs-human, now on G1 and G7.
Intake: agent-ready
Workflow: diagnostic
Reason: all gates passed — 0 CLARIFY markers, review sound, 1 phase
Analysis: project-management/issues/IW-517/analysis.md on branch IW-517
Fixed on
mainby merge commit6c2baaad(pull request #559, branchIW-517). Closing.The
agent-readylabel was left behind by the implement loop, which does not close its issue when the final pull request merges.