Skip to content

Conversation

@rajmishra1997
Copy link

@rajmishra1997 rajmishra1997 commented Dec 23, 2025

Issue:
Canary Test pipeline failed after Node 24 migartion for Task ExtractFile: https://dev.azure.com/canarytest/PipelineTasks/_build/results?buildId=235044&view=results

AB#2343422
AB#2343402

Why this issue:

  • As part of node 24 migration, task-lib version is changed from 4.16.0 to 5.2.2
  • Issue arose from line 1123
  • task.ts ls functionality changed in PR: Remove the shelljs dependency #1079, Earlier version used shell.js
  • Line 1123, pathsCopy.find, which is Array.Prototype.Find should return undefined in case of no match but returned -1
  • This issue was caused by a custom polyfill implementation overriding the native behavior, as shown in the image below.
arrayfindIssue

Solution:

  1. Added method "safeFind" in place of Array.Prototype.Find
  2. Tested in DevFabric

Failure Scenario:
extractFileIssue

Successful Scenario
ExtractFileFixed

@rajmishra1997 rajmishra1997 requested review from a team as code owners December 23, 2025 10:32
@rajmishra1997
Copy link
Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

node/task.ts Outdated
paths.push(path.resolve('.'));
}
const pathsCopy = [...paths];
const pathsCopy = [...paths] as string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we fix this in the function signature of ls where path is defined as unknow?

Copy link
Author

@rajmishra1997 rajmishra1997 Dec 24, 2025

Choose a reason for hiding this comment

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

paths is kept as unknown type to supported different method overloading, removed pathsCopy type cast

@rajmishra1997
Copy link
Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@raujaiswal
Copy link
Contributor

@rajmishra1997 , could you please check if we miss to upgrade the version of task-lib in package.json with this changes. from 5.2.2 to 5.2.3 ?

@raujaiswal raujaiswal self-requested a review December 29, 2025 04:35
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.

5 participants