cypress-io / cypress-example-kitchensink

This is an example app used to showcase Cypress.io testing.
https://example.cypress.io/
MIT License
1.2k stars 2.19k forks source link

Node.js 12 deprecation warning in semantic-pull-request #611

Open MikeMcC399 opened 1 year ago

MikeMcC399 commented 1 year ago

Problem description

Workflow .github/workflows/semantic-pull-request.yml produces a deprecation warning, for example in 6294797314

"Lint Title The following actions uses node12 which is deprecated and will be forced to run on node16: cypress-io/action-semantic-pull-request@v4. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/"

Analysis

.github/workflows/semantic-pull-request.yml

- uses: cypress-io/action-semantic-pull-request@v4

https://github.com/cypress-io/action-semantic-pull-request/blob/v4/action.yml v4

runs:
  using: 'node12'
  main: 'dist/index.js'

This is the latest available version on cypress-io/action-semantic-pull-request so there is no version of this fork available which specifies node16.

The parent repository amannn/action-semantic-pull-request has however been updated and there is a v5 version available which uses node20 and resolves deprecations. See CHANGELOG.

Suggestion

  1. Make v5 available on cypress-io/action-semantic-pull-request
  2. Update .github/workflows/semantic-pull-request.yml to - uses: cypress-io/action-semantic-pull-request@v5 when this is made available.
MikeMcC399 commented 1 year ago

I opened the issue here, because issues are not enabled on the https://github.com/cypress-io/action-semantic-pull-request repo. The next step would be to create a PR on https://github.com/cypress-io/action-semantic-pull-request repo to sync to v5. I am not planning to do this personally and I would rather leave this critical step to the Cypress.io team.

MikeMcC399 commented 1 year ago

The deadline for this issue is the vague date of "summer 2023" according to https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

MikeMcC399 commented 1 year ago

There is a new deadline posted in https://github.blog/changelog/2023-05-04-github-actions-all-actions-will-run-on-node16-instead-of-node12/

Following on from our warning in workflows using Node 12, we will start enforcing the use of Node16 rather than Node12 on the 18th of May.

Edit: GitHub has modified their announcement and moved the milestone to June 14, 2023.

MikeMcC399 commented 1 year ago

My understanding is that, beginning today May 18June 14, 2023, GitHub will start running all JavaScript actions using Node16, even if they have specified they want to run on Node12. That may or may not break https://github.com/cypress-io/action-semantic-pull-request which includes action.yml starting with:

name: semantic-pull-request
author: Jan Amann <jan@amann.me>
description: Ensure your PR title matches the Conventional Commits spec (https://www.conventionalcommits.org/).
runs:
  using: 'node12'
  main: 'dist/index.js'

The preferable course of action in any case is to resync the Cypress fork https://github.com/cypress-io/action-semantic-pull-request with the latest (v5) version of the parent repo https://github.com/amannn/action-semantic-pull-request

In the meantime the results of https://github.com/cypress-io/cypress-example-kitchensink/actions/workflows/semantic-pull-request.yml can be monitored to see if the workflow is going to be broken or not by the planned GitHub change.

MikeMcC399 commented 1 year ago

GitHub moved the deadline to June 14, 2023. See reposted version of https://github.blog/changelog/2023-05-04-github-actions-all-actions-will-run-on-node16-instead-of-node12

MikeMcC399 commented 1 year ago

https://github.com/cypress-io/cypress-example-kitchensink/actions no longer shows a deprecation notice regarding Node.js 12. For example job 5373734601.

This means that the workflow is successfully running under the forced version Node.js 16 despite the definition in

- uses: cypress-io/action-semantic-pull-request@v4

https://github.com/cypress-io/action-semantic-pull-request/blob/v4/action.yml v4

runs:
  using: 'node12'
  main: 'dist/index.js'

It might be cleaner to follow the original suggestion (see below), however since

  1. nothing has been done about this issue in the last three months
  2. doing nothing at this time does not seem to produce any problem to the workflow

I'm closing this issue therefore.

Original Suggestion

  1. Make v5 from https://github.com/amannn/action-semantic-pull-request/ available on cypress-io/action-semantic-pull-request
  2. Update .github/workflows/semantic-pull-request.yml to - uses: cypress-io/action-semantic-pull-request@v5 when this is made available.
MikeMcC399 commented 10 months ago

The deprecation warning has been re-instated:

The following actions uses node12 which is deprecated and will be forced to run on node16: cypress-io/action-semantic-pull-request@v4. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

so I'm re-opening the issue.

Both Node.js 12 and Node.js 16 are now in end-of-life status.

Edit: GitHub's supported strategy for Node.js versions in JavaScript actions however is not well documented at this time, so it is unclear if and when the action cypress-io/action-semantic-pull-request might stop working. It can only be identified as a risk at the moment if nothing is done to update the action. outdated

MikeMcC399 commented 10 months ago

There is a new announcement on https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

At this time node12 actions are forced to run under node16. By early next year 2024 all actions will be forced to run under node20.

The least-effort strategy is to monitor deprecation warnings and to make no changes unless / until something breaks.

MikeMcC399 commented 6 months ago

The workflow semantic-pull-request.yml currently provokes two deprecation warnings, here displayed first as a screenshot:

image

and here as text with hyperlinks:

  1. Lint Title Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: cypress-io/action-semantic-pull-request@v4. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

  2. Lint Title The following actions uses node12 which is deprecated and will be forced to run on node16: cypress-io/action-semantic-pull-request@v4. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

MikeMcC399 commented 4 months ago

The GitHub blog post GitHub Actions; All Actions will run on Node20 instead of Node16 by default announces that all actions are forced to run under Node.js 20 starting on May 13, 2024.