Problem/Motivation

Followup to #3566429: Update to 10.6.0 fails due to nodejs version incompatibility

An update to 10.3.0 failed because the dependency 'qified' required by 'stylelint' expects 'Node >= 20' but Drupal 10 specifies Node 18.

  "engines": {
    "yarn": ">= 1.6",
    "node": ">= 18.0"
  },

This issue is to find a way to prevent this type of upgrade failure.

Steps to reproduce

Proposed resolution

Add a GitLab CI job that runs yarn install on the minimum supported version of Node.js, and ensure it fails correctly if the installation fails.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3566827

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

quietone created an issue. See original summary.

andypost’s picture

andypost’s picture

I think we should decouple nodejs out of PHP images so each core major can use required version.

Moreover node releases are not aligned with PHP releases and core maintenance cycle, so probably we need new policy for it

andypost’s picture

We can bundle more then one nodejs version too but only PHP 8.4/8.5 will get monthly updates and building 8.3 and earlier could be a trick

Moreover it will require to watch for security releases of node and rebuild all images will be seriously longer.

PS: NVM is a good workaround but will abuse CI downloading ~30MB of node for each run, so all pipelines will become dependent on nodejs infra

longwave’s picture

To solve the actual problem we found all we need is a CI job that runs on node:18 and runs yarn install. If the job fails then the packages are incompatible with that version. We could do this as a stopgap for every change to package.json/yarn.lock which would at least prevent this from happening again. This is not the same as actually running the build on the older version, but I am not sure that matters as much?

longwave’s picture

Title: Consider a Node version manager in CI » [ci] Add a job to check that yarn install succeeds on the minimum supported version
Issue summary: View changes

Retitling with the suggested approach.

longwave’s picture

Status: Active » Needs review
smustgrave’s picture

only question should the current jobs that use yarn, like estlint, be dependent on this new job?

longwave’s picture

No, this is just a safety net to stop us committing an update that will break on the minimum supported version of Node - it shouldn't affect any of the existing JS related jobs, as (for now) it doesn't seem to matter if they run on a newer version.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Fair enough.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

catch’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to main and 11.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

longwave’s picture

Status: Fixed » Reviewed & tested by the community

Doesn't look like this made it.

  • catch committed 89c42251 on 11.x
    task: #3566827 [ci] Add a job to check that yarn install succeeds on the...

  • catch committed 4136ad1f on main
    task: #3566827 [ci] Add a job to check that yarn install succeeds on the...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Sorry pushed again.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.