Add the one-branch upstream delivery flow

Merged
JA
3mo ago
+329-0

Summary

Replaces the squash-and-rebuild upstream delivery (the loan chart's docs/plans/loan-chart-upstream-delivery.md §5) with one branch and two pull requests: a delivery branch up/<feature> cut from we-promise/sure main, a fork PR against mirror/upstream-main for this fork's CI and bots, then a draft upstream PR from the same branch. Review is answered with ordinary commits; a rebase happens only on conflict or before merge. The reasoning is in docs/llm-guides/upstream-delivery.md.

What is here

  • .github/workflows/mirror-upstream.yml: refreshes mirror/upstream-main from upstream main nightly with a lease. The branch already exists at bbc42af5.
  • bin/upstream-rebase: rebases an up/* branch onto upstream/main, lints the files it changes, runs the tests named; --onto up/<parent> drops a merged parent's commits for a stacked change. Refuses any other branch and a dirty tree.
  • bin/upstream-sync: opens the weekly merge PR of upstream main into main.
  • bin/upstream-pr fork|upstream: opens the fork PR or the draft upstream PR from docs/upstream/pr-body.md, which carries the sections maintainers asked for on #3473 (demo data, screenshots, migration notes, verification, blast radius). --dry-run prints the body and the command.
  • docs/llm-guides/upstream-delivery.md: the flow and the rules that keep it cheap (small PRs, one bot on the fork, fork-only artefacts stay fork-only).

Verification

  • bash -n on the three scripts; the workflow parses.
  • Smoke-tested on a throwaway up/smoke branch: upstream-rebase no-op rebase and its refusals, upstream-pr fork --dry-run and upstream-pr upstream --dry-run produce the right gh pr create commands (the first run exposed and fixed gh repo view resolving to the parent repo).
  • Nothing was opened against we-promise/sure. The existing #3473 and #3474 keep their current flow until they merge.

🤖 Generated with Claude Code