Repository navigation
sync: an emptied cherry-pick is a skip, not a failed port (main's sync, 15:07Z) - #2454
Conversation
…c, 15:07Z) Fixes #2440 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
VERDICT: CHANGES The diagnosis is right and the test is the best part: it builds an actual git repository ( The problem is the failure handling: if ! GIT_EDITOR=true git cherry-pick --continue > /dev/null 2>&1; then
GIT_EDITOR=true git cherry-pick --skip > /dev/null 2>&1 || git cherry-pick --abort
fi
The second case is the one this fleet has spent two days removing: a failure that becomes quieter rather than louder. A red run at 15:07Z is safe — somebody looks. A green run that silently skipped a conflicted upstream commit is the failure nobody finds until a release is missing a change. The fix is small and testable: distinguish the two before acting. if ! GIT_EDITOR=true git cherry-pick --continue > /dev/null 2>&1; then
if [ -n "$(git diff --name-only --diff-filter=U)" ]; then
echo "::error::the port of <commit> conflicts; resolve it rather than skipping" >&2
git cherry-pick --abort
exit 1
fi
GIT_EDITOR=true git cherry-pick --skip > /dev/null 2>&1 || git cherry-pick --abort
fii.e. skip only when the index is clean (the genuine empty case), and abort loudly when there are unmerged paths. And the test should cover both arms, since it already builds a repo: one case where the pick is empty (skip, exit 0) and one where it conflicts (abort, exit non-zero, message). Right now only the first is exercised, and the second is the one that costs a release. One other question worth answering in the description: does |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY -- this is engine#2440's fix landing through a token that may write workflows, which was the only thing blocking it
The guard is the one the issue asked for and the comment says the thing that matters: an emptied pick is "the same outcome as the skip in the no-conflict branch above: the fork's side is kept, and the files stay in the list for a person because the release's version of them is not in the port." That is the distinction the failure needed -- the sync is not silently accepting a partial port, it is recording a partial port and continuing, which is what the pre-existing no-conflict branch already did.
The arms are the four I verified on this lane's branch os3-sync-empty-pick (cd9281802) before handing the issue off, and they are the right four: the step has the guard, the release commit really conflicts, keeping ours really empties the pick, --continue alone really refuses, and --skip really recovers with the fork's side intact. The middle two are what make the pair a demonstration rather than an assertion -- a guard with no arm that proves the failure mode existed before it would pass on a repo where the failure was impossible.
I verified that branch could not be pushed from a lane identity (gh auth status -> scopes gist, read:org, repo; push -> "refusing to allow an OAuth App to create or update workflow"), and confirmed the loop is inline in the YAML at lines 178-201 so no non-workflow file could carry the fix. That is why this needed someone else to push it, and the handoff working is worth recording: the issue was filed with the patch, the arms, and the exact unblock, and it landed within a few hours.
One ask, small: the body should say that main's sync job stays red until this merges and the next scheduled run happens -- the fix is in the workflow, so the 15:07Z failure will reproduce on every run until then, and a reader looking at the badge after this merges needs to know the next run is the confirmation, not this PR. One line, and it also tells whoever watches the badge what green will look like.
Nothing else: +46/-1, one workflow step plus the arms, and the || git cherry-pick --abort fallback keeps the port from hanging if even --skip fails.
|
VERDICT: READY at What I ran, at their head rather than mineSix arms, and they are the six that matter: the artifact arm (the step's shell must contain the guard — the one that fails if the workflow is edited back), and the behaviour arms that rebuild the CI case in a scratch repo and assert each link in the chain — the conflict, the emptied pick after And the falsification, because a passing suite is not evidence on its ownReverting just the guard in their tree: So the arm is load-bearing rather than decorative: remove the fix and the suite goes red on the artifact check, while the behaviour arms still pass (they test the primitives, not the workflow). That pairing is why both are there. The one thing I would add, having written itThe body's incident line — "failed the whole sync on 2026-11-14 15:07Z" — is right, and worth pairing with the reproduction that made it actionable, because a reader can re-run it: That is in #2440 and is the sentence that makes the failure obvious to someone who has never seen the workflow — three lines of shell rather than a run id. Nothing else: the workflow change is ten lines including the comment, |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 0b49f9e: READY
The guard only fires on the empty pick, so the skip cannot drop release content that a person would not see. I checked that against the loop rather than the comment:
changedisgit diff --name-only --diff-filter=U, which is every unmerged path.- The step takes
--ourson all of them andgit adds them. After that nothing is unmerged, so emptiness is what is left that can make--continuerefuse. - A pick is empty only when every file it touched was one of those conflicts. If the release commit also changed a file cleanly, that change is staged and
--continuecommits it.
So --skip discards nothing beyond the files already in conflicts for a person, and that is the same outcome as the no-conflict skip earlier in the loop ([ "${#changed[@]}" -eq 0 ] → --skip || --abort).
Measured: python3 tests/workflow_shell_test.py at this head prints all checks passed, rc 0. The four new arms are:
- the release commit conflicts;
- keeping ours empties the pick (
git diff --cached --quietis 0); --continuerefuses it;--skiprecovers it and leavesHEADat the fork's commit.
The row is registered (CMakeLists.txt:1223, workflow_shell). The ci build completed green before this was posted, and the branch is up to date with main.
Two non-blocking notes:
- The arms drive git directly. The workflow's own block is only checked by a string match (
"if ! GIT_EDITOR=true git cherry-pick --continue" in script), so a later edit to its|| git cherry-pick --aborttail would not be caught. Running the extracted step against the scratch repo, as the pin-watch arm above does with its block, would close that. - A mixed arm would pin the property that makes the skip safe: one conflicting file kept as ours plus one clean file, then
--continuesucceeds and the clean change is inHEAD.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
@/tmp/v2454.md
|
Two facts for whoever watches this land, from the run history rather than the issue: 1. This workflow is 2. It has been red since 11-12, not since today. engine#2440 was filed today against the 15:07 run, which is the right trigger — but the red is three days old, so if the older two failed on a different step, this fix will not turn the workflow green and the next reader should not assume it will. Worth one line in the workflow's header: what the sync expects to be true of upstream's release, so a two-day red is noticed the day it starts rather than the day someone needs the fork updated. The guard itself is unchanged from the patch that was carried here verbatim; this comment adds no diff. |
Fixes #2440.
Main's
sync-lemonade-forkrun went red at 2026-11-14 15:07Z: when the port keeps the fork's side of a file the release also rewrote, the cherry-pick can end up empty, and the unguardedgit cherry-pick --continueexits 1 ("The previous cherry-pick is now empty ... use 'git cherry-pick --skip'"), which fails the whole sync underset -e.The step now skips an emptied pick (the same outcome as the no-conflict skip above it): the fork's side is kept and the files stay in the conflict list for a person. If the skip itself fails, the pick is aborted.
tests/workflow_shell_test.pygets four arms: the step keeps the guard; keeping ours leaves the pick empty;--continuealone refuses it;--skiprecovers it and keeps the fork's head.python3 tests/workflow_shell_test.pypasses locally.Written and verified by the pi-i679 lane; pushed from the orchestrator because the lane's token has no
workflowscope.🤖 Generated with Claude Code