Skip to content

Support upgrades for each stable Node major 🌠 - #159

Merged
AdrieanKhisbe merged 5 commits into
masterfrom
feature/node-upgrades-by-major
Oct 30, 2026
Merged

AdrieanKhisbe merged 5 commits into
masterfrom
feature/node-upgrades-by-major

Conversation

@AdrieanKhisbe

@AdrieanKhisbe AdrieanKhisbe commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Automatic upgrades of a primary engines.node range starting with >= now prepare an independent alternative PR for each released, supported even Node major.

engines.node: >=22.12.0
  same base commit
    → upgrade-node-v22.<minor>
    → upgrade-node-v24.<minor>
    → upgrade-node-v26.<minor>
  restore original checkout
  • Select the latest matching release with an available exact Docker tag per major, including Current releases before LTS and excluding prereleases and EOL majors.
  • Raise newer-major engine minima to the selected full release. Preserve same-major Node/npm engine ranges by default; node.preserveSameMajor can override this. Refresh version pins and lockfiles, and activate the selected release for lock synchronization and precommit commands.
  • Reuse branches and PRs for patch updates. After publishing a newer minor, close older generated PRs only for the same major, scope, prefix, base, repository and author.
  • Restore the original checkout after each candidate, continue after failures and return an aggregate failure. Skip unchanged candidates. Explicit targets and other range operators retain the single-upgrade flow.
  • Fix resolved engine-formatting flags and isolate Travis YAML parser state so later alternatives receive valid CI configurations. Keep dependency-cluster upgrades independent.

Evidence

  • Before: Automatic Node upgrades selected one release. Repeated Travis YAML updates reused parser offsets and appended later versions outside node_js.
    After: The E2E fixture verifies independent Node 22, 24 and 26 branches, engine minima, lockfiles, .nvmrc, valid Travis pins, unchanged dependency declarations and checkout restoration. The repeated-update regression test fails before the parser fix and passes after it.

  • npm run lint: passes with three existing TODO/FIXME warnings.

  • npm run test:unit: 98 tests pass on Node 22, covering selection, formatting, configuration, branch isolation, rollback and mocked GitHub publication.

  • npm run test:integration: passes under Node 22, 24 and 26. The suite also covers preserveSameMajor: false, auto-bump, no-op and explicit-target behavior.

  • Integration runs use the real CLI, npm and Git, with a fake nvm function; they do not install the candidate runtimes or publish real GitHub PRs.

  • Coverage: all 192 changed source lines are covered (100% patch coverage). Overall line coverage is 94.38%, branch coverage is 81.37%, and function coverage is 95.03%. Tests cover CLI setup and routing, publication failures, reviewer assignment, failed-commit cleanup and PR ownership safeguards.

@AdrieanKhisbe AdrieanKhisbe self-assigned this Oct 29, 2026
@AdrieanKhisbe
AdrieanKhisbe requested a review from a team October 29, 2026 17:17
@codecov-commenter

codecov-commenter commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.38%. Comparing base (1bc6cce) to head (2c89390).

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #159       +/-   ##
===========================================
+ Coverage   77.46%   94.38%   +16.92%     
===========================================
  Files          20       22        +2     
  Lines         630      784      +154     
===========================================
+ Hits          488      740      +252     
+ Misses        142       44       -98     

☔ 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.

Use the resolved exact and loose settings so CLI flags reach engine updates.
Ensure exact versions remove existing range prefixes and preserve explicit false values.

Add regression coverage for CLI settings, nested fallbacks, and defaults.
@AdrieanKhisbe
AdrieanKhisbe force-pushed the feature/node-upgrades-by-major branch from 16cfd6e to 2c89390 Compare October 30, 2026 10:45
AdrieanKhisbe pushed a commit that referenced this pull request Oct 30, 2026
Merge pull request #159 from CoorpAcademy/feature/node-upgrades-by-major

## Summary

Automatic upgrades of a primary `engines.node` range starting with `>=` now prepare an independent alternative PR for each released, supported even Node major.

```text
engines.node: >=22.12.0
  same base commit
    → upgrade-node-v22.<minor>
    → upgrade-node-v24.<minor>
    → upgrade-node-v26.<minor>
  restore original checkout
```

- Select the latest matching release with an available exact Docker tag per major, including Current releases before LTS and excluding prereleases and EOL majors.
- Raise newer-major engine minima to the selected full release. Preserve same-major Node/npm engine ranges by default; `node.preserveSameMajor` can override this. Refresh version pins and lockfiles, and activate the selected release for lock synchronization and precommit commands.
- Reuse branches and PRs for patch updates. After publishing a newer minor, close older generated PRs only for the same major, scope, prefix, base, repository and author.
- Restore the original checkout after each candidate, continue after failures and return an aggregate failure. Skip unchanged candidates. Explicit targets and other range operators retain the single-upgrade flow.
- Fix resolved engine-formatting flags and isolate Travis YAML parser state so later alternatives receive valid CI configurations. Keep dependency-cluster upgrades independent.

## Evidence

- **Before:** Automatic Node upgrades selected one release. Repeated Travis YAML updates reused parser offsets and appended later versions outside `node_js`.
  **After:** The E2E fixture verifies independent Node 22, 24 and 26 branches, engine minima, lockfiles, `.nvmrc`, valid Travis pins, unchanged dependency declarations and checkout restoration. The repeated-update regression test fails before the parser fix and passes after it.
- `npm run lint`: passes with three existing TODO/FIXME warnings.
- `npm run test:unit`: 98 tests pass on Node 22, covering selection, formatting, configuration, branch isolation, rollback and mocked GitHub publication.
- `npm run test:integration`: passes under Node 22, 24 and 26. The suite also covers `preserveSameMajor: false`, auto-bump, no-op and explicit-target behavior.
- Integration runs use the real CLI, npm and Git, with a fake nvm function; they do not install the candidate runtimes or publish real GitHub PRs.

- Coverage: all 192 changed source lines are covered (100% patch coverage). Overall line coverage is 94.38%, branch coverage is 81.37%, and function coverage is 95.03%. Tests cover CLI setup and routing, publication failures, reviewer assignment, failed-commit cleanup and PR ownership safeguards.
@AdrieanKhisbe
AdrieanKhisbe merged commit 2c89390 into master Oct 30, 2026
6 checks passed
@AdrieanKhisbe
AdrieanKhisbe deleted the feature/node-upgrades-by-major branch October 30, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement 🍭 Nanofeatures and else ;) New Feature 🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants