Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ public class AgentKnobs
new RuntimeKnobSource("AGENT_USE_NODE24_IN_UNSUPPORTED_SYSTEM"),
new EnvironmentKnobSource("AGENT_USE_NODE24_IN_UNSUPPORTED_SYSTEM"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseNode24withHandlerData = new Knob(
nameof(UseNode24withHandlerData),
"Forces the agent to use Node 24 handler if the task has handler data for it",
new PipelineFeatureSource("UseNode24withHandlerData"),
new RuntimeKnobSource("AGENT_USE_NODE24_WITH_HANDLER_DATA"),
new EnvironmentKnobSource("AGENT_USE_NODE24_WITH_HANDLER_DATA"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob FetchByCommitForFullClone = new Knob(
nameof(FetchByCommitForFullClone),
Expand Down
11 changes: 8 additions & 3 deletions src/Agent.Worker/Handlers/NodeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,15 @@ public string GetNodeLocation(bool node20ResultsInGlibCError, bool node24Results
bool useNode20_1 = AgentKnobs.UseNode20_1.GetValue(ExecutionContext).AsBoolean();
bool UseNode20InUnsupportedSystem = AgentKnobs.UseNode20InUnsupportedSystem.GetValue(ExecutionContext).AsBoolean();
bool useNode24 = AgentKnobs.UseNode24.GetValue(ExecutionContext).AsBoolean();
bool UseNode24withHandlerData = AgentKnobs.UseNode24withHandlerData.GetValue(ExecutionContext).AsBoolean();
bool taskHasNode10Data = Data is Node10HandlerData;
bool taskHasNode16Data = Data is Node16HandlerData;
bool taskHasNode20_1Data = Data is Node20_1HandlerData;
bool taskHasNode24Data = Data is Node24HandlerData;
string useNodeKnob = AgentKnobs.UseNode.GetValue(ExecutionContext).AsString();

string nodeFolder = NodeHandler.NodeFolder;
if (taskHasNode24Data && useNode24)
if (taskHasNode24Data && UseNode24withHandlerData)
{
Trace.Info($"Task.json has node24 handler data: {taskHasNode24Data}");
nodeFolder = GetNodeFolderWithFallback(NodeHandler.Node24Folder, node20ResultsInGlibCError, node24ResultsInGlibCError, inContainer);
Expand All @@ -401,12 +402,16 @@ public string GetNodeLocation(bool node20ResultsInGlibCError, bool node24Results
nodeFolder = NodeHandler.node10Folder;
}

if (useNode20_1)
if (useNode24)
{
Trace.Info($"Found UseNode24 knob, using node24 for node tasks: {useNode24}");
nodeFolder = GetNodeFolderWithFallback(NodeHandler.Node24Folder, node20ResultsInGlibCError, node24ResultsInGlibCError, inContainer);
}
else if (useNode20_1)
{
Trace.Info($"Found UseNode20_1 knob, using node20_1 for node tasks {useNode20_1} node20ResultsInGlibCError = {node20ResultsInGlibCError}");
nodeFolder = GetNodeFolderWithFallback(NodeHandler.Node20_1Folder, node20ResultsInGlibCError, node24ResultsInGlibCError, inContainer);
}

else if (useNode10)
{
Trace.Info($"Found UseNode10 knob, use node10 for node tasks: {useNode10}");
Expand Down
1 change: 1 addition & 0 deletions src/Test/L0/NodeHandlerL0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ private void ResetNodeKnobs()
Environment.SetEnvironmentVariable("AGENT_USE_NODE20_IN_UNSUPPORTED_SYSTEM", null);
Environment.SetEnvironmentVariable("AGENT_USE_NODE24", null);
Environment.SetEnvironmentVariable("AGENT_USE_NODE24_IN_UNSUPPORTED_SYSTEM", null);
Environment.SetEnvironmentVariable("AGENT_USE_NODE24_WITH_HANDLER_DATA", null);
}
}
}
Loading