Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(scripts): check PRs against current main right before merging #24049

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromt3/prevent-main-test-breakagesopened View on GitHub

Showing 4 changed files with 102 additions and 0 deletions (loading 1).

x
0 of 4 viewed, 4 left
6 additions and 0 deletionsdocs/operations/development.mdModified
View file
@@ -160,6 +160,12 @@
run's summary instead of running again. Any change to a file, the install, or a generated file runs
the checks again.
​
+`vp run pr-merge-check <pr>...` runs the same checks on GitHub's current `main` with the given PRs
+merged in order, in a temporary worktree. Run it right before merging, with the whole batch, then
+run the merge commands it prints. They are pinned to the tested heads. With `origin` on GitCafe, it
+fetches from the `github` remote, because the mirror can lag about a minute. The ruleset does not require branches
+to be up to date, because main takes too many merges a day, so a PR's green CI can be days old.
+​
While you iterate, run single checks:
​
```sh
95 additions and 0 deletionsscripts/pr-merge-check.tsAdded
View file
@@ -0,0 +1,95 @@
+// @effect-diagnostics nodeBuiltinImport:off globalConsole:off
+// Checks that pull requests still pass together on current main, right before
+// they merge. Main takes hundreds of merges a day, so the ruleset cannot require
+// branches to be up to date, and GitHub reports CLEAN for a PR that is far
+// behind. A PR's green CI can be days old. Most breaks on main were two changes
+// that each passed alone: a renamed type, a removed dependency, a new request
+// an older test did not stub.
+//
+// vp run pr-merge-check <pr> [<pr>...]
+//
+// Merges GitHub's main and each PR head, in order, in a temporary worktree
+// next to this checkout, then runs check:changed against that main. With
+// `origin` on the GitCafe mirror, which can lag about a minute, fetches use the