From 0e7bf8ac9e878f7689a7440c4a0fa759d4175096 Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Mon, 12 Oct 2026 11:59:18 +0100 Subject: [PATCH 1/5] ci: Cut releases with release-please and lint PR titles --- .github/workflows/release.yml | 49 +++++++++++++++++++++++++++++++ .github/workflows/semantic-pr.yml | 37 +++++++++++++++++++++++ .release-please-manifest.json | 3 ++ CLAUDE.md | 11 ++++--- CONTRIBUTING.md | 18 ++++++++---- release-please-config.json | 25 ++++++++++++++++ 6 files changed, 133 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/semantic-pr.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000..7528cfb99e6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Release Please + +on: + push: + branches: [master] + workflow_dispatch: {} + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release-please: + name: Release Please + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + # A pull request opened with GITHUB_TOKEN does not trigger workflows, so + # the release PR is opened as the app instead. + - name: Mint app token + id: app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3 + with: + client-id: ${{ secrets.RELEASE_APP_CLIENT_ID }} + private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} + + - name: Run release-please + id: release + uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5 + with: + token: ${{ steps.app-token.outputs.token }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + + - name: Summarise + env: + RELEASE_CREATED: ${{ steps.release.outputs.release_created }} + TAG_NAME: ${{ steps.release.outputs.tag_name }} + PRS_CREATED: ${{ steps.release.outputs.prs_created }} + run: | + if [ "$RELEASE_CREATED" = "true" ]; then + echo "Released $TAG_NAME" >> "$GITHUB_STEP_SUMMARY" + elif [ "$PRS_CREATED" = "true" ]; then + echo "Release PR created/updated" >> "$GITHUB_STEP_SUMMARY" + else + echo "Nothing to release" >> "$GITHUB_STEP_SUMMARY" + fi diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml new file mode 100644 index 00000000000..ca2199f0be8 --- /dev/null +++ b/.github/workflows/semantic-pr.yml @@ -0,0 +1,37 @@ +name: Semantic PR + +on: + pull_request_target: + types: [opened, edited, synchronize, reopened] + +permissions: + pull-requests: read + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + title: + name: Conventional PR title + runs-on: ubuntu-latest + timeout-minutes: 4 + steps: + # Squash-merge uses the PR title as the commit message, so linting the + # title is what keeps master's history conventional for release-please. + # The scope is the crate, e.g. `feat(store): ...`. + - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + feat + fix + docs + test + refactor + perf + build + ci + chore + revert diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000000..e564a448c98 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.45.0" +} diff --git a/CLAUDE.md b/CLAUDE.md index b8ec983428b..ce8738323bb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -184,11 +184,14 @@ Blockchain → Chain Adapter → Block Stream → Trigger Processing → Runtime ### Commit Convention -Use format: `{crate-name}: {description}` +Use [Conventional Commits](https://www.conventionalcommits.org) with the crate as scope: `{type}({crate-name}): {description}` -- Single crate: `store: Support 'Or' filters` -- Multiple crates: `core, graphql: Add event source to store` -- All crates: `all: {description}` +- Single crate: `feat(store): Support 'Or' filters` +- Multiple crates: `feat(core,graphql): Add event source to store` +- All crates: `refactor(all): {description}` +- Types: `feat`, `fix`, `docs`, `test`, `refactor`, `perf`, `build`, `ci`, `chore`, `revert`; mark breaking changes with `!` (`feat(store)!: ...`) + +release-please reads every commit on master, so each one must follow this format. The Semantic PR workflow checks PR titles, which become the commit message when a PR is squash-merged. release-please derives versions and the changelog from these commits: while the version is below 1.0, `feat` and breaking changes bump the minor version, `fix` and `perf` bump the patch version. ### Git Workflow diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7992c32c49f..cfa58c70632 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,12 +50,18 @@ detailed instructions about how to run the sharded integrations tests. ## Commit messages and pull requests -We use the following format for commit messages: -`{crate-name}: {Brief description of changes}`, for example: `store: Support 'Or' filters`. - -If multiple crates are being changed list them all like this: `core, -graphql: Add event source to store` If all (or most) crates are affected -by the commit, start the message with `all: `. +We use [Conventional Commits](https://www.conventionalcommits.org) with +the crate as scope: `{type}({crate-name}): {Brief description of changes}`, +for example: `feat(store): Support 'Or' filters`. The types are `feat`, +`fix`, `docs`, `test`, `refactor`, `perf`, `build`, `ci`, `chore` and +`revert`; mark breaking changes with `!` (`feat(store)!: ...`). + +If multiple crates are being changed list them all like this: +`feat(core,graphql): Add event source to store`. If all (or most) crates +are affected by the commit, use the scope `all`. + +release-please derives versions and the changelog from the commits on +master, so every commit that lands there must follow this format. The body of the message can be terse, with just enough information to explain what the commit does overall. In a lot of cases, more extensive diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000000..1418f9eec85 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "bootstrap-sha": "8e3debd675309d96eb987bf90f053f378bc917bf", + "last-release-sha": "8e3debd675309d96eb987bf90f053f378bc917bf", + "bump-minor-pre-major": true, + "include-component-in-tag": false, + "packages": { + ".": { + "release-type": "simple", + "changelog-path": "CHANGELOG.md", + "extra-files": [ + { + "type": "toml", + "path": "Cargo.toml", + "jsonpath": "$.workspace.package.version" + }, + { + "type": "toml", + "path": "Cargo.lock", + "jsonpath": "$.package[?(!@.source)].version" + } + ] + } + } +} From 19a34424572f4ff18376e52f7b7bb117dcd3d864 Mon Sep 17 00:00:00 2001 From: Carlos Jorge Date: Wed, 18 Nov 2026 00:11:41 +0000 Subject: [PATCH 2/5] ci(release): Mint the release token from the organisation's shared App The App is shared by the organisation's release-please repositories: its client ID is an org variable and its key an org secret, both granted to selected repositories. The token is limited to this repository and to contents, pull requests and issues. Say why it is an App: a release created with GITHUB_TOKEN triggers no workflows, so gnd-binary-build.yml (on: release: published) would not run. --- .github/workflows/release.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7528cfb99e6..78b1233a24a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,14 +17,25 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - # A pull request opened with GITHUB_TOKEN does not trigger workflows, so - # the release PR is opened as the app instead. + # release-please acts as the organisation's release App, not as + # GITHUB_TOKEN: what GITHUB_TOKEN creates triggers no workflows, so the + # release would not run `gnd-binary-build.yml` (on: release: published) + # and the release PR would get no CI. The App is shared by the + # organisation's release-please repositories (org variable + # RELEASE_APP_CLIENT_ID, org secret RELEASE_APP_PRIVATE_KEY, both + # granted to selected repositories); the token is limited to this + # repository and to what release-please needs. - name: Mint app token id: app-token uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3 with: - client-id: ${{ secrets.RELEASE_APP_CLIENT_ID }} + client-id: ${{ vars.RELEASE_APP_CLIENT_ID }} private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: ${{ github.event.repository.name }} + permission-contents: write + permission-pull-requests: write + permission-issues: write - name: Run release-please id: release From 61d173dc6006af2e445ee8308e2e548c4609d3f6 Mon Sep 17 00:00:00 2001 From: Carlos Jorge Date: Wed, 18 Nov 2026 00:11:45 +0000 Subject: [PATCH 3/5] ci: Check PR titles on pull_request instead of pull_request_target The check only reads the title, which a fork's read-only token allows, so it needs no pull_request_target job. The repository is admitted to forge's public runners on the condition that it has none. Group runs by PR number: two forks' branches can share a name. --- .github/workflows/semantic-pr.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml index ca2199f0be8..1f402e8390c 100644 --- a/.github/workflows/semantic-pr.yml +++ b/.github/workflows/semantic-pr.yml @@ -1,14 +1,17 @@ name: Semantic PR +# pull_request, not pull_request_target: the check only reads the title, so +# a fork's read-only token is enough, and the repository keeps no +# pull_request_target job (a condition of running on forge's public runners). on: - pull_request_target: + pull_request: types: [opened, edited, synchronize, reopened] permissions: pull-requests: read concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true jobs: From 5f33c0519353108827b2fdf7e07c2f457b8cb36e Mon Sep 17 00:00:00 2001 From: Carlos Jorge Date: Wed, 18 Nov 2026 00:11:45 +0000 Subject: [PATCH 4/5] docs: Squash-merge pull requests and document the release routine Pull requests are squash-merged and their title is the conventional commit release-please reads; this replaces the local rebase-and-push merge. Releases: merge a NEWS.md pull request with the version's notes, then the release pull request. Release-As overrides the proposed version. --- CLAUDE.md | 2 +- CONTRIBUTING.md | 76 ++++++++++++++++++++++++++----------------------- 2 files changed, 41 insertions(+), 37 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index ce8738323bb..e070e6329a0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -191,7 +191,7 @@ Use [Conventional Commits](https://www.conventionalcommits.org) with the crate a - All crates: `refactor(all): {description}` - Types: `feat`, `fix`, `docs`, `test`, `refactor`, `perf`, `build`, `ci`, `chore`, `revert`; mark breaking changes with `!` (`feat(store)!: ...`) -release-please reads every commit on master, so each one must follow this format. The Semantic PR workflow checks PR titles, which become the commit message when a PR is squash-merged. release-please derives versions and the changelog from these commits: while the version is below 1.0, `feat` and breaking changes bump the minor version, `fix` and `perf` bump the patch version. +Pull requests are squash-merged, so the PR title becomes the commit on master; the Semantic PR workflow checks it. release-please derives versions and the changelog from these commits: while the version is below 1.0, `feat` and breaking changes bump the minor version, `fix` and `perf` bump the patch version. Commits inside a PR use the same format. ### Git Workflow diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cfa58c70632..84e7062df1b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,53 +50,57 @@ detailed instructions about how to run the sharded integrations tests. ## Commit messages and pull requests -We use [Conventional Commits](https://www.conventionalcommits.org) with +Pull requests are squash-merged: the pull request's title becomes the +commit on master, and its description the commit body. release-please +derives versions and the changelog from those commits, so the title must +follow [Conventional Commits](https://www.conventionalcommits.org) with the crate as scope: `{type}({crate-name}): {Brief description of changes}`, for example: `feat(store): Support 'Or' filters`. The types are `feat`, `fix`, `docs`, `test`, `refactor`, `perf`, `build`, `ci`, `chore` and -`revert`; mark breaking changes with `!` (`feat(store)!: ...`). +`revert`; mark breaking changes with `!` (`feat(store)!: ...`). The +Semantic PR check verifies the title. If multiple crates are being changed list them all like this: `feat(core,graphql): Add event source to store`. If all (or most) crates are affected by the commit, use the scope `all`. -release-please derives versions and the changelog from the commits on -master, so every commit that lands there must follow this format. - -The body of the message can be terse, with just enough information to -explain what the commit does overall. In a lot of cases, more extensive -explanations of _how_ the commit achieves its goal are better as comments -in the code. - -Commits in a pull request should be structured in such a way that each -commit consists of a small logical step towards the overall goal of the -pull request. Your pull request should make it as easy as possible for the -reviewer to follow each change you are making. For example, it is a good -idea to separate simple mechanical changes like renaming a method that -touches many files from logic changes. Your pull request should not be -structured into commits according to how you implemented your feature, -often indicated by commit messages like 'Fix problem' or 'Cleanup'. Flex a -bit, and make the world think that you implemented your feature perfectly, -in small logical steps, in one sitting without ever having to touch up -something you did earlier in the pull request. (In reality, that means -you'll use `git rebase -i` a lot) +Only `feat`, `fix`, `perf` and breaking changes appear in the changelog; +while the version is below 1.0, `feat` and breaking changes bump the +minor version, `fix` and `perf` the patch version. + +The description can be terse, with just enough information to explain +what the change does overall. In a lot of cases, more extensive +explanations of _how_ it achieves its goal are better as comments in the +code. + +Commits in a pull request should still be structured in such a way that +each commit consists of a small logical step towards the overall goal of +the pull request, so that the reviewer can follow each change you are +making. For example, it is a good idea to separate simple mechanical +changes like renaming a method that touches many files from logic changes. Please do not merge master into your branch as you develop your pull request; instead, rebase your branch on top of the latest master if your pull request branch is long-lived. -We try to keep the history of the `master` branch linear, and avoid merge -commits. Once your pull request is approved, merge it following these -steps: -``` -git checkout master -git pull master -git rebase master my/branch -git push -f -git checkout master -git merge my/branch -git push -``` +Once your pull request is approved, merge it with the `Squash and merge` +button, checking that the title is the commit message you want on master. +Changes reach master only through pull requests. + +## Releases + +release-please keeps a release pull request open, `chore(master): release +X.Y.Z`, that bumps the version in `Cargo.toml` and `Cargo.lock` and adds +the changes since the last release to `CHANGELOG.md`. To release: + +1. Add the release's notes to `NEWS.md` in a pull request of its own and + merge it. (Don't edit the release pull request: release-please + rewrites it on every push to master.) +2. Merge the release pull request. release-please tags `vX.Y.Z` and + creates the GitHub release, which publishes the graph-node binaries + and Docker images (`release.yml`) and the gnd binaries and npm + packages (`gnd-binary-build.yml`). -Allegedly, clicking on the `Rebase and merge` button in the Github UI has -the same effect. +To release a version other than the one release-please proposes, put +`Release-As: X.Y.Z` in the body of a commit on master (for example in the +squash-merge description of a pull request). From 8d139ebac4e977ca6c95ba82e6c5b7c10c9b78c3 Mon Sep 17 00:00:00 2001 From: Carlos Jorge Date: Fri, 27 Nov 2026 20:35:58 +0000 Subject: [PATCH 5/5] ci(release): Describe the App as the organisation's release identity --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78b1233a24a..b146c8048b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,9 +20,9 @@ jobs: # release-please acts as the organisation's release App, not as # GITHUB_TOKEN: what GITHUB_TOKEN creates triggers no workflows, so the # release would not run `gnd-binary-build.yml` (on: release: published) - # and the release PR would get no CI. The App is shared by the - # organisation's release-please repositories (org variable - # RELEASE_APP_CLIENT_ID, org secret RELEASE_APP_PRIVATE_KEY, both + # and the release PR would get no CI. The App is the organisation's + # release identity, used by the repositories it makes releases for (org + # variable RELEASE_APP_CLIENT_ID, org secret RELEASE_APP_PRIVATE_KEY, both # granted to selected repositories); the token is limited to this # repository and to what release-please needs. - name: Mint app token