Architecture¶
Repo Blueprint is one repository that is its own first user: the workflows that check, release and update it are the templates of the workflows of every repository made from it, and each of its releases reaches all of them as a pull request. This page shows how it is built and the path that a release takes. The automation describes every workflow, the security design what the blueprint protects and whom it trusts, the reference every question, variable and secret, and the decisions why it works the way it does.
How the blueprint works¶
copier.ymlholds the questions.template/holds the files of a new repository; a file or folder name such as[% if stack == 'php' %]composer.json[% endif %]carries its condition, and a name that renders empty is left out. The delimiters{= =}and[% %]appear in no workflow, script or manifest, so${{ }}of GitHub Actions and[[ ]]of Bash and TOML stay as they are.- The workflows in
.github/workflows/run in this repository and are the templates of the workflows of every new repository: actionlint lints them and Renovate keeps their actions current here. A line marked Not in the blueprint itself switches a job off in this repository and disappears in new ones. A workflow that only the new repositories run, such as the checks of each kind of project other than Python, starts here only by hand, so that GitHub makes no run of it that only skips, and its template gives each repository its real triggers (decision 0179); the Variants workflow lints and audits them with actionlint and zizmor as each kind has them. blueprint.pystarts the tool of the settings as code, the checklist and the bots. Its code is inblueprint/, a module for each task, with aruff.tomlof its own, so that the Ruff settings of a project don't apply to it.stacks/holds the dependency manifests and lock files of each kind of project, which Renovate keeps current; a new project starts from them.tests/checksblueprint.pyagainst a simulated GitHub and renders every kind of project; the Variants workflow renders each one and runs its own checks with its real tools, and also updates a repository of each kind from the latest release to the commit, which must bring every file of the blueprint as a new repository has it and pass the same checks: every week, and in each pull request but the release pull request for the legs whose rendered project it changes, which the jobvariants planfinds withvariants.py.- Real answers: The Variants workflow updates one with the answers of each repository that takes the blueprint as well, from
tests/answers/, without the sample code and with their licenses, languages and discussions, whose website and lint must pass too. - Downstream: The Downstream workflow clones each of these repositories and updates it as its blueprint bot does, to
mainand to the pull request: its summary names the files whose update the pull request changes and each conflict, before the release brings them there, and every conflict that the pull request brings fails it, in a page as in a workflow, a script or a configuration, since the update pull request of that repository stops at it (downstream.py, decision 1169). For each repository whose update or answers the pull request changes, a jobdownstream (<name>)runs the repository's ownscripts/check.shon its update, with the tools of its stack and after the fixes of the fix bot, and fails when only the update fails them, with the repository, the step and the test or the file; a failure that the update tomainhas as well only warns (decision 1166); its weekly run fails as well when the answers intests/answers/differ from those of a repository, and the fix bot brings them anew. A push tomainthat changestests/answers/, such as the merge of the fix bot's pull request, runs it onmainagain, so thatmainturns green within minutes once the new answers hold (decision 1061). - Windows and the next runner: The Windows workflow runs
scripts/check.shon Windows as well, in Git Bash like a contributor there, every week and for each pull request that changes the code or the tests. The Next runner workflow runs the Variants every week on the runner that the jobs move to next. docs/makes this documentation the website of the blueprint: its pages include the READMEs, and the Dashboard workflow publishes them with the dashboard underdashboard/.reference.pywrites the reference of the website fromcopier.yml, the workflows and the settings as code of the template, so that every question, variable and secret is described where people look for it, and from the registry.github/fleet.tomlthe showcase of the READMEs, the section A real repository of each kind and the order of the Rollout;tests/test_reference.pyfails while a page differs from them.
The path of a release¶
- A merge into
mainof the blueprint starts the Release workflow, whose release-please keeps one release pull request with the next version, decided from the titles of the merged pull requests, and the entries of the changelog as its notes. - The release: the maintainer merges the release pull request, or it merges itself once its checks pass when it holds only updates: once a day, so that the updates of a day make one release, and at once when one of them fixes a vulnerability. Where the variable
RELEASE_MERGEisdaily, as in the blueprint, every release merges itself so, at most one a day, and at once when the maintainer starts the Release workflow by hand. The Release workflow signs its tag with gitsign, publishes the release with its SBOMs and signed provenance, and checks it as its users can. - The Rollout workflow starts the blueprint bot of every repository of the release app right after the release, and the weekly run of the bots stays as a safety net, so that a fix reaches every repository within minutes; a bot whose first attempt failed counts only once the second try that Bot health starts has ended too, so that a moment in which GitHub failed doesn't turn the Rollout red (decisions 0052 and 0010).
- The blueprint bot of each repository verifies the release before it changes anything: the release must be immutable, its tag must point at a commit of the blueprint's
main, and the release workflow of the blueprint must have signed the tag (decision 0020). Then it runscopier updateto it and keeps one pull request on the branchblueprint/update, as the release app, so that the checks of the repository run. - The checks of the repository test the update as they test every pull request. Without conflicts, the pull request merges itself once every check passes; with conflicts, or with
BLUEPRINT_AUTOMERGEset tooff, it waits for the maintainer, as Troubleshooting shows. - The dashboard shows the release of the blueprint that each repository is on, and the update pull request in the colour of its checks, at dennis-otto.github.io/repo-blueprint/dashboard.