Skip to content

CLXP-879: resilient node version-manager step (nvm β†’ n fallback)#156

Merged
silouone merged 1 commit into
masterfrom
fix/clxp-879-update-node-n-fallback
Jun 19, 2026
Merged

CLXP-879: resilient node version-manager step (nvm β†’ n fallback)#156
silouone merged 1 commit into
masterfrom
fix/clxp-879-update-node-n-fallback

Conversation

@silouone

Copy link
Copy Markdown
Member

Problem

The update-node auto-bump bot runs in the master-webhook PR-hook CodeBuild builds (coorp-PR-codebuild-<svc>-AllTheTests, post_build, npm run update -- --auto). On a Node bump it hard-coded:

. ${NVM_DIR:-$HOME/.nvm}/nvm.sh && (nvm use || nvm install)

But the CodeBuild images ship n, not nvm (the buildspec uses n auto). So the source failed:

/bin/sh: 1: .: cannot open /root/.nvm/nvm.sh: No such file
Command failed with exit code 2

β†’ red webhook builds across api-progression, cockpit, connect, … The deploy pipelines were never affected (this step isn't in the Build_and_Deploy stage), but the auto-bump PRs silently stopped. The integration test masked the bug via the stub test/integration/nvm.sh.

Fix

Make the version-manager activation resilient: use nvm when present (dev machines + integration stub), fall back to n auto (CI images), and no-op when neither exists so a missing manager can never red a build.

Verification (/bin/sh, the shell execa uses)

Scenario Old New
missing nvm.sh (the bug) exit 1 ❌ β€”
no nvm, no n β€” no-op, exit 0 βœ…
n present (CodeBuild) β€” n auto, exit 0 βœ…
nvm.sh present (integration stub) β€” nvm path, exit 0 βœ…

Version bumped 7.7.0 β†’ 7.7.1. Consumers pin ^7.2.0, so once published the next master push picks it up on npm ci β€” no per-repo change needed.

Note: this repo has no publish CI β€” 7.7.1 still needs a manual npm publish after merge (prod npm currently serves 7.5.0).

πŸ€– Generated with Claude Code

@codecov-commenter

codecov-commenter commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 75.12%. Comparing base (a7a00da) to head (2723be1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #156   +/-   ##
=======================================
  Coverage   75.12%   75.12%           
=======================================
  Files          19       19           
  Lines         619      619           
=======================================
  Hits          465      465           
  Misses        154      154           

β˜” View full report in Codecov by Harness.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@silouone silouone self-assigned this Jun 18, 2026
@silouone silouone requested a review from chrisdugne June 18, 2026 20:14
update-node's post-bump verification hard-coded `nvm`, but the CodeBuild
PR-hook images ship `n` (the buildspec runs `n auto`). On a node bump the
`. $NVM_DIR/nvm.sh` source failed with "cannot open /root/.nvm/nvm.sh"
(exit 2), turning the master-webhook auto-bump builds red β€” though deploys
were unaffected. Use nvm when present, fall back to `n auto`, and no-op
gracefully when neither exists so a missing manager can never red the build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@silouone silouone force-pushed the fix/clxp-879-update-node-n-fallback branch from ea88a46 to 2723be1 Compare June 19, 2026 07:11
@silouone silouone merged commit c72f1cc into master Jun 19, 2026
6 checks passed
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.

3 participants