Repository navigation
Umbrella PRs assistant - #14763
Draft
ArmandPhilippot wants to merge 10 commits into
Draft
Umbrella PRs assistant#14763ArmandPhilippot wants to merge 10 commits into
ArmandPhilippot wants to merge 10 commits into
Conversation
|
Preview deployment ✅ Deployment complete!
|
- Bind the GitHub clients to their repository - Gather the configuration in one module - Split out the API types - Split the umbrella module by purpose - Move the entry point logic to a testable `runReleaseQueue()` - Rename generic names - Derive types from constants - Remove test-only exports - Complete doc comments
- Anchor the release marker to the end of the umbrella body - List the included PRs from the squash commit titles - Require a sender in GitHub Actions - Keep refreshing the other umbrellas when one fails - Name the request of a malformed JSON answer. - Name the stable branch after its role - Document return values and errors in tags - Type the test fixtures.
- List the umbrella's PRs by number because GitHub already shows their titles - Read only the numbers from the squash commits - Split the umbrella title and release label - Derive the release labels from their types - Extract the long refusal descriptions - Reword some doc comments
This branch has not been deployed
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.
(I know the diff is big so... FYI, without the tests, this is ~2,750 new lines including doc comments)
Description (required)
Automates our release umbrella PRs. When a maintainer adds the new
acceptedlabel to a docs PR, a bot routes it to the umbrella PR of its release (release-queue/<base>), squash-merges it there, and keeps the umbrella PR up to date.The workflow runs in dry run mode at the moment: it only comments with the umbrella a PR would join, or why it wouldn't.
Going live will be a separate PR to update
MODE(after this being reviewed/merged, then tested in the repo) and theCONTRIBUTING.mdguide.What the bot does outside a dry run:
patch-releaseandminor-releaseroute to themainumbrella,major-releaseto the umbrella of a prerelease branch. The bot creates the umbrella branch and PR on the first join, changes the docs PR base, merges it, and comments with the umbrella it joined.acceptedand comments with the reason and how to fix it.[ci] release astro@<version> docs), its labels (merge-on-releaseand the release label), and its description: the[ci] releasePR it ships with and the docs PRs it includes. A prerelease umbrella links the alpha or beta release PR ofnext, or the release PR ofmainoncenextleft prerelease mode. Running the workflow manually refreshes all open umbrellas.[ci] releasePR an umbrella ships with is merged, themainumbrella keeps its title and label until we merge it, and docs PRs for the next release are refused until then. A PR that documents the release just published can still join by targetingrelease-queue/main.The workflow runs
scripts/release-queue.tsfrommain, with Node.js only, and never checks out PR code. Runs are queued one at a time, as joins update the same umbrella PR.The code lives in
scripts/lib/release-queue/:main.ts,cli.ts,config.ts,modes.ts: the entry point and the settings.accepted/: the flow of a PR labeledaccepted(routing, readiness, join, comments).umbrella/: the umbrella PRs (body, title and labels, refresh, merge-block review).release/: the release PRs ofwithastro/astro.github/: a small REST client, with no knowledge of the rest.To try it on any PR without writing anything:
GITHUB_TOKEN=$(gh auth token) node --experimental-transform-types ./scripts/release-queue.ts --pr <number>To see what a manual run would change, use
--refreshinstead of--pr, withMODE=allbefore the command.Unit tests can be run locally with
pnpm test:release-queue.Still to do before review: another cleanup pass, and a test run on a fork.
References