Skip to content

Conversation

@salmanmkc
Copy link
Contributor

@salmanmkc salmanmkc commented Jul 31, 2025

Update the project to support Node.js version 24, including adjustments to workflows and package dependencies.

Following this PR, there will be releases, and following those there will be bumps to versions, e.g. io-utils will be released at version 2.0.0 and then that can be updated to be used in actions/cache. Following that, the actions/cache will be able to consume the package and that can be released.

@salmanmkc salmanmkc marked this pull request as ready for review August 13, 2025 11:24
Copilot AI review requested due to automatic review settings August 13, 2025 11:24
@salmanmkc salmanmkc requested review from a team as code owners August 13, 2025 11:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Updates the project to support Node.js version 24, addressing compatibility issues and modernizing the development environment. This includes package version updates, workflow adjustments, and specific compatibility fixes for Node.js 24 behavioral changes.

  • Update Node.js version requirement to 24.0.0 across all packages and workflows
  • Add custom readlink implementation to handle Windows directory symlink behavior changes in Node.js 24
  • Refactor HTTP client header handling methods for improved type safety and clarity

Reviewed Changes

Copilot reviewed 14 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/io/src/io-util.ts Custom readlink implementation for Windows compatibility
packages/http-client/src/index.ts Refactored header handling methods with improved type safety
packages/http-client/package.json Updated Node.js engine requirement and @types/node version
packages/core/package.json Updated Node.js engine requirement and @types/node version
packages/cache/package.json Updated Node.js engine requirement and @types/node version
packages/cache/tests/saveCache.test.ts Added missing mock and removed duplicate assertion
packages/artifact/tests/upload-artifact.test.ts Fixed Stats constructor usage for Node.js 24 compatibility
package.json Updated root Node.js engine requirement and @types/node version
.github/workflows/unit-tests.yml Added Node.js 24.x to test matrix
.github/workflows/releases.yml Updated workflow to use Node.js 24.x
.github/workflows/cache-windows-test.yml Updated workflow to use Node.js 24.x
.github/workflows/cache-tests.yml Updated workflow to use Node.js 24.x
.github/workflows/audit.yml Updated workflow to use Node.js 24.x
.github/workflows/artifact-tests.yml Updated workflow to use Node.js 24.x
Files not reviewed (3)
  • packages/cache/package-lock.json: Language not supported
  • packages/core/package-lock.json: Language not supported
  • packages/http-client/package-lock.json: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

return `${result}\\`
}
} catch (err) {
// If we can't access the target, just return the original result
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

Using lstat on the symlink target (result) will follow the symlink and stat the target, but result is already the resolved path. This should use lstat on the original fsPath to check if the symlink itself points to a directory.

Suggested change
// If we can't access the target, just return the original result
const stats = await fs.promises.lstat(fsPath)
if (stats.isDirectory() && !result.endsWith('\\')) {
return `${result}\\`
}
} catch (err) {
// If we can't access the symlink, just return the original result

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this suggestion related to a symlink chain? E.g. symlink -> symlink -> real

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah all the way through the chain to the target

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I might be confused by the Copilot comment. Which one resolves the full chain, lstat or stat? We want to resolve the full chain, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

stat resolves the whole chain

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha. Stat sounds like the right choice then? Although I guess good to test the scenario against node20 since that's the behavior we're trying to preserve, right?

compression
)
expect(saveCacheMock).toHaveBeenCalledTimes(1)
expect(getCompressionMock).toHaveBeenCalledTimes(1)
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

The removed duplicate assertion expect(getCompressionMock).toHaveBeenCalledTimes(1) was correct to remove as it was redundant with line 280.

Copilot uses AI. Check for mistakes.
Comment on lines 6 to 8
"engines": {
"node": ">=24.0.0"
},
Copy link

Choose a reason for hiding this comment

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

This will cause any package that depends on @actions/cache to also require Node 24, removing backward compatibility.

Copy link
Contributor Author

@salmanmkc salmanmkc Sep 4, 2025

Choose a reason for hiding this comment

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

The plan is to have a major version bump here as well as in actions cache anyway, so any version of cache that already references the current or older versions won't be referencing this change, and any newer versions would be on the action that targets node24. What scenario do you envision needing a runner that doesn't have node 24? Self-hosted runners should all be updated and all hosted runners have node 24 already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I can think of a scenario, such that if you were to consume the package not from the cache action. Okay I'll remove it. Thanks for the comment!

@salmanmkc salmanmkc requested a review from a team as a code owner September 4, 2025 13:16
@danwkennedy
Copy link
Contributor

Since we're definitely breaking Node 18 and we don't support that version, can we just remove those tests so the CI stays green?

@danwkennedy
Copy link
Contributor

Might be worth looking up docs/comments that reference older node versions and update them as well. This sentence is pretty egregious and this example likely wouldn't work.

@salmanmkc
Copy link
Contributor Author

Sure will remove those tests

"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"overrides": {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious do you know why this is added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bunch of them were for audit changes, simply just doing npm audit fix didn't work, so needed to override, and then url-js and node-fetch are there to stop the punycode deprecation warnings

Copy link
Contributor

@ejahnGithub ejahnGithub left a comment

Choose a reason for hiding this comment

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

LGTM for attest pkg!

"brace-expansion": "^2.0.2",
"form-data": "^4.0.4",
"uri-js": "npm:uri-js-replace@^1.0.1",
"node-fetch": "^3.3.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

10 participants