phase-merge squashes a sync phase, so the feature branch loses the main ancestry and the final PR stays unmergeable #750
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#750
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?
final-pr-sync-<main>.mdor a rework that mergesorigin/main) holds a real merge commit on its sub-branch.phase-mergemerges the phase PR with squash (ForgeGateway.mergeSquashAndDelete), so the feature branch gets one flat commit with no parent link tomain. The final PR then shows all of main's changes as its own and the forge reports it not mergeable — the sync achieves nothing. Evidence: IW-672 phase 2 sub-branch commiteca284d0("Merge origin/main into IW-672-phase-02", second parent = origin/maind9e76182) squashed into32334fcd(#748); final PR #735 then had 146 changed files andmergeable: false. Fixed by hand with a tree-identicalgit merge origin/mainon IW-672 (635339dc). A sync phase must reach the feature branch with a merge commit (or the sync must be done on the feature branch directly).Found during IW-672.
Intake: needs-input
Workflow: diagnostic
Reason: G7 (1 [human] finding)
Analysis: project-management/issues/IW-750/analysis.md on branch IW-750
1. Should IW-750 also change
phase-pr --batchand the agent merge guidance, and if so, how? (G7)The issue names only
phase-merge. The analysis also fixesphase-pr --batch, which squashes every phase PR on all forges, and the agent guidance text, which tells agents to merge with--squash. An earlier issue already decided that phase PRs use a merge commit and are not squashed. It also named the batch squash as "inconsistent", but nobody fixed it. No recorded reason for the batch squash exists.Analysis sections: batch fix, guidance, guidance code.
phase-merge. Record batch and guidance as one line in FOLLOW-UPS.md. This is the smallest change, but a sync phase merged in batch mode still breaks the feature branch.--mergeand no--squashfor phase PRs. Batch history is no longer flat. This needs no new git check, fake, contract test or BATS case.git rev-list --merges. This goes against IW-289 and adds the most code.Recommended: b) — it fixes the defect on every merge path and follows the recorded decision, with less code than c).
Answer in a comment on this issue, per number, for example "1: a", or in your own words; intake reads it on its next iteration.
1: b
Seen again on IW-707. Sync phase 2 merged origin/main (merge commit
4baea0bf, parents14429848and132a5cf0) on IW-707-phase-02. phase-merge squashed PR #776 into185bec7cwith one parent, so final PR #768 still reported mergeable=false and showed 181 changed files against merge based9e76182(29 against origin/main). Recovered by a plain merge of origin/main into IW-707 (e2c8e85f); the merged tree is identical to its first parent.Intake: needs-input
Workflow: diagnostic
Reason: G7 (1 [human] finding; answer 1 is applied)
Analysis: project-management/issues/IW-750/analysis.md on branch IW-750
1. Should iw-cli keep the squash-merge path that no command will use after this fix, or remove it? (G7)
After this fix,
phase-pr --batchmerges with a merge commit, which is the choice you made in answer 1 on the issue. Then nothing in iw-cli callsmergeSquashAndDelete. Its only caller now is PhasePr.scala:650. But it is published API: it is in CommandEnv.scala:323 and in docs/api/ForgeGateway.md. Project-local commands can call it. Your rules say that I must get your approval before I remove working code.mergeandsquash. The squash path stays tested, and the reproduction still shows a squash on the second POST. Cost: a code path that iw-cli does not use, and that we must maintain.mergeSquashAndDeletefromForgeGateway,CommandEnvandLiveCommandEnv. Also remove GitHubClient.buildMergePrSquashCommand, GitLabClient.buildMergeMrSquashCommand, theFakeCommandEnvfakes, their tests and thedocs/apisections. The Forgejo body then always sendsDo: "merge", so it needs no style type. Cost: a breaking API change. A project-local command that calls the method stops compiling, so the release notes must say so.Recommended: b) — YAGNI: your recorded rule (IW-289) is that phase PRs use a merge commit, so a squash path that no command calls is code we test and document for nothing. Choose a) if you know of a project-local command that calls it.
Answer in a comment on this issue, per number, for example "1: a", or in your own words; intake reads it on its next iteration.
Intake: agent-ready
Workflow: diagnostic
Reason: all gates passed
Analysis: project-management/issues/IW-750/analysis.md on branch IW-750
Implement: needs-human
Reason: batch-implement exit 1 — the kanon plugin command did not compile against this branch's iw-cli core, so no phase ran
batch-implement.logwas not written. The plugin'slib/batch/ForgeCatchUp.scalaexpectsCommandEnv.tracker.fetchPullRequestForBranchto returnEither[String, …]. Since #778 / #780, iw-climainreturnsEither[TrackerError, …]. The branch is current withmain. This is not specific to this issue: every iw-clinewitem fails the same way until the kanon plugin follows theTrackerErrorchange.Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.