Skip to content

feat: upgrade to Node 24 and modernize build toolchain#1

Merged
dcoraboeuf merged 15 commits into
nemerosa:mainfrom
rathpc:feat/upgrade-node-24-and-build-toolchain
May 5, 2026
Merged

feat: upgrade to Node 24 and modernize build toolchain#1
dcoraboeuf merged 15 commits into
nemerosa:mainfrom
rathpc:feat/upgrade-node-24-and-build-toolchain

Conversation

@rathpc
Copy link
Copy Markdown
Contributor

@rathpc rathpc commented May 3, 2026

Summary

Upgrade cli-build to Node 24, esbuild bundling (replacing @vercel/ncc), ESLint 10, real unit tests with mocked GitHub Actions deps, and a standardized semantic-release flow with floating major/minor tags. Adds CLAUDE.md.

This is the Wave 2 canary for the broader ontrack-github-actions-* upgrade effort. The recipe validated here will apply to cli-setup, cli-validation, cli-config, and cli-install in subsequent PRs.

What changed

  • Runtime: engines.node set to >=24; action.yml runtime is node24; CI workflow installs Node 24.
  • Action file: renamed action.yamlaction.yml for consistency across the repo family. runs.using bumped from node16 to node24.
  • Bundling: replaced @vercel/ncc with esbuild + esbuild-plugin-license (driven by a small build.js). dist/index.js is now produced by esbuild; dist/licenses.txt carries third-party attributions (matching ncc's --license semantics).
  • Source shape: index.js refactored to a dependency-injection pattern. A top-level IIFE loads pure-ESM @actions/* packages via dynamic ESM import and calls an exported runAction({core, exec, github}) function. This pattern is necessary because @actions/core@3, @actions/exec@3, and @actions/github@9 are pure ESM and can no longer be require()'d from CJS.
  • Tests: new index.test.js with 14 unit tests covering input handling, fallbacks (project → repo name; branch → ref parse; build → run number), conditional CLI args (release, run-info), setWorkflowRun invocation, and the executable input. Tests run in <200ms without any secrets or network.
  • ESLint: eslint 8.x → 10.3.0 with new flat config (eslint.config.mjs). Companion @eslint/js pinned to ^10.0.1 (latest published — the @eslint/js package versions independently from eslint itself).
  • Release rules: every conventional-commit type now triggers at least a patch release; BREAKING CHANGE: footer always forces major. New .releaserc matches the standardized template across the repo family.
  • Floating tags: new CI step force-updates vX and vX.Y tags after each release, so consumers can pin to @v2 and ride patch updates.
  • Docs: new CLAUDE.md; README.md "Building" section updated for esbuild.
  • Workflow: old minimal .github/workflows/build.yml (which lacked lint/test/release) replaced by .github/workflows/ci.yml with the standardized template (actions/checkout@v6, actions/setup-node@v6, full lint+build+test+release pipeline).

Why this is breaking

engines.node >= 24 and runs.using: node24 mean self-hosted runners on older Node will fail. GitHub-hosted runners support Node 24 natively. Hence the BREAKING CHANGE: footer in the squash-merge commit, which semantic-release will use to bump this action to 2.0.0.

The action's input/output surface is unchanged. Workflows currently using @v1 continue to work against the existing v1 release (untouched); they need to opt into @v2 to get Node 24.

Test plan

  • CI passes on this PR (lint, build, tests; the self-test step is gated to nemerosa owner and won't run from the fork — that's expected)
  • After merge, the main build runs semantic-release and creates the v2.0.0 GitHub release
  • After release, floating tags v2 and v2.0 exist and point at the new release SHA
  • CHANGELOG.md reflects the breaking change
  • dist/licenses.txt is generated alongside the bundle

Squash-merge commit message

When merging, please use this exact commit body:

feat: upgrade to Node 24 and modernize build toolchain

- Replace @vercel/ncc with esbuild + esbuild-plugin-license
- Convert index.js to runAction({core,exec,github}) DI pattern
- Bump @actions/* and semantic-release to latest stable
- Migrate to ESLint 10 flat config
- Add 14 unit tests with mocked GitHub Actions deps
- Standardize semantic-release rules (patch on every commit type)
- Add floating major/minor tag step in CI
- Rename action.yaml -> action.yml for consistency
- Add CLAUDE.md for AI-assisted development

BREAKING CHANGE: Now requires Node 24 runtime. Self-hosted runners
must have Node 24 available; GitHub-hosted runners support this
natively. The action's input/output surface is unchanged; consumers
need to bump @v1 -> @v2 to opt in.

@rathpc
Copy link
Copy Markdown
Contributor Author

rathpc commented May 3, 2026

@dcoraboeuf here is the second in the batch following this one nemerosa/ontrack-github-actions-module-install#1

rathpc and others added 3 commits May 2, 2026 23:59
…/licenses.txt

The `thirdParty.output` was set to a string (`'dist/licenses.txt'`) but
esbuild-plugin-license requires an object `{file, template}`. The string
form silently no-op'd, leaving dist/licenses.txt as the stale ncc-era file
and creating a stray dependencies.txt at project root from the plugin's
default fallback.

Fix: pass `output: { file: 'dist/licenses.txt', template(dependencies) {...} }`
so the plugin writes real per-package attributions. Regenerated dist/licenses.txt
(31 KB, esbuild-plugin-license format). Removed stray dependencies.txt.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rathpc
Copy link
Copy Markdown
Contributor Author

rathpc commented May 4, 2026

@dcoraboeuf the workflow was failing previously on the "self-test" step. A change was made to include another gate which should fix the problem. Please run again when you can, thank you!

@dcoraboeuf
Copy link
Copy Markdown
Contributor

@rathpc, I'm on it.

Side note: please note that since Yontrack V5, there is a new way of configuring your projects: https://docs.yontrack.com/yontrack/ref/latest/content/configuration/ci-config.html. It may worth having a look.

@dcoraboeuf dcoraboeuf merged commit 09ab85d into nemerosa:main May 5, 2026
1 check passed
@dcoraboeuf
Copy link
Copy Markdown
Contributor

Available in v1.0.0

Thanks for your contribution @rathpc !

@rathpc rathpc deleted the feat/upgrade-node-24-and-build-toolchain branch May 6, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants