Skip to content

ci(upstream-sync): fix a short-circuit that could never fire, and don't stack sync PRs - #84

Merged
hanthor merged 1 commit into
ptyxis-portfrom
ci/upstream-sync-guards
Sep 6, 2026
Merged

hanthor merged 1 commit into
ptyxis-portfrom
ci/upstream-sync-guards

Conversation

@hanthor

@hanthor hanthor commented Sep 6, 2026

Copy link
Copy Markdown
Member

Two independent bugs in upstream-sync.yml, both salvaged from work done in the hanthor/blueshell fork.

1. The up-to-date short-circuit has never fired

if [ "$(git rev-parse HEAD)" = "${upstream_sha}" ]; then

Those can never be equal. ptyxis-port is upstream plus our patch set, so its tip is by definition not upstream's tip. The check has always answered "not up to date", and every run has done a full rebase attempt including runs with nothing to import. The question it meant to ask is whether upstream's HEAD is already contained in ours — git merge-base --is-ancestor.

2. Sync PRs stack

Nothing stopped a run from opening a second upstream-sync/* branch while the previous one was still open. Two such branches are sitting on this repo from June (upstream-sync/2026-06-08, upstream-sync/2026-06-15). Overlapping ranges conflict with each other rather than with upstream — the opposite of the small, mechanical diff the whole strategy is built on. The run now stands down while one is open.

Not ported

The fork also moved this to a daily cadence. Left at weekly: the cadence isn't what was failing, and the site now states weekly.

Context: the label

Separately fixed already (no code change here, documented in UPSTREAM_SYNC.md): labels don't survive a repo transfer, so gh issue create --label upstream-sync had been erroring on the conflict path since the 2026-08-17 move — which is why every conflicting week failed silently while clean weeks looked green. Label recreated 2026-09-06.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EMBRswEeeX2kzVSwpbxCoy

…'t stack sync PRs

The up-to-date check compared `git rev-parse HEAD` against upstream's
HEAD. Those can never be equal: ptyxis-port is upstream plus our patch
set, so its tip is by definition not upstream's tip. The check has
therefore always answered "not up to date" and every run has done a full
rebase attempt, including runs with nothing to import. The question it
meant to ask is whether upstream's HEAD is already *contained* in ours,
which is `git merge-base --is-ancestor`.

Second guard: stand down while an `upstream-sync/*` PR is still open. Two
such branches are sitting on this repo from June. A second sync opened
before the first is dealt with covers an overlapping commit range, so the
two conflict with each other rather than with upstream -- which is the
opposite of the small-mechanical-diff property the whole strategy is
built on.

Both fixes come from work done in the hanthor/blueshell fork; the daily
cadence they were written for does not, since the weekly rebase is not
what was failing.

UPSTREAM_SYNC.md documents the guards, the `upstream-sync` label as a
prerequisite (it does not survive a repo transfer, which broke every
conflict-path run between 2026-08-17 and 2026-09-06 while leaving clean
weeks looking green), and how upstream Ghostty is published from this
repo without sharing any source with the fork.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EMBRswEeeX2kzVSwpbxCoy
@hanthor
hanthor merged commit 06eb8c7 into ptyxis-port Sep 6, 2026
97 of 100 checks passed
@hanthor
hanthor deleted the ci/upstream-sync-guards branch September 6, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant