Add unified Node.js version selection strategy framework with EOL policy support #5422
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This PR introduces the unified Node.js version selection strategy framework as part of modernizing Azure Pipelines Agent's Node.js handling. This is the first implementation step following comprehensive test specifications established in previous work. The strategy pattern provides a foundation for implementing EOL (End-of-Life) Node.js version policies andnode handler selection across both host and container environments.
Related Work: This builds on test specifications for Node Handler behavior and enables future EOL policy enforcement and unified node selection logic.
Workitem: AB#2339020
Description
Implemented comprehensive strategy pattern for Node.js version selection with the following components:
Core Strategy Framework:
IUnifiedNodeVersionStrategy.cs- Strategy interface definingCanHandle()andGetNodePath()contractsUnifiedNodeContext.cs- Unified context model containing environment state, glibc compatibility flags, and handler dataNodePathResult.cs- Result model with node path, version, selection reason, and optional warningsStrategy Implementations:
Key Features:
AGENT_ENABLE_EOL_NODE_VERSION_POLICYRisk Assessment (Low / Medium / High)
Low Risk - This PR introduces only new strategy implementation code without modifying existing NodeHandler logic. The strategies remain dormant until integrated via the feature flag in subsequent PRs. All existing NodeHandler behavior continues unchanged.
Unit Tests Added or Updated (Yes / No)
Additional Testing Performed
List manual or automated tests performed beyond unit tests (e.g., integration, scenario, regression).
Change Behind Feature Flag (Yes / No)
Yes - The unified strategy framework will be activated via a feature flag in the integration PR (to be shared). This allows for safe rollback and testing between legacy and unified approaches.
Tech Design / Approach
Documentation Changes Required (Yes/No)
Logging Added/Updated (Yes/No)
Telemetry Added/Updated (Yes/No)
Rollback Scenario and Process (Yes/No)
Dependency Impact Assessed and Regression Tested (Yes/No)