ci: give this repo a gate, and let green PRs ship themselves - #3
Merged
Conversation
HamsterCheek had no CI at all. `npm run verify` (typecheck + lint + vitest) has existed since the seed commit and was only ever run by hand — which, for a repo built by dispatched agents, means it was not run. Two of the three commits here landed with nothing checking them. That also made this the one active project that could not participate in the fleet's auto-merge: the sweep refuses to merge a PR with zero checks, so "green PRs merge and deploy themselves" was structurally impossible here. - ci.yml: npm run verify, then migrate + `next build`. The build needs a real database — the home page reads DATABASE_URL at module scope, so page-data collection dies on a bare runner (verified, not assumed). A schema-only Postgres service covers it; the build needs the queries to run, not to return rows. verify itself needs no DB, the unit tests being pure. - auto-merge.yml + scripts/ci/auto-merge-sweep.sh, ported from the fleet. Two deliberate deviations from the fleet template: 1. The sweep drains OLDEST-first. Upstream merges the first PR that `gh pr list` returns, which is newest-first, so an older green PR can wait indefinitely — observed in fleetcrown today, where two sweeps merged the two newest PRs while three older green ones were never evaluated. Fixed there as #182; no reason to seed a known starvation bug into a new repo. 2. The cron is hourly, not */10. This repo is PRIVATE, so Actions minutes are billed, and every other repo running this sweep is public where they are free. At */10 the safety net alone would burn ~4,300 billed minutes a month against a 2,000 allowance, mostly to discover there are no PRs. The common path is workflow_run, which fires seconds after CI goes green, so hourly costs almost nothing in latency. Verified: `npm run verify` green locally (typecheck, lint, 6/6 tests). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This PR introduces auto-merge to a private repo. The version being copied omits checks:read/statuses:read, which only matters on a private repo — which is why it works in ~20 public ones and failed on every single sweep in ivy-portal, merging nothing ever. Adding them here so this repo ships from its first green PR instead of inheriting a silent no-op.
Collaborator
Author
|
Pushed This repo is private, and the auto-merge workflow being copied here omits those two scopes. That omission is invisible on a public repo — it works in ~20 of them — but on a private repo the sweep's Without this, merging #3 would have given this repo a gate that never opens. Template also fixed at source in bitbaum/dotfiles#6. |
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.
HamsterCheek had no CI at all.
npm run verify(typecheck + lint + vitest) has existed since the seed commit and was only ever run by hand — which, for a repo built by dispatched agents, means it was not run. Two of the three commits here landed with nothing checking them.That also made this the one active project that could not participate in the fleet's auto-merge: the sweep refuses to merge a PR with zero checks, so "green PRs merge and deploy themselves" was structurally impossible here.
What's added
ci.yml—npm run verify, then migrate +next build.auto-merge.yml+scripts/ci/auto-merge-sweep.sh— ported from the fleet.The build needs a real database: the home page reads
DATABASE_URLat module scope, so page-data collection dies withDATABASE_URL is not seton a bare runner. I verified that rather than assuming it. A schema-only Postgres service covers it — the build needs the queries to run, not to return rows.verifyitself needs no DB, since the unit tests are pure.Two deliberate deviations from the fleet template
1. The sweep drains oldest-first. Upstream merges the first PR
gh pr listreturns, which is newest-first, so an older green PR can wait indefinitely. Observed in fleetcrown today: two consecutive sweeps merged the two newest PRs while three older green ones were never even evaluated. Fixed there as #182 — no reason to seed a known starvation bug into a new repo.2. The cron is hourly, not
*/10. This repo is private, so Actions minutes are billed; every other repo running this sweep is public, where scheduled runs are free. At*/10the safety net alone would burn ~4,300 billed minutes/month (144 runs/day, each rounded up) against a 2,000-minute allowance — mostly to discover there are no PRs. Hourly costs ~720. Latency barely changes, because the common path isworkflow_run, which fires within seconds of CI going green. Make the repo public and*/10becomes free again.Bootstrap note
GitHub only runs the default branch's copy of
schedule/workflow_runworkflows, so this PR cannot merge itself — the same one-time manual merge every fleet repo needed.ci.ymlruns on this PR immediately, so the gate is provable before anything lands.Verified:
npm run verifygreen locally — typecheck, lint, 6/6 tests.🤖 Generated with Claude Code