forked from davidgf/serverless-plugin-canary-deployments
-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Bump Node version, npm audit fix
#36
Open
khvn26
wants to merge
1
commit into
main
Choose a base branch
from
feat/bump-node-version
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v14 | ||
v18 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this is the error you're talking about: https://github.com/Flagsmith/serverless-plugin-canary-deployments/actions/runs/11251575359/job/31282960668
If so, we might be able to get away with not updating the required Node version by installing the latest npm in CI, instead of upgrading both Node and npm together.
Something like
npm i -g npm@latest
in CI after Node is set up? That way we can avoid introducing a technically-breaking change.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is why doesn't the action install latest NPM straight away. My guess was that NPM dropped support for Node below LTS, but I didn't confirm it, to be honest.
Bumping NPM manually in CI does seem ugly considering the setup-node action is expected to provide the latest possible version out of the box. That being said, I believe only the
.nvmrc
change actually affects the error in CI; the engine version bump happened to freshen up dependencies and alleviate NPM's audit warnings.I do agree that depending on node
>=18.0
is a bit radical, considering that serverless' current constraint is>=12.0
. I think we could loosen the constraint to match the serverless one. I definitely don't want to keep the>=4.0
one to avoid outdated dependencies.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node.js always comes bundled with NPM at a specific version - the latest NPM is never installed automatically. In the action logs you can see the actual Node 14 dependency that is downloaded (
https://github.com/actions/node-versions/releases/download/14.21.3-4202774076/node-14.21.3-linux-x64.tar.gz
). This tarball contains NPM 6.14.18.I'm fairly sure we could fix this issue by only adding
npm install npm@latest
in CI and not changing anything else, though I've not tested it.