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

skuba migrate node 22 #1735

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open

skuba migrate node 22 #1735

wants to merge 38 commits into from

Conversation

zbrydon
Copy link
Contributor

@zbrydon zbrydon commented Nov 13, 2024

Resolves #1549

Copy link

changeset-bot bot commented Nov 13, 2024

🦋 Changeset detected

Latest commit: ed14a1b

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@zbrydon zbrydon mentioned this pull request Nov 13, 2024
17 tasks
src/cli/migrate/nodeVersion/getNode22TypesVersion.ts Outdated Show resolved Hide resolved
src/cli/migrate/index.ts Outdated Show resolved Hide resolved
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel we need to test how this behaves in a file structure, would the best way to do this be by utilising memfs?

@zbrydon zbrydon marked this pull request as ready for review January 15, 2025 23:24
@zbrydon zbrydon requested a review from a team as a code owner January 15, 2025 23:24
@AaronMoat AaronMoat assigned 72636c and unassigned AaronMoat Feb 4, 2025
Copy link
Member

@72636c 72636c left a comment

Choose a reason for hiding this comment

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

Apologies, I owe you a proper review but just sending through a few initial comments first. Thanks a bunch for this 🙏

export const patches: Patches = [
{
apply: tryUpgradeNode,
description: 'Upgrades Node.js to version 22',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: 'Upgrades Node.js to version 22',
description: 'Upgrade Node.js to version 22',

Copy link
Member

Choose a reason for hiding this comment

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

IIRC we typically put this under the current version (i.e. 9.1.0) as we can't necessarily predict the release it will end up in (could be 9.2.0, could be 10.0.0).


if (type === 'package') {
log.warn(
'Skuba type package is not supported, packages should be updated manually to ensure major runtime depreciations are intended',
Copy link
Member

@72636c 72636c Jan 22, 2025

Choose a reason for hiding this comment

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

Violation of skuba brand guidelines 🧌

Suggested change
'Skuba type package is not supported, packages should be updated manually to ensure major runtime depreciations are intended',
'skuba type package is not supported, packages should be updated manually to ensure major runtime deprecations are intended',

Comment on lines +10 to +15
if (process.env.SKIP_NODE_UPGRADE) {
return {
result: 'skip',
reason: 'SKIP_NODE_UPGRADE environment variable set',
};
}
Copy link
Member

Choose a reason for hiding this comment

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

  1. Does skip permanently discard the patch, or will it retry on the next run without the environment variable? Any thoughts on the desired behaviour here?
  2. I have a slight preference for formalising this as a command-line option because I see it being long lived (new LTS every year), but I could be easily convinced the other way

Comment on lines +4 to +6
execSync(
`npm show @types/node@^${major} version --json | jq '.[-1]'`,
).toString();
Copy link
Member

Choose a reason for hiding this comment

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

  1. I think we'd almost always run in an environment with npm preinstalled, but is there an equivalent package that lets us achieve this without depending on an external binary?
  2. I'm not sure that we can assume that jq is installed. Can we do that part in code?

@@ -41,22 +53,30 @@ describe('nodeVersionMigration', () => {
'plugins:\n - docker#v3.0.0:\n image: node:18.1.2-slim\n',
'.buildkite/pipeline2.yml':
'plugins:\n - docker#v3.0.0:\n image: node:18\n',
'.buildkite/pipline3.yml':
Copy link
Member

Choose a reason for hiding this comment

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

Is pipline intentional 😅. ig it proves we're not strictly matching on pipeline

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.

Node 22 support
4 participants