[FOLIO-3432] Update NodeJS to Active LTS (v16) in GitHub Actions images Created: 28/Feb/22 Updated: 26/Jun/23 Resolved: 22/Jun/22 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | Continuous Integration |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Task | Priority: | TBD |
| Reporter: | Zak Burke | Assignee: | Ankita Sen |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Issue links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | DevOps Sprint 139, DevOps Sprint 142, DevOps Sprint 140, DevOps Sprint 141 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Development Team: | FOLIO DevOps | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RCA Group: | TBD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Summary: Use NodeJS's Active LTS (v16 as of February 2022) in GitHub Actions CI images, by setting NODEJS_VERSION: '16' in /.github/actions/build-npm* and changing related values accordingly for NodeJS 16/NPM 8 compatibility. There are four changes in total in the .github/workflows files:
This is also a good time to remove engines.node from package.json because that is a statement of production compatibility and in production this is not a node app. Although we leverage node in development to run lint, tests, compile translations, etc., node is not a production dependency. Details: While investigating some recent UI test failures in CI, we discovered the build-npm.yml files used by most UI repos pin the NodeJS version to v12 (e.g. from ui-requests), a release that is nearing EOL. We’d like to stick to the Active LTS (v16 at present), which I think will happen automatically if we unset the node-version, or if we accept the default version. I don't have strong feelings about the "right" approach; I am sympathetic to avoiding defaults in order to directly control the env as much as possible, but also to the fact that we have many UI apps and issuing 60+ "bump Node's Active LTS version" PRs every year is no fun. Additional relevant links originally provided by Julian Ladisch:
|
| Comments |
| Comment by Zak Burke [ 28/Feb/22 ] |
|
Julian Ladisch's original description:
|
| Comment by Julian Ladisch [ 28/Feb/22 ] |
|
GitHub switched the pre-installed Node in ubuntu-latest Actions runner from Node 14 to Node 16 on Dec 2, 2021: https://github.com/actions/virtual-environments/commit/d0f20ddfa317289a4875d0c6916b285e8ebf8ca3#diff-6be9f9ce03ba57ca01e4ae937d5c2bb04893520fdf391ea87eb46acbc43ecdc5L25 GitHub switched actions/setup-node default Node version from 12 to 16 on Feb 22, 2022: https://github.com/actions/setup-node/pull/414/files I'm fine with using the default version that GitHub provides. But if people would like to set a FOLIO specific default Node version: Fork actions/setup-node to folio-org/setup-node. Then all Actions workflows are to be changed to use it without setting node-version: - uses: folio-org/setup-node@v3 |
| Comment by John Malconian [ 02/Mar/22 ] |
|
The description of this issue focuses on Github Actions pipelines. I would suggest just setting NODEJS_VERSION: '16' in the build-npm and build-npm-release workflows in each repository one at a time via PR. Maybe combine the change with other work to make it easier. We are working on a tool to manage bulk changes but I think we are probably a few weeks away from implementing it. |
| Comment by Jakub Skoczen [ 23/May/22 ] |
|
Ankita Sen please verify if those changes also work for previous versions of node and if so change this across the board. |
| Comment by Michal Kuklis [ 23/May/22 ] |
|
Jakub Skoczen Ankita Sen since this has to be changed across multiple modules perhaps it would be also a good opportunity to consolidate to a workflow template: https://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization so the same setup is not repeated in multiple places. |
| Comment by David Crossley [ 24/May/22 ] |
|
Michal Kuklis – We do already have a set of workflow templates. One related Jira ticket is
As part of the remaining tasks for this
We also do have
|
| Comment by Michal Kuklis [ 24/May/22 ] |
|
Thanks David Crossley. Sorry for not reading the comments above. Yes, what would be ideal is to be able to do what Julian Ladisch describes. Instead of repeating the same setup in each repo it would be great to just write: uses: folio-org/npm-publish@v1 or something similar of that sort.
|
| Comment by John Malconian [ 24/May/22 ] |
|
Michal KuklisZak BurkeAnkita Sen I've tested Michal's changes (thanks, Michal!) and they are compatible with Nodejs version 12, 14, and 16. Therefore, those changes should be set as defaults in the FOLIO workflow templates. I've opened a PR with the changes here: https://github.com/folio-org/.github/pull/18 Ankita Sen If there are no changes that need to be made, please merge. Note that I set NODEJS_VERSION to '16' as the default so that UI repos that implement the GA workflows going forward get Nodejs 16 by default. If a repo is not compatible with 16, the devs can set to a lower version as needed. |
| Comment by Zak Burke [ 16/Jun/22 ] |
|
Note: Description updated to reflect the removal of engines.node from package.json from
to
pursuant to a conversation at Slack#stripes-arch on 2022-06-09. |