Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(engines): fixed defined node version to account for the higher requirement from the npm plugin #2088

Merged
merged 9 commits into from Aug 25, 2021

Conversation

travi
Copy link
Member

@travi travi commented Aug 23, 2021

  • updates engines definition to account for the fact that @semantic-release/npm already required >=10.19, making the definition in this package effectively incorrect
  • updates the docs to refer to node version accounting for this adjustment
  • enforces that all installed packages are within the range defined by this package's engines using ls-engines

@travi travi requested a review from a team August 23, 2021 21:06
…gines`

since `engine-strict` apparently does not fail `npm ci` as was expected
…ines` definition

and to clean up a few cases that were even further out of date
@travi
Copy link
Member Author

travi commented Aug 23, 2021

well, this is frustrating. this is passing locally. i wonder if there is some sort of platform-dependent optional dependency that requires node v12 and doesn't get installed on macOS

…of the matrix

since it is not environment specific, but instead compares the range to that of the dependencies
@travi
Copy link
Member Author

travi commented Aug 23, 2021

the problem seems unlikely to be OS based. the npx ls-engines@0.4 command passes successfully when run in a docker container using the node:14 base image, which is Debian based.

…acos

in the hopes that it will avoid failures for an unknown dependency with incompatible engines that isnt installed on macos
@@ -48,4 +46,6 @@ jobs:
with:
cache: npm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to add the node version explicitly here

Suggested change
cache: npm
cache: npm
node-version:10.19.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think this needs to change from what we had before. ls-engines doesn't do its comparison against the current execution context like we expected engine-strict to do. instead, it analyzes the effective engines range of the dependency tree and compares it against the project's declared engines range. it can do that in any version of node that can execute ls-engines. does this explanation address the reason you were expecting an explicit version to be declared for this job?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah got it! In that case I'd set node-version to 16. Otherwise we get the OS default node version that might change any time. I probably set this up myself without setting node-version explicitly, but I'm doing that now everywhere. But we can do that later, it's outside of the scope here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, makes sense. since i like to keep a record of a preferred development node version in a .nvmrc file in the repo, i typically take care of this by referencing the value from that file in non-matrix jobs, like https://github.com/form8ion/project/blob/b05d76fa60e4c648efbaf98d8f68e69d0155da94/.github/workflows/node-ci.yml#L43

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll plan to get the explicit v16 added to that job as part of our wip v16 branch

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, looks like you already have a PR open for this in #2092 👍🏼

Copy link
Member

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work getting this working 👏🏼

@gr2m gr2m merged commit ea52e17 into master Aug 25, 2021
@gr2m gr2m deleted the enforce-engines branch August 25, 2021 19:01
@github-actions
Copy link

🎉 This PR is included in version 17.4.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 18.0.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants