Skip to content

feat: automate upstream release sync with fork-patch gate - #2

Merged
sc0rp10 merged 2 commits into
mainfrom
feat/fork-sync-automation
Sep 14, 2026
Merged

sc0rp10 merged 2 commits into
mainfrom
feat/fork-sync-automation

Conversation

@sc0rp10

@sc0rp10 sc0rp10 commented Sep 14, 2026

Copy link
Copy Markdown

What

Two things in one PR — the incident fix and the automation that prevents its recurrence:

1. Restore the lost actions#4404 fix (cherry-pick of 1074c0c5)

The bash/sh script-handler templates did not quote the {0} placeholder, so hook scripts living in paths with spaces (/Volumes/My Shared Files/...) were word-split on execution — actions#4404. This was fixed in May and silently lost during the 2.335.0 upstream sync (rebuilt main + manual commit replay); this restores both the fix and its 147-line L0 test.

2. Automated upstream sync + fork-patch gate

scripts/fork-sync.sh (daily cron via fork-sync.yml):

  1. resolves the latest upstream release (never a raw main commit)
  2. exits idempotently if already merged or a sync PR is open
  3. merges the release tag into sync/upstream-<ver> — patches are carried by git, never replayed by hand
  4. auto-resolves the by-construction conflicts on releaseVersion/src/runnerversion to the fork version (upstream 2.337.0 → fork 2.10337.0); any other conflict aborts and opens a tracking issue
  5. runs the patch gate, pushes, opens a PR — merging stays manual

scripts/verify-fork-patches.sh (runs on every push/PR via fork-patches.yml, plus inside the sync flow): fails when any patch listed in scripts/fork-patches.txt is missing from the inspected ref. Version-churn commits are excluded by design. New unlisted fork commits are reported as notes.

Verification

Follow-ups (manual, outside this PR)

  • Mark Fork patches / verify as a required status check in branch protection
  • When upstream absorbs one of our patches, drop ours and update the manifest in the same PR (git cherry in the sync PR notes absorbed patches)

…#4404)

The bash and sh script handler templates did not quote the {0} placeholder,
causing word splitting when the resolved script path contains spaces
(e.g. /Volumes/My Shared Files/hook.sh).

This affected job hooks and run steps executed from directories with spaces
in their path.

Quote {0} in bash and sh default arguments, matching the approach already
used by pwsh, powershell, and cmd handlers.
Add a daily fork-sync pipeline:

- .github/workflows/fork-sync.yml runs scripts/fork-sync.sh once a
  day. It resolves the latest upstream *release* (never a raw main
  commit), merges it into sync/upstream-<ver>, bumps the fork version
  (upstream 2.337.0 -> fork 2.10337.0) and opens a PR. Merging stays
  manual. On merge conflicts it aborts and opens a tracking issue
  instead of guessing a resolution.
- .github/workflows/fork-patches.yml runs
  scripts/verify-fork-patches.sh on every push/PR. It fails when any
  patch listed in scripts/fork-patches.txt is missing from the
  inspected ref, so a sync that drops a fork patch cannot be merged.
- scripts/fork-patches.txt is the manifest of the fork's patches;
  version-churn commits are excluded by design.

Patches are carried by git merge and verified by the gate, they are
never replayed by hand. This prevents the silent patch loss that hit
us during the 2.335.0 sync (the actions#4404 quoting fix).
@sc0rp10
sc0rp10 merged commit 029676a into main Sep 14, 2026
10 checks passed
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