Repository navigation
Add a workflow that rolls Node.js security releases out to every JS repo - #130
NicolasBonet wants to merge 3 commits into
Conversation
Opens a tracking issue when Node.js publishes a security release on a line our repos use, and opens the pull requests that bump repos pinning an exact release, or raise the minimums of repos that float on their major line.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af73559f5d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }, | ||
| npm: (version) => version, | ||
| }); | ||
| return minimums.sort(NodeReleaseUtils.compareVersions).at(-1) ?? null; |
There was a problem hiding this comment.
Check all minimums before declaring a floating repo up to date
When a floating repo has different minimums across its version files, choosing the highest minimum can skip files that still need the security bump. For example, with .nvmrc set to 26, checkRuntimeVersions.sh requiring 26.13.1, and a workspace's package.json requiring >=26.12.1, running with RAISE_MINIMUMS reports “Already requires Node.js 26.13.1 or newer” and leaves the workspace's older requirement unchanged. This is reproducible with the supplied release fixtures. Determine whether any applicable minimum is below the target before skipping, so an already-updated file does not prevent the remaining minimums from being raised.
Useful? React with 👍 / 👎.
…se per line One run with VERSION=26.13.1,24.22.3 now rolls a security release out to every repo: exact pins move to it and repos that float require it as their minimum. Drops the RAISE_MINIMUMS input.
Without VERSION the workflow only moved exact pins to the newest release, which made two behaviours to explain. Forcing an upgrade is now always a deliberate choice of release.
|
Closing for now: we haven't decided how to handle Node.js updates yet. See https://github.com/Expensify/Expensify/issues/696498 |
Details
Rolling out a Node.js security release takes a pull request in about 30 repos, and we only notice a release when someone brings it up. Most of those repos are moving to float on their major line (linked PRs below), so CI and builds pick up patch releases on their own, but App and Mobile-Expensify keep exact pins, and sometimes we need every repo to require a fixed release.
The new
bumpNode.ymlworkflow checks every hour for a recent Node.js security release on a line the repos inconfig/nodeBump.jsonuse, and opens a tracking issue inExpensify/Expensifyfor it. Running it by hand with that issue's URL andVERSION=26.13.1,24.22.3rolls the releases out everywhere in one run: repos that pin an exact version move to them, and repos that float require them as their minimum. Commits are signed by GitHub and credit whoever ran the workflow as a co-author, so each pull request needs one independent approval. The README covers the inputs and details.Related Issues
For https://github.com/Expensify/Expensify/issues/696498
Manual Tests
Added unit tests for the release logic, the file bumping (exact pins, minimums,
package-lock.json,checkRuntimeVersions.sh,.nvmrcformats, the reformatting guard), the config validation, and the issue and pull request text.Ran on my machine:
npx tsx --teston the new test files: 48 passed.npx eslint scripts testsandnpx oxfmt --check: no new problems.tests/claudeReviewToolkit.test.tsfails locally onmaintoo, because mynode_moduleslacksyaml.scripts/actionlint.sh,scripts/validateImmutableActionRefs.sh, and the workflow JSON schema check: all passed.GH_TOKEN=$(gh auth token) npx tsx scripts/openNodeBumpPullRequests.ts --issue-url https://github.com/Expensify/Expensify/issues/696498 --version 26.13.0,24.22.2 --dry-runagainst all 29 repos in the config: every sparse clone worked, and each repo showed the expected diff (for example App 26.12.1 → 26.13.0 in.nvmrc,package.jsonandpackage-lock.json, and Web-Expensify 26.12.1 → 26.13.0 in.nvmrcandcheckRuntimeVersions.sh).npm run bump-node -- --repo-dir <clone>on the float branches of Web-Secure and GitHub-Actions: with--version 26.13.0,24.22.2it only raisesminimumNodeVersionin Web-Secure andengines.nodein GitHub-Actions. A dry run of the workflow script with the same--versionon App, Web-Secure and expensify-common moved each to the release on its line.Not tested yet: a real run that creates branches, commits and pull requests with the OSBotify app token. After merging, I'll start with a dry run from the Actions tab, then a real run limited to one repo with
REPOS.Linked PRs
https://github.com/Expensify/Salt/pull/17539 makes the build boxes install the version in
.nvmrcwith nvm. Once it is deployed,holdForBuildBoxescan be removed from the config.Repos moving to float on their major line, which this workflow treats as "raise minimums only when asked":