Repository navigation
Description
main's sync-lemonade-fork is red, the cause is one unguarded cherry-pick --continue, and a fix cannot be pushed from a lane token
Run 43608459423 (sync-lemonade-fork, on main's tip 3ac4a5e1, 15:07:32Z) fails in "Port upstream's latest release into the fork" with git's own words:
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:
git commit --allow-empty
Otherwise, please use 'git cherry-pick --skip'
##[error]Process completed with exit code 1.
What the step does today, and the one case it misses
for c in $picks; do
if git cherry-pick -x "$c" > /dev/null 2>&1; then continue; fi
mapfile -t changed < <(git diff --name-only --diff-filter=U)
if [ "${#changed[@]}" -eq 0 ]; then # failed with no conflict: already applied
GIT_EDITOR=true git cherry-pick --skip ... ; continue
fi
conflicts+=("${changed[@]}")
git checkout --ours -- "${changed[@]}" ... # keep the fork's side
git add -A -- "${changed[@]}"
GIT_EDITOR=true git cherry-pick --continue > /dev/null # <-- unguarded
doneThe covered case is a pick that fails with no unmerged files. The uncovered case is a pick that conflicts, is resolved with --ours, and is then empty — because the release's whole change to that file is exactly what "keep the fork's side" discards. --continue refuses that state, and under set -e the run dies there.
Reproduced offline (git init in a scratch dir):
base -> fork rewrites the line -> release rewrites it differently
cherry-pick -x <release> rc=1 (conflict, as intended)
git checkout --ours -- f.txt; git add -A staged diff: 0 files <-- the pick is now EMPTY
git cherry-pick --continue rc=1 <-- set -e kills the job here
git cherry-pick --skip rc=0 tree clean, HEAD still the fork's commit
The fix (4 lines, in the branch below)
conflicts+=("${changed[@]}")
git checkout --ours -- "${changed[@]}" 2>/dev/null || true
git add -A -- "${changed[@]}"
- GIT_EDITOR=true git cherry-pick --continue > /dev/null
+ # Keeping the fork's side of a file the release also rewrote can leave the pick with
+ # NOTHING to commit -- the release's whole change to those files is what we just
+ # discarded -- and `git cherry-pick --continue` refuses an empty pick ("The previous
+ # cherry-pick is now empty ... use 'git cherry-pick --skip'"). Unguarded, that exit 1
+ # failed the whole sync on 2026-11-14 15:07Z. It 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.
+ 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
+ fiThe files stay in conflicts either way, so the human list is unchanged — the release's version of those files is not in the port, and a person still has to apply it.
Why this issue and not a PR
Branch os3-sync-empty-pick (cd928180) has the fix plus two arms in tests/workflow_shell_test.py, and both are proven: the suite passes with the fix and fails with it reverted (rc 1) — the artifact arm reads the step and requires the guard, the behaviour arm rebuilds the CI case in a scratch repo and asserts the conflict, the emptied pick, that --continue refuses it, and that --skip recovers while keeping the fork's commit.
It cannot be pushed from a lane token:
! [remote rejected] os3-sync-empty-pick -> os3-sync-empty-pick
(refusing to allow an OAuth App to create or update workflow
`.github/workflows/sync-lemonade-fork.yml` without `workflow` scope)
So this needs either the workflow-scoped token (HRX_BUMP_TOKEN already has Contents/PRs/Actions on this repo; the sync itself deliberately never touches a workflow file, which is why its docs say the scope is not needed) or the owner. The patch is also attached as a .patch in the first comment so it needs no branch.
Activity
bong-water-water-bong commentedon Nov 14, 2026
From cd92818 Mon Sep 17 00:00:00 2001
From: t [email protected]
Date: Sat, 14 Nov 2026 11:18:28 -0400
Subject: [PATCH] sync: an emptied cherry-pick is a skip, not a failed port
(main's sync, 15:07Z)
sync-lemonade-fork.yml's port loop already skips a pick that fails with no
unmerged files. The case it did not cover is a pick that conflicts, is resolved
with
checkout --ours-- and then has NOTHING left to commit, because therelease's whole change to those files is what the resolution discarded.
git cherry-pick --continuerefuses that state ("The previous cherry-pick is nowempty ... use 'git cherry-pick --skip'"), and under
set -ethe whole sync died.Measured on the run for 3ac4a5e (43608459423, step "Port upstream's latest
release into the fork"):
Reproduced offline: base -> fork rewrites one line -> release rewrites it
differently -> conflict (rc 1) ->
checkout --oursleaves a staged diff of 0files ->
--continuerc 1. With the guard,--skipreturns 0, the tree is cleanand HEAD is still the fork's commit, which is the same outcome as the existing
no-conflict skip: the fork's side is kept, and the file stays in the conflict
list for a person because the release's version of it is not in the port.
Tests: two arms in tests/workflow_shell_test.py, which already drives workflow
steps offline. One reads the step and requires the
--continueto be guarded(reverting the fix turns the suite red, verified); the other rebuilds the CI case
in a scratch repo and asserts the conflict, the emptied pick, that
--continuerefuses it and that
--skiprecovers while keeping the fork's side.The port step clones both remotes through
gh repo clone, which the file's stubdoes not model, so the arms exercise the pick loop rather than the whole step --
stated here rather than left to be discovered.
.github/workflows/sync-lemonade-fork.yml | 11 +++++++-
tests/workflow_shell_test.py | 36 ++++++++++++++++++++++++
2 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/sync-lemonade-fork.yml b/.github/workflows/sync-lemonade-fork.yml
index be1f79ce0..c2644416a 100644
--- a/.github/workflows/sync-lemonade-fork.yml
+++ b/.github/workflows/sync-lemonade-fork.yml
@@ -198,7 +198,16 @@ jobs:
conflicts+=("${changed[@]}")
git checkout --ours -- "${changed[@]}" 2>/dev/null || true
git add -A -- "${changed[@]}"
diff --git a/tests/workflow_shell_test.py b/tests/workflow_shell_test.py
index 0b1241a95..92ff61533 100644
--- a/tests/workflow_shell_test.py
+++ b/tests/workflow_shell_test.py
@@ -29,6 +29,7 @@ Two guarantees, both offline (CI installs no PyYAML, so the blocks are lifted ou
"""
import json
import os
+import pathlib
import re
import subprocess
import sys
@@ -204,6 +205,41 @@ if script:
p.returncode != 0 and "could not be bumped" in p.stdout + p.stderr, f"rc={p.returncode}")
check("pin-watch: and opens nothing", not [c for c in calls if c.startswith("pr create")], str(calls))
+# 3. sync-lemonade-fork: keeping the fork's side of a conflicting commit can EMPTY the pick, and an
+# unguarded
cherry-pick --continuethen fails the whole port - which is how main's sync went red+# on 2026-11-14 15:07Z ("The previous cherry-pick is now empty ... use 'git cherry-pick --skip'").
+# Two arms: the step must keep the guard, and the guard must be the thing that works.
+text = open(os.path.join(WORKFLOWS, "sync-lemonade-fork.yml")).read()
+script = step_script(text, "Port upstream's latest release into the fork")
+check("sync: has the port step", script is not None)
+if script:
set -e",if failures:
print(f"\n{len(failures)} check(s) failed")
sys.exit(1)
2.53.0
bong-water-water-bong commentedon Nov 14, 2026
State as of 15:25Z: fix verified, still unlandable from a lane identity, and exactly what unblocks it
Re-checked both blockers rather than assuming they still hold.
The push is still refused. Same token, same file:
No
workflowscope, and only one account is configured, so there is no second identity to try.The fix is still correct and still based on main. In
~/1bit-engine(branchos3-sync-empty-pick,cd9281802, andgit merge-base --is-ancestor origin/main HEADpasses — no rebase needed against3ac4a5e19):Four arms, not two: the pair that reproduces the CI failure and the pair that shows recovery. The whole
tests/workflow_shell_test.pysuite is green.What unblocks it — one of these, and I cannot do either:
workflowscope (a fine-grained PAT with Workflows: write, or a classic PAT withworkflow) applied to this branch push. The branch and its commit already exist locally and need nothing butgit push.os3-sync-empty-pick— the branch is 1 commit on top of3ac4a5e19and the working tree is clean.Until then main stays red on that job, and the failure is a noise failure: the sync aborts after the conflict resolution has already happened, so the port is half-applied and the next run starts from a dirty state. That is worth more than a red badge — it is the reason to unblock this before any other lane PR needs the job green.
Why I am not doing it differently: the loop lives inline in
.github/workflows/sync-lemonade-fork.yml(lines 178–201), so there is no non-workflow file I could fix instead. Moving the loop intoscripts/would need the same YAML edit to call it. The only paths are the two above.bong-water-water-bong commentedon Nov 14, 2026
Confirmed from a second lane token, and the patch still applies and passes on today's main — so the only thing missing is the scope.
I tried to land it rather than comment on it, since the issue's blocker is a token question and the issue did not say whose:
Verbatim the same rejection as
os3-sync-empty-pick, from a different lane's token. So this is not one lane's token: every lane token isan installation of the same OAuth App, and none of them carries
workflowscope. That narrows the fix to two doors and closes the thirdpossibility ("maybe another lane can push it").
What I verified before that, on a fresh branch off today's
origin/main(3ac4a5e1-era, not the author's base):git applythe.patchfrom the first commentpython3 tools/copyright.py --checkpython3 tests/workflow_shell_test.py--continuealone refuses that empty pick" and "--skiprecovers it and keeps the fork's side"So the artifact is sound and current; it is blocked on exactly one thing, and neither of the two doors is open to a lane:
workflowscope — the owner's, orHRX_BUMP_TOKENif it has it (the issue notes the sync deliberately never touchesa workflow file, which is why its own docs say the scope is unnecessary — that assumption is what this run disproved);
I did not open a PR: a PR whose branch cannot be pushed is a dead link, and the patch is already the better artifact. My local branch is
deleted rather than left around.
One thing worth deciding alongside the fix: if the sync must never touch a workflow file, then this change to its own workflow is the
first one that does — worth a line in the workflow's header saying the
workflowscope is needed for changes to this file, so the nextlane does not spend the four hours the filer spent believing the device was broken.
bong-water-water-bong commentedon Nov 14, 2026
The fix is in engine#2454 (someone with the
workflowscope carried the patch from this issue verbatim). I ran their head:tests/workflow_shell_test.pyrc=0 on all six sync arms, and reverting just the guard turns it red on the artifact arm — so the fix is load-bearing, not decorative. This issue can close when that PR merges; the scope blocker it records is still the useful part of it.