Skip to content

ci(fork): nightly upstream mirror and rebase check - #29

Merged
Khang5687 merged 1 commit into
fork-mainfrom
feat/fork-workflow
Sep 17, 2026
Merged

Khang5687 merged 1 commit into
fork-mainfrom
feat/fork-workflow

Conversation

@Khang5687

Copy link
Copy Markdown
Owner

Problem

Upstream's ci.yml only runs on pushes to main, so nothing ever checked fork-main. Nothing kept the fork's main in 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: add fork-main to the push branches. One line, nothing else in that file (F7).
  • .github/workflows/fork-sync.yml: nightly at 09:17 UTC plus workflow_dispatch. It fast-forwards the fork's main to upstream main with 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 rebases fork-main onto upstream/main in the runner's throwaway checkout as a dry run. Clean rebase logs and exits. On conflict it runs git rebase --abort and opens an issue titled fork-main rebase conflict on upstream <short sha> labelled needs-triage, listing the conflicting files; a rerun on the same upstream sha comments on the open issue instead of filing a duplicate. It never pushes fork-main. Default GITHUB_TOKEN only, with contents: write and issues: write declared in the workflow.
  • scripts/fork/sync.sh and docs/fork/WORKFLOW.md (F9): the script fetches both remotes, rebases fork-main onto a chosen upstream tag or origin/main, and runs vp run --filter t3 typecheck (t3 is 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 a vX.Y.Z-fork.N tag, running the sync, and resolving a conflict issue.

Drift worth naming, not fixing here

ADR 0001 says fork-main carries 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. actionlint is not installed on this machine.
  • Extracted all four run: blocks from fork-sync.yml and ran bash -n on each.
  • bash -n scripts/fork/sync.sh. shellcheck is not installed.
  • Ran the issue-body builder standalone with a two-file conflict list and confirmed the rendered markdown.
  • Checked the jq exact-title filter against a matching and a non-matching issue list.
  • Built a throwaway repo with a real fork-main conflict and ran scripts/fork/sync.sh against it: it printed the conflicting file, aborted, left fork-main at its original sha, left no rebase in progress, and exited 1.
  • Confirmed the branch guard rejects running from any branch other than fork-main.

Claude Opus 5 via Claude Code

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.
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 17, 2026
@Khang5687
Khang5687 merged commit 6880d9d into fork-main Sep 17, 2026
7 of 16 checks passed
@Khang5687
Khang5687 deleted the feat/fork-workflow branch September 17, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant