Skip to content

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

Merged
dcoraboeuf merged 14 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#4
dcoraboeuf merged 14 commits into
nemerosa:mainfrom
rathpc:feat/upgrade-node-24-and-build-toolchain

Conversation

@rathpc
Copy link
Copy Markdown
Contributor

@rathpc rathpc commented May 4, 2026

Summary

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

Also fixes two latent upstream issues:

  1. Aligns index.js with the explicit-status interface advertised in action.yml. The previous feat: explicit status commit (Nov 2025) updated action.yml and the workflow but never updated index.js or rebuilt dist/. The action has been silently broken since then — action.yml advertises a status input, but the bundled action ignores it and tries to poll the GitHub Actions API for a step-name that action.yml doesn't expose. This PR rewrites index.js to match action.yml: takes status/type/flags from inputs, falls back to YONTRACK_* env vars from a previous cli-config step, and never polls the API.

  2. Closes #3 (Add a README). Adds a README.md documenting all inputs, several usage examples, and specifically the if: ${{ !cancelled() }} pattern for unconditional validations the issue called out.

What changed

  • Runtime: engines.node set to >=24; action.yml runtime is node24; CI workflow installs Node 24.
  • Bundling: replaced @vercel/ncc with esbuild + esbuild-plugin-license (driven by build.js). dist/index.js produced by esbuild; dist/licenses.txt carries third-party attributions.
  • Source shape: index.js rewritten in the dependency-injection style of cli-build/cli-setup. A top-level IIFE loads pure-ESM @actions/* packages via dynamic ESM import (namespace, not .default) and calls runAction({core, exec, github}). Source dropped from 184 lines to 71 — the polling machinery is gone.
  • Behavior change (the explicit-status migration): removed the step-name/polling logic; the action now reads status/type/flags from inputs as action.yml describes. Project/branch/build resolve from input → YONTRACK_* env var → context fallback (with build requiring at least one of input/env).
  • Tests: new index.test.js with 17 unit tests covering required inputs, env-var fallbacks, status pass-through, validation data (type+flags), and the invocation contract. Tests run in <200ms without secrets or network.
  • ESLint: eslint 8.x → 10.3.0 with new flat config. .eslintrc.json and .eslintignore removed.
  • Release process: new .releaserc matches the standardized template across the repo family. Floating-tag step force-updates vX and vX.Y after each release.
  • Docs: new README.md (closes Add a README #3); new CLAUDE.md.
  • Workflow: old build.yml replaced by ci.yml with the standardized pipeline.

Why this is breaking

Two reasons:

  1. engines.node >= 24 and runs.using: node24 mean self-hosted runners on older Node will fail. GitHub-hosted runners support Node 24 natively.
  2. The index.js rewrite removes the (undocumented in action.yml) step-name input the old implementation relied on. The intended interface — status as input — has been the documented contract since the maintainer's feat: explicit status commit; this PR makes the implementation match.

Test plan

  • CI passes on this PR (lint, build, tests; self-test against the action is gated to nemerosa + vars.ONTRACK_URL != '' so it skips on fork PRs)
  • After merge, semantic-release publishes v3.0.0
  • Floating tags v3 and v3.0 exist; existing v2 tags untouched
  • CHANGELOG.md is populated by the release commit
  • dist/licenses.txt is regenerated alongside the bundle
  • Issue Add a README #3 auto-closes when this PR merges

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
- Rewrite index.js to match action.yml's explicit-status interface
- Drop the step-name/API-polling implementation (action.yml never advertised it)
- Convert to runAction({core,exec,github}) DI pattern with namespace ESM imports
- Bump @actions/* and semantic-release to latest stable
- Migrate to ESLint 10 flat config
- Add 17 unit tests with mocked GitHub Actions deps
- Standardize release rules (patch on every commit type)
- Add floating major/minor tag step in CI
- Add CLAUDE.md and README.md (closes #3)

BREAKING CHANGE: Now requires Node 24 runtime. Self-hosted runners
must have Node 24 available; GitHub-hosted runners support this
natively. The implementation now matches action.yml's explicit-status
interface — the previous undocumented step-name/polling behavior is
gone. Consumers using @v2 stay on the old code unless they bump to @v3.

Closes #3

@rathpc
Copy link
Copy Markdown
Contributor Author

rathpc commented May 4, 2026

@dcoraboeuf here is another in the batch for your review, thanks!

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

Available in v3.0.0

Thanks for your contribution @rathpc !

@rathpc rathpc deleted the feat/upgrade-node-24-and-build-toolchain branch May 6, 2026 01:29
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.

Add a README

2 participants