Repository navigation
ci(fork): nightly upstream mirror and rebase check - #29
Merged
Merged
Conversation
Upstream's ci.yml only runs on pushes to main, so nothing checked fork-main. Nothing kept the fork's main in sync with upstream either, and a conflicting upstream change only surfaced when someone next tried to rebase by hand. Add fork-main to the ci.yml push branches. Add fork-sync.yml, which nightly fast-forwards the fork's main to upstream main and dry-runs the fork-main rebase in the runner's throwaway checkout, filing or updating a needs-triage issue with the conflicting files. It never pushes fork-main. Add scripts/fork/sync.sh for the real rebase and docs/fork/WORKFLOW.md for the branch model, fork tags, and what to do when the nightly files a conflict.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Upstream's
ci.ymlonly runs on pushes tomain, so nothing ever checkedfork-main. Nothing kept the fork'smainin sync with upstream either, and a conflicting upstream change only showed up whenever someone next tried to rebase by hand, usually at the worst moment.Fix
ci.yml: addfork-mainto the push branches. One line, nothing else in that file (F7)..github/workflows/fork-sync.yml: nightly at 09:17 UTC plusworkflow_dispatch. It fast-forwards the fork'smainto upstreammainwith a plain push, which the server rejects unless it is a fast-forward, so the mirror cannot diverge and nothing is ever forced. Then it rebasesfork-mainontoupstream/mainin the runner's throwaway checkout as a dry run. Clean rebase logs and exits. On conflict it runsgit rebase --abortand opens an issue titledfork-main rebase conflict on upstream <short sha>labelledneeds-triage, listing the conflicting files; a rerun on the same upstream sha comments on the open issue instead of filing a duplicate. It never pushesfork-main. DefaultGITHUB_TOKENonly, withcontents: writeandissues: writedeclared in the workflow.scripts/fork/sync.shanddocs/fork/WORKFLOW.md(F9): the script fetches both remotes, rebasesfork-mainonto a chosen upstream tag ororigin/main, and runsvp run --filter t3 typecheck(t3is the server package's real name; there is no@t3tools/server). On conflict it prints the conflicting paths, aborts, and exits 1. The runbook covers the branch model per ADR 0001, cutting avX.Y.Z-fork.Ntag, running the sync, and resolving a conflict issue.Drift worth naming, not fixing here
ADR 0001 says
fork-maincarries one squashed[fork]commit per project. It currently carries merge commits from PRs #16 through #28 instead. This PR does not touch that, and the nightly dry run works either way, but the ADR and the branch disagree today. Worth a decision on whether to squash the stack or amend the ADR.Verification
python3 -c 'import yaml; yaml.safe_load(...)'on both workflow files.actionlintis not installed on this machine.run:blocks fromfork-sync.ymland ranbash -non each.bash -n scripts/fork/sync.sh.shellcheckis not installed.jqexact-title filter against a matching and a non-matching issue list.fork-mainconflict and ranscripts/fork/sync.shagainst it: it printed the conflicting file, aborted, leftfork-mainat its original sha, left no rebase in progress, and exited 1.fork-main.Claude Opus 5 via Claude Code