Skip to content
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
df2b8fc
Initial commit | node handler strategies | orchestrator to get select…
rishabhmalikMS Dec 3, 2025
42d4769
Adding collection definition for unning all node handling tests in se…
rishabhmalikMS Dec 3, 2025
a8c7794
Adding selectedNode field in UnifiedNodeContext | Removing duplicate …
rishabhmalikMS Dec 3, 2025
32becf6
Adding equivalence and diverging test for legacy and new approach | S…
rishabhmalikMS Dec 3, 2025
2e9ef63
Node Handler integrtion fix for custom node (moved legacy custom node…
rishabhmalikMS Dec 4, 2025
6b5cc04
Merged custom node scnario tests with all other test specs
rishabhmalikMS Dec 4, 2025
244ebe6
Code cleaning
rishabhmalikMS Dec 4, 2025
ce9dd01
Test scenarios updates
rishabhmalikMS Dec 5, 2025
b2450ba
Minor fixes
rishabhmalikMS Dec 5, 2025
b1a6dd7
Adding CustomNodeHandlerData handler
rishabhmalikMS Dec 8, 2025
af9b999
minor fixes
rishabhmalikMS Dec 8, 2025
a95c2ab
L0 unit tests for node handler with all scenarios for node handlers
rishabhmalikMS Dec 8, 2025
84e3eb1
minor fix
rishabhmalikMS Dec 8, 2025
0948f72
Code cleaning
rishabhmalikMS Dec 8, 2025
ac6b0cf
Merge branch 'master' into users/rishabhmalikMS/EOLnodeL0Tests
rishabhmalikMS Dec 8, 2025
b42cd15
Updating knob name to be consistent with server side updates.
rishabhmalikMS Dec 9, 2025
d3f8dfa
Merge branch 'users/rishabhmalikMS/EOLnodeL0Tests' of https://github.…
rishabhmalikMS Dec 9, 2025
06340eb
refactor: Replace 'unified' terminology with 'strategy' in Node.js ha…
rishabhmalikMS Dec 11, 2025
5a08d24
Removed strategyExpectSuccess, legacyExpectSuccess and ExpectSuccess …
rishabhmalikMS Dec 12, 2025
2c73a58
Merge branch 'master' into users/rishabhmalikMS/EOLnodeL0Tests
rishabhmalikMS Dec 12, 2025
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
14 changes: 14 additions & 0 deletions src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,13 @@ public class AgentKnobs
new EnvironmentKnobSource("AGENT_DISABLE_NODE6_TASKS"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob EnableEOLNodeVersionPolicy = new Knob(
nameof(EnableEOLNodeVersionPolicy),
"When enabled, automatically upgrades tasks using end-of-life Node.js versions (6, 10, 16) to supported versions (Node 20.1 or Node 24). Throws error if no supported versions are available on the agent.",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is slightly confusing, we are not upgrading tasks, rather when flag is enabled we disregard the EOL Node versions a task have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is updated to be more descriptive

new PipelineFeatureSource("AGENT_RESTRICT_EOL_NODE_VERSIONS"),
new EnvironmentKnobSource("AGENT_RESTRICT_EOL_NODE_VERSIONS"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob DisableTeePluginRemoval = new Knob(
nameof(DisableTeePluginRemoval),
"Disables removing TEE plugin after using it during checkout.",
Expand Down Expand Up @@ -929,5 +936,12 @@ public class AgentKnobs
new PipelineFeatureSource("EnableDockerExecDiagnostics"),
new EnvironmentKnobSource("AGENT_ENABLE_DOCKER_EXEC_DIAGNOSTICS"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob UseNodeVersionStrategy = new Knob(
nameof(UseNodeVersionStrategy),
"If true, use the strategy pattern for Node.js version selection (both host and container). This provides centralized node selection logic with EOL policy enforcement. Set to false to use legacy node selection logic.",
new PipelineFeatureSource("UseNodeVersionStrategy"),
new EnvironmentKnobSource("AGENT_USE_NODE_STRATEGY"),
new BuiltInDefaultKnobSource("false"));
}
}
17 changes: 17 additions & 0 deletions src/Test/L0/NodeHandlerCollections.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Xunit;

namespace Microsoft.VisualStudio.Services.Agent.Tests
{
/// <summary>
/// Single collection for ALL NodeHandler tests (legacy and unified).
/// This ensures sequential execution to prevent environment variable conflicts.
/// </summary>
[CollectionDefinition("Unified NodeHandler Tests")]
public class UnifiedNodeHandlerTestFixture : ICollectionFixture<UnifiedNodeHandlerTestFixture>
{
// This class is never instantiated, it's just a collection marker
}
}
32 changes: 32 additions & 0 deletions src/Test/L0/NodeHandlerL0.AllSpecs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Linq;
using Xunit;

namespace Microsoft.VisualStudio.Services.Agent.Tests
{
/// <summary>
/// Unified test runner for ALL NodeHandler test specifications.
/// Executes every scenario defined in NodeHandlerTestSpecs.AllScenarios.
/// </summary>
[Trait("Level", "L0")]
[Trait("Category", "NodeHandler")]
[Collection("Unified NodeHandler Tests")]
public sealed class NodeHandlerL0AllSpecs : NodeHandlerTestBase
{
[Theory]
[MemberData(nameof(GetAllNodeHandlerScenarios))]
public void NodeHandler_AllScenarios(TestScenario scenario)
{
RunScenarioAndAssert(scenario);
}

public static object[][] GetAllNodeHandlerScenarios()
{
return NodeHandlerTestSpecs.AllScenarios
.Select(scenario => new object[] { scenario })
.ToArray();
}
}
}
Loading
Loading