Skip to content

Release process: Automatically rebuild PRs#3914

Open
henrymercer wants to merge 4 commits into
mainfrom
henrymercer/auto-rebuild-release-prs
Open

Release process: Automatically rebuild PRs#3914
henrymercer wants to merge 4 commits into
mainfrom
henrymercer/auto-rebuild-release-prs

Conversation

@henrymercer
Copy link
Copy Markdown
Contributor

Automatically rebuild the backport and mergeback PRs so maintainers don't have to do the "remove and readd "Rebuild" label, wait for rebuild, mark PR as ready for review" dance twice on each release.

Since we need to revert the modifications to the build artifacts in the backport PRs, we continue to produce a separate "Rebuild" commit to keep code changes isolated.

Copilot AI review requested due to automatic review settings May 18, 2026 18:14
@henrymercer henrymercer requested a review from a team as a code owner May 18, 2026 18:14
@github-actions github-actions Bot added the size/S Should be easy to review label May 18, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the release automation to automatically rebuild distribution artifacts for mergeback and backport PRs, eliminating the manual “remove/re-add Rebuild label” step while still keeping rebuild changes isolated in dedicated commits.

Changes:

  • Add an automatic rebuild+commit step for mergeback branches in prepare-mergeback-branch (and align Node version usage).
  • Add an automatic rebuild+commit step for backport branches in .github/update-release-branch.py.
  • Enable Node 24 + npm caching in relevant release workflows/actions.
Show a summary per file
File Description
.github/workflows/post-release-mergeback.yml Sets up Node 24 and npm caching for the mergeback workflow.
.github/update-release-branch.py Adds “Rebuild” commit automation for backport branches and updates revert logic.
.github/actions/release-initialise/action.yml Bumps Node to 24 and enables npm cache for release automation jobs.
.github/actions/prepare-mergeback-branch/action.yml Automatically rebuilds artifacts and conditionally creates a “Rebuild” commit before pushing the mergeback branch.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 2

Comment thread .github/update-release-branch.py Outdated
Comment thread .github/update-release-branch.py
@henrymercer henrymercer force-pushed the henrymercer/auto-rebuild-release-prs branch from 7510620 to 8442bc0 Compare May 18, 2026 18:19
mbg
mbg previously approved these changes May 18, 2026
Copy link
Copy Markdown
Member

@mbg mbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks OK and this isn't blocking, but I'd really like to get the remaining Python scripts / parts of the workflows converted to TypeScript 😅

Comment on lines +45 to +69
- name: Rebuild the Action
shell: bash
run: |
set -exu
npm ci
npm run build

- name: Check for rebuild changes
id: rebuild_changes
shell: bash
run: |
set -exu
git add --all
if git diff --cached --quiet; then
echo "has_changes=false" >> "${GITHUB_OUTPUT}"
else
echo "has_changes=true" >> "${GITHUB_OUTPUT}"
fi

- name: Commit rebuild
if: steps.rebuild_changes.outputs.has_changes == 'true'
shell: bash
run: |
set -exu
git commit -m "Rebuild"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make this a reusable action?

Copy link
Copy Markdown
Contributor Author

@henrymercer henrymercer May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that, but in this case we're only interested in running npm run build — running the linter, sync_back and sync is pointless.

node-version: 20
cache: 'npm'
node-version: 24
cache: 'npm' # shared with the "Rebuild Action" workflow
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not just with the "Rebuild Action" workflow

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, I'll just remove this

- uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm' # shared with the "Rebuild Action" workflow
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not just with the "Rebuild Action" workflow

@henrymercer
Copy link
Copy Markdown
Contributor Author

This looks OK and this isn't blocking, but I'd really like to get the remaining Python scripts / parts of the workflows converted to TypeScript 😅

I'd also prefer that they were written in TypeScript, but this change isn't making them much more complex, and I don't have capacity to port them at the moment.

@henrymercer henrymercer requested a review from mbg May 18, 2026 18:38
Comment thread .github/update-release-branch.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Should be easy to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants