-
Notifications
You must be signed in to change notification settings - Fork 901
Fixing codebase to support upgarde to Node24 #5350
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
base: master
Are you sure you want to change the base?
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| if (PlatformUtil.HostOS == PlatformUtil.OS.Linux) | ||
| { | ||
| if (supportsNode20.HasValue) | ||
| if (!useNode20InUnsupportedSystem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't node24 check be before node20?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here both are if statement and it will check for both node20 as well as node24. So I think there will be no impact due to order of execution.
| } | ||
| else | ||
| { | ||
| node24ResultsInGlibCErrorHost = await CheckIfNode24ResultsInGlibCError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of copying the complete logic, as we are using the same glibc error versions, can we make CheckIfNode24ResultsInGlibCError parameterized and pass node version which should be used instead of copying the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried parameterizing the complete if and else statement, but it was becoming bit complex. But I have parameterized the CheckIfNode<>ResultsInGlibcError function into CheckIfNodeResultsInGlibCError()
| { | ||
| Trace.Info($"Found UseNode24 knob, using node24 for node tasks: {useNode24}"); | ||
|
|
||
| if (node24ResultsInGlibCError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of replicating the code, can we please move this in a method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Parameterized the checks using the function: GetNodeFolderWithFallback()
| { | ||
| if (inContainer) | ||
| { | ||
| ExecutionContext.Warning($"The container operating system doesn't support Node24. Using Node20 instead. " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we have "https://github.com/nodesource/distributions" in this message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we make a single method and have these messages in constants, which are picked based on a parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Created a new function: NodeFallbackWarning()
src/Agent.Worker/TaskManager.cs
Outdated
| public sealed class Node16HandlerData : BaseNodeHandlerData | ||
| { | ||
| public override int Priority => 2; | ||
| public override int Priority => 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should shift this by +100 eg, 101, 102, 103...
with this in future we can add new node versions with single change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. updated the priority orders by +100 but kept the priority this class same as is:
public sealed class AgentPluginHandlerData : HandlerData
{
public override int Priority => 0;
}
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| nameof(UseNode24), | ||
| "Forces the agent to use Node 24 handler for all Node-based tasks", | ||
| new RuntimeKnobSource("AGENT_USE_NODE24"), | ||
| new EnvironmentKnobSource("AGENT_USE_NODE24"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should have pipeline feature source as well
4516bb0 to
b7f511c
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
51e7b55 to
b43c584
Compare
b43c584 to
9aa7b9e
Compare
Context
This PR implements Node 24 support for Azure Pipelines Agent to enable pipeline tasks to use the latest Node.js runtime (v24.10.0). This upgrade is part of the ongoing effort to keep the agent's Node.js runtime current with LTS releases and provide enhanced performance and security features to pipeline users.
The implementation adds Node 24 as the highest priority handler while maintaining backward compatibility with existing Node versions.
Description
Risk Assessment (Low / Medium / High)
Risk Level: Low
Unit Tests Added or Updated (Yes / No)
NodeHandlerL0.cs
Added "node24" to UseNewNodeForNewNodeHandler() parameterised test
Updated ResetNodeKnobs() method to include Node 24 environment variables
L1TestBase.cs
Additional Testing Performed
Integration Testing:
Pipeline Execution Validation
Change Behind Feature Flag (Yes / No)
Yes - The implementation is fully gated behind the AGENT_USE_NODE24 environment variable:
Tech Design / Approach
Design Reviewed: Implementation follows established Node handler pattern from Node 20/16 integration
Architecture Decisions:
Documentation Changes Required (Yes/No)
Documentation updates needed:
Logging Added/Updated (Yes/No)
All logging follows existing patterns and doesn't expose sensitive data
Telemetry Added/Updated (Yes/No)
Rollback Scenario and Process (Yes/No)
Dependency Impact Assessed and Regression Tested (Yes/No)