[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:
Blocks
blocks FOLIO-3510 UI builds fail in CI during translati... Closed
blocks FOLIO-3452 Roll out Github Actions to remaining ... Closed
Cloners
is cloned by FOLIO-3434 Update NodeJS to Active LTS (v16) in ... Closed
Relates
relates to FOLIO-3433 provide Dockerfile-ish access to GitH... Open
relates to FOLIO-3510 UI builds fail in CI during translati... Closed
relates to FOLIO-3511 Verify node v16 build with a Jenkins-... Closed
relates to UITEN-215 update NodeJS to v16 in GitHub Actions Open
relates to ERM-2957 update NodeJS to v16 in GitHub Actions Closed
relates to ESCONF-22 update NodeJS to v16 in GitHub Actions Closed
relates to FOLIO-3324 Pin to node 14 for release builds Closed
relates to FOLIO-3509 npm publish fails in CI boxes after N... Closed
relates to STCLI-208 update NodeJS to v16 in GitHub Actions Closed
relates to STCOM-996 update NodeJS to v16 in GitHub Actions Closed
relates to STCON-134 update NodeJS to v16 in GitHub Actions Closed
relates to STCOR-623 update NodeJS to v16 in GitHub Actions Closed
relates to STFORM-23 update NodeJS to v16 in GitHub Actions Closed
relates to STRIPES-802 update NodeJS to v16 in GitHub Actions Closed
relates to STRIPESFF-16 update NodeJS to v16 in GitHub Actions Closed
relates to STSMACOM-664 update NodeJS to v16 in GitHub Actions Closed
relates to STUTL-24 update NodeJS to v16 in GitHub Actions Closed
relates to UIAC-51 update NodeJS to v16 in GitHub Actions Closed
relates to UIBULKED-94 update NodeJS to v16 in GitHub Actions Closed
relates to UICAL-202 update NodeJS to v16 in GitHub Actions Closed
relates to UICHKIN-338 update NodeJS to v16 in GitHub Actions Closed
relates to UICHKOUT-782 update NodeJS to v16 in GitHub Actions Closed
relates to UICIRC-815 update NodeJS to v16 in GitHub Actions Closed
relates to UICIRCLOG-99 update NodeJS to v16 in GitHub Actions Closed
relates to UICR-156 update NodeJS to v16 in GitHub Actions Closed
relates to UID-115 update NodeJS to v16 in GitHub Actions Closed
relates to UIDATIMP-1179 update NodeJS to v16 in GitHub Actions Closed
relates to UIDEXP-278 update NodeJS to v16 in GitHub Actions Closed
relates to UIEH-1283 update NodeJS to v16 in GitHub Actions Closed
relates to UIEUS-294 update NodeJS to v16 in GitHub Actions Closed
relates to UIEXPMGR-45 update NodeJS to v16 in GitHub Actions Closed
relates to UIF-382 update NodeJS to v16 in GitHub Actions Closed
relates to UIIN-2049 update NodeJS to v16 in GitHub Actions Closed
relates to UIINREACH-174 update NodeJS to v16 in GitHub Actions Closed
relates to UILDP-55 update NodeJS to v16 in GitHub Actions Closed
relates to UIMARCAUTH-149 update NodeJS to v16 in GitHub Actions Closed
relates to UIMPROF-71 update NodeJS to v16 in GitHub Actions Closed
relates to UINOTES-126 update NodeJS to v16 in GitHub Actions Closed
relates to UINV-409 update NodeJS to v16 in GitHub Actions Closed
relates to UIOA-120 update NodeJS to v16 in GitHub Actions Closed
relates to UIOAIPMH-54 update NodeJS to v16 in GitHub Actions Closed
relates to UIOR-974 update NodeJS to v16 in GitHub Actions Closed
relates to UIORGS-319 update NodeJS to v16 in GitHub Actions Closed
relates to UIPBEX-37 update NodeJS to v16 in GitHub Actions Closed
relates to UIPCIR-37 update NodeJS to v16 in GitHub Actions Closed
relates to UIPER-95 update NodeJS to v16 in GitHub Actions Closed
relates to UIPFCONT-25 update NodeJS to v16 in GitHub Actions Closed
relates to UIPFF-7 update NodeJS to v16 in GitHub Actions Closed
relates to UIPFI-103 update NodeJS to v16 in GitHub Actions Closed
relates to UIPFIMP-49 update NodeJS to v16 in GitHub Actions Closed
relates to UIPFINT-29 update NodeJS to v16 in GitHub Actions Closed
relates to UIPFO-29 update NodeJS to v16 in GitHub Actions Closed
relates to UIPFPAT-44 update NodeJS to v16 in GitHub Actions Closed
relates to UIPFPOL-45 update NodeJS to v16 in GitHub Actions Closed
relates to UIPFU-52 update NodeJS to v16 in GitHub Actions Closed
relates to UIPFU-67 update NodeJS to v16 in GitHub Actions Closed
relates to UIPFUDP-21 update NodeJS to v16 in GitHub Actions Closed
relates to UIQM-241 update NodeJS to v16 in GitHub Actions Closed
relates to UIREC-240 update NodeJS to v16 in GitHub Actions Closed
relates to UIREQ-780 update NodeJS to v16 in GitHub Actions Closed
relates to UIRS-78 update NodeJS to v16 in GitHub Actions Closed
relates to UISE-153 update NodeJS to v16 in GitHub Actions Closed
relates to UISP-34 update NodeJS to v16 in GitHub Actions Closed
relates to UITAG-55 update NodeJS to v16 in GitHub Actions Closed
relates to UITEN-252 update NodeJS to v16 in GitHub Actions Closed
relates to UIU-2607 update NodeJS to v16 in GitHub Actions Closed
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:

  1. replace
    NODEJS_VERSION: '12'

    with

    NODEJS_VERSION: '16'
  2. below FOLIO_NPM_REGISTRY, in build-npm-release.yml add
    FOLIO_NPM_REGISTRY_AUTH: '//repository.folio.org/repository/npm-folio/'

    and in build-npm.yml add

    FOLIO_NPM_REGISTRY_AUTH: '//repository.folio.org/repository/npm-folioci/'
  3. replace
    npm config set _auth $NODE_AUTH_TOKEN

    with

    npm config set $FOLIO_NPM_REGISTRY_AUTH:_auth $NODE_AUTH_TOKEN
  4. in multiple locations, replace
    uses: actions/setup-node@v2

    with

    uses: actions/setup-node@v3

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:

Update nodejs version from 12 or 14 to 16 in CI:

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 FOLIO-3306 Closed (Ankita could perhaps find the original ticket). That ticket does link to the templates repository and some other documentation about it.

As part of the remaining tasks for this FOLIO-3432 Closed , Ankita Sen will be updating the NPM template workflows to be in line with the steps that Zak provided in the desciption of this ticket.

We also do have FOLIO-3322 Closed in progress, for the ability to roll out changes of those workflow templates.

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

This is also a good time to update the minimum node version in package.json engines.node to ">=14.0.0".

to

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.

pursuant to a conversation at Slack#stripes-arch on 2022-06-09.

Generated at Thu Feb 08 23:28:05 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.