Skip to content
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

Migrate to Node 20 #962

Open
wants to merge 6 commits into
base: releases/5.x
Choose a base branch
from
Open

Conversation

qianz2
Copy link

@qianz2 qianz2 commented Aug 18, 2023

Task description

In order to migrate tasks to the Node20 execution handler, we have to update the pipelines-task-lib itself to support the Node20 runtime.

Changelog

  • Created a new release branch releases/5.x
  • Added node20 to task.schema.json
  • Update node 20 version in pipelines
  • Update node 20 version in package.json and package-loc.json
  • Update docs and changelog.

@qianz2 qianz2 requested review from a team as code owners August 18, 2023 22:16
@@ -30,6 +30,8 @@ Use the details below to determine when specific agent features were added:
- Added in 2.144.0. Used node v10.x
* `node16` handler
- Added in 2.206.1. Used node v16.x
* `node20` handler
- Added in 3.225.0. Used node v20.x
Copy link
Author

@qianz2 qianz2 Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We supported node20 handler in this PR, and it's published in release 3.224.0, not sure if here we will require minimum agent version to be >= 3.224.0 to enable node20 support.
cc: @DmitriiBobreshev

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make node20 the default node version in this file? The default is node 16.

console.warn('Unable to find task.json, defaulting to use Node 16');

Copy link
Contributor

@DmitriiBobreshev DmitriiBobreshev Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should since 5.x version uses for node20, if users needs only node16 support and below they can use 4.x version

Comment on lines 43 to 45
"@types/q": "^1.5.4",
"@types/semver": "^7.3.4",
"@types/shelljs": "^0.8.8",
Copy link
Author

@qianz2 qianz2 Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to ensure that the devDependencies in package.json are bumped up as needed? Node20 required typescript version upgrade, we update typescript version to latest 5.1.6 in node 20 tasks, I put same version here and then run 'npm update' command. But I'm not sure if any other dev dependencies require updates.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could use some third-party tools like npm-check to validate that everything is fine

@max-zaytsev
Copy link
Contributor

@qianz2 how were these changes tested?

@qianz2
Copy link
Author

qianz2 commented Aug 21, 2023

@qianz2 how were these changes tested?

Hi @max-zaytsev, I didn't see ways to test these changes other than the existing check azure-pipelines-task-lib. I think we'll use this new release preview version in tasks, then running task tests to ensure they'll work with node20 tasks.

@@ -1,6 +1,6 @@
{
"name": "azure-pipelines-task-lib",
"version": "4.4.0",
"version": "5.4.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should start from the preview version as we did with the node16 migration

@MirKml
Copy link

MirKml commented Sep 12, 2023

important notice - node20 isn't supported on Ubuntu 18.04 - see nodesource
But Ubuntu 18.04 is as supported distro for self hosted agents

When you setup node20 as default runner, it crashes all current production environments with Ubuntu 18.04.
It can be a huge problem.
Node16 runner must be default one for current azure pipeline agent.

@qianz2
Copy link
Author

qianz2 commented Sep 29, 2023

The changes in this PR is tentative, all migrated tasks are working well without bumping and upgrading this task-lib, same as for the tool-lib PR that I initiated, we've planned to create release branches and check changes to master, but they're not blocking the migration as far as I know. So I will hold it for now, eventually we'll check it in.

@@ -429,6 +435,9 @@
"additionalProperties": false,
"description": "Execution options for this task (on Post-Job stage)",
"properties": {
"Node20": {
"$ref": "#/definitions/executionObject"
},
"Node16": {
"$ref": "#/definitions/executionObject"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[not related to this line] releases/5.x is used for other changes - we'll need to re-target these changes

@Drarig29
Copy link

Hi @merlynomsft @qianz2, is it possible to have a status update for this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants