Six phase commands leave git_sha stale on every review-state card they write #493
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#493
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 triaging IW-436 (LESSONS.md entry 3). Accepted as a residual by IW-436 RESOLVED 3.
IW-436 fixed the stale
git_shainreview-state updateonly. The same defect stays live at six other entry points, because none of them passes agitShatoReviewStateUpdater.UpdateInput:PhaseStart.scala:116PhaseAdvance.scala:214PhasePr.scala:275,327,407,427PhaseMerge.scala:268,325,379CiGate.scala:243,266,401CiGateCommand.scala:172,195,224Why it is not a one-line fix
They write through the
ReviewStateOpsport (env.reviewState.update, some viaReviewStateWrite.tryUpdateatcore/commands/ReviewStateWrite.scala:21), not throughReviewStateAdapterdirectly. A refresh placed in the adapter alone would be invisible to every harness test, andFakeReviewStateOps(core/test/fixtures/FakeCommandEnv.scala:754) would silently diverge from live behaviour.Two options:
gitShafromenv.gitbefore it calls the port.The second is the smaller change and is testable through the existing harnesses.
Consequence while it stays unfixed
git_shaon any card touched by a phase command names an older commit than the card describes, so thewf-implementfast-path resume check ("state SHA is HEAD or an ancestor") passes vacuously there too.Intake: fixed by
40b3921996Commit
40b39219("fix(review-state): record the commit a card was written at on every path") is onmain. It puts thegit_sharefresh inReviewStateWrite.atHead(core/commands/ReviewStateWrite.scala): every update carries HEAD unless the caller names a commit.ReviewStateWrite.writeis now the only production call toenv.reviewState.update, and PhaseStart, PhaseAdvance, PhasePr, PhaseMerge, CiGate and CiGateCommand all write through it. This is option 2 of this issue: the commands fillgitShabefore the port, soFakeReviewStateOpssees the same input.core/test/ReviewStateWriteTest.scalacovers it.Reopen this issue if a phase command still writes a stale
git_sha.