Skip to content

Fail Azure DevOps plugin builds on npm errors - #7778

Merged
jozkee merged 4 commits into
mainfrom
copilot/fix-npm-failure-handling
Sep 28, 2026
Merged

jozkee merged 4 commits into
mainfrom
copilot/fix-npm-failure-handling

Conversation

Copilot AI commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

The Azure DevOps extension build could ignore failed npm/npx commands and package stale dependencies, producing nondeterministic false-green builds.

  • Fail-fast command execution

    • Route every npm and npx invocation through an exit-code-checking helper.
    • Stop packaging immediately when a native command fails.
  • Deterministic workspace

    • Remove task and extension node_modules and dist directories before installation.
    • Treat cleanup failures as fatal instead of reusing stale content.

Evidence

  • Build 1605832 completed successfully even though its Windows Build Azure DevOps plugin step logged npm error code E401, demonstrating the false-green behavior this PR fixes.

Validation

  • Ran the plugin build against the current npm ci --omit=dev E401 failure.
  • Verified that the script exits nonzero immediately and reports the failed native command.
  • Verified that no VSIX is produced after the failed dependency installation.
Invoke-NativeCommand "npm" @("ci")
Invoke-NativeCommand "npx" @("vite", "build")

Copilot AI and others added 2 commits September 23, 2026 15:58
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Azure DevOps plugin build to stop on npm failures Fail Azure DevOps plugin builds on npm errors Sep 23, 2026
Copilot AI requested a review from jozkee September 23, 2026 16:07
@jozkee

jozkee commented Sep 23, 2026

Copy link
Copy Markdown
Member

@copilot can you resolve the CI errors

Copilot AI commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@copilot can you resolve the CI errors

The Windows failure is the expected now-unmasked adm-zip@0.6.1 E401 from dotnet-public-npm; Ubuntu does not run this packaging step, and the new failure-path test passes locally. This requires correcting that packageโ€™s public-feed visibility and rerunning CI. I did not downgrade to 0.6.0 because it has a known DoS vulnerability, or bypass the repositoryโ€™s configured feed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

๐ŸŸก Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Updates the Azure DevOps extension build to fail on native command errors and avoid stale build artifacts.

Changes:

  • Added exit-code validation for all npm/npx commands.
  • Added cleanup of generated directories before building.
  • Added regression coverage and pipeline execution before packaging.
File Description
src/โ€‹Libraries/โ€‹Microsoft.Extensions.AI.Evaluation.Reporting/โ€‹TypeScript/โ€‹azure-devops-report/โ€‹build.Tests.ps1 Updated as part of this pull request.
src/โ€‹Libraries/โ€‹Microsoft.Extensions.AI.Evaluation.Reporting/โ€‹TypeScript/โ€‹azure-devops-report/โ€‹build.ps1 Updated as part of this pull request.
eng/โ€‹pipelines/โ€‹templates/โ€‹BuildAndTest.yml Updated as part of this pull request.

๐Ÿ’ก Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

๐ŸŸข Approval recommended

The implementation satisfies the stated failure-handling, cleanup, packaging, and regression-coverage requirements.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

Keep the fix focused on propagating native command failures without introducing a standalone PowerShell test into every Windows CI run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jozkee
jozkee requested review from wtgodbe and a balanced review from Copilot September 23, 2026 19:49
@jozkee
jozkee marked this pull request as ready for review September 23, 2026 19:50
@jozkee
jozkee requested a review from a team as a code owner September 23, 2026 19:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

๐ŸŸก Changes recommended

The regression test and pipeline integration promised by the PR are missing.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

@github-actions github-actions Bot added the area-ai-eval Microsoft.Extensions.AI.Evaluation and related label Sep 24, 2026
@jozkee jozkee closed this Sep 28, 2026
@jozkee jozkee reopened this Sep 28, 2026
@dotnet-comment-bot

Copy link
Copy Markdown
Collaborator

โ€ผ๏ธ Found issues โ€ผ๏ธ

Project Coverage Type Expected Actual
Microsoft.Extensions.Diagnostics.Testing Line 99 98.65 ๐Ÿ”ป
Microsoft.Extensions.Telemetry Line 93 92.64 ๐Ÿ”ป
Microsoft.Extensions.AI.OpenAI Line 75 68.32 ๐Ÿ”ป
Microsoft.Extensions.AI.OpenAI Branch 75 57.59 ๐Ÿ”ป
Microsoft.Extensions.DataIngestion.MarkItDown Line 75 4.46 ๐Ÿ”ป
Microsoft.Extensions.DataIngestion.MarkItDown Branch 75 0 ๐Ÿ”ป
Microsoft.Extensions.Diagnostics.ResourceMonitoring Line 99 96.03 ๐Ÿ”ป
Microsoft.Extensions.Diagnostics.ResourceMonitoring Branch 99 92.76 ๐Ÿ”ป
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes Line 99 97.73 ๐Ÿ”ป
Microsoft.Extensions.ServiceDiscovery.Dns Line 75 68.32 ๐Ÿ”ป
Microsoft.Extensions.ServiceDiscovery Line 75 67.96 ๐Ÿ”ป
Microsoft.Extensions.ServiceDiscovery Branch 75 71.43 ๐Ÿ”ป
Microsoft.Extensions.ServiceDiscovery.Abstractions Line 75 42.11 ๐Ÿ”ป
Microsoft.Extensions.ServiceDiscovery.Abstractions Branch 75 42.86 ๐Ÿ”ป
Microsoft.Extensions.ServiceDiscovery.Yarp Line 75 73.85 ๐Ÿ”ป
Microsoft.Extensions.ServiceDiscovery.Yarp Branch 75 70 ๐Ÿ”ป
Microsoft.Extensions.VectorData.Abstractions Line 75 37.39 ๐Ÿ”ป
Microsoft.Extensions.VectorData.Abstractions Branch 75 22.73 ๐Ÿ”ป

๐ŸŽ‰ Good job! The coverage increased ๐ŸŽ‰
Update MinCodeCoverage in the project files.

Project Expected Actual
Microsoft.Extensions.Http.Diagnostics 94 95
Microsoft.Gen.BuildMetadata 97 100
Microsoft.Gen.MetadataExtractor 57 73
Microsoft.Gen.MetricsReports 67 69
Microsoft.Extensions.AI.Abstractions 82 86
Microsoft.Extensions.AI.Evaluation.NLP 0 78
Microsoft.Extensions.Caching.Hybrid 82 83
Microsoft.Extensions.DataIngestion 75 89
Microsoft.Extensions.DataIngestion.Markdig 75 90
Microsoft.Extensions.Http.Resilience 97 100

Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1614742&view=codecoverage-tab

@jozkee
jozkee merged commit f6d4fe3 into main Sep 28, 2026
6 checks passed
@jozkee
jozkee deleted the copilot/fix-npm-failure-handling branch September 28, 2026 15:40
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ai-eval Microsoft.Extensions.AI.Evaluation and related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure DevOps plugin build can ignore npm failures and package stale dependencies

5 participants