Skip to content

feat: Add engine compatibility check for PRs#1356

Open
d3xter666 wants to merge 3 commits intomainfrom
engine-compatibility-checks
Open

feat: Add engine compatibility check for PRs#1356
d3xter666 wants to merge 3 commits intomainfrom
engine-compatibility-checks

Conversation

@d3xter666
Copy link
Copy Markdown
Member

Reusable workflow that runs npm ci --dry-run against boundary Node versions and posts a consolidated PR comment with incompatible packages. Adds blocked label on failure with detailed Github Bot comment with the failing packages and their node engines.

Approaches evaluated:

  • npm ci --engine-strict: runtime check only, stops at first failure, misses remaining incompatible packages
  • check-engine (npm): only checks running Node against root engines, doesn't inspect dependency tree
  • check-engine-light (npm): range-vs-range via semver.subset(), but v0.x, only 4 releases, unstable
  • ls-engines (npm): range-vs-range capable, but v0.x, 17-month release gap, 7 prod dependencies

Selected approach: single-job nvm loop using npm ci --dry-run (without --engine-strict). Reports all EBADENGINE warnings as a table in one PR comment. No extra dependencies, no matrix, no artifacts — just shell and tools already on the runner.
Note: NVM seems to come bundled in the GitHub action images

PoC of the implementation: d3xter666/test-ci#1
JIRA: CPOUI5FOUNDATION-1225

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

✅ Engine Compatibility

Node Result Incompatible Packages
v22.20.0 ✅ Pass
v22.22.2 ✅ Pass
v24.0.0 ✅ Pass
v24.14.1 ✅ Pass

@d3xter666
Copy link
Copy Markdown
Member Author

d3xter666 commented Apr 9, 2026

Note: This flow can be ruesed accross repositories the following way:

uses: UI5/cli/.github/workflows/engine-compat.yml@main
with:
  node-versions: '20, 22, 24'

The caller uses owner/repo/.github/workflows/file.yml@ref syntax instead of ./.github/workflows/...
No copying needed. The @ main can also be a tag (@ v1) or SHA for pinning.

I gave it a try in an external repositorty and it seems to be working correctly:

@d3xter666 d3xter666 requested a review from a team April 9, 2026 11:54
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.

1 participant