Skip to content

Port npm release pipeline fixes to main - #18164

Merged
Ankit Jain (radical) merged 3 commits into
microsoft:mainfrom
adamint:port-13.4-npm-pipeline-main
Jun 12, 2026
Merged

Port npm release pipeline fixes to main#18164
Ankit Jain (radical) merged 3 commits into
microsoft:mainfrom
adamint:port-13.4-npm-pipeline-main

Conversation

@adamint

Copy link
Copy Markdown
Member

Description

Ports the release/13.4 npm package publishing pipeline fixes from #18093 to main so the mainline release pipeline has the same npm validation and CLI package metadata behavior before the next release.

This updates the npm release pipeline to download validation summaries as build artifacts, validates npm ESRP owner/approver aliases through a shared script, and simplifies the npm publish skip parameters. It also moves CLI npm README content into templates and tests the pack script output directly.

Security considerations

The release pipeline now treats queue-time npm owners/approvers as environment data and validates aliases before emitting Azure Pipelines logging commands. The validation rejects non-Microsoft addresses, owner/approver overlap, missing required owners, and unsafe alias characters; I have not done a separate security review.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Backports the release/13.4 npm publish validation and CLI package metadata changes from microsoft#18093 onto main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 16:42
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18164

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18164"

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.

Pull request overview

This PR ports the npm release pipeline fixes from release/13.4 (#18093) to main, ensuring the mainline release pipeline has the same npm validation behavior and CLI package metadata improvements before the next release. The changes consolidate npm ESRP alias validation into a testable shared script, simplify the npm skip parameters by removing the coarser SkipNpmPublish and the override AllowNpmLatestDistTagMove, move README content into templates, and improve E2E test resilience to CLI self-update prompts.

Changes:

  • Replaced SkipNpmPublish and AllowNpmLatestDistTagMove parameters with the granular SkipNpmRidPublish and SkipNpmPointerPublish flags, forwarding queue-time owner/approver values as environment variables for security.
  • Extracted npm ESRP alias validation logic into eng/scripts/validate-npm-release-aliases.ps1 (mirrored inline in the pipeline YAML, with a sync test), and moved CLI npm README content from inline here-strings into template files.
  • Added new tests exercising the pack script output directly, validating alias rejection scenarios, and handling the CLI self-update prompt in channel-update E2E tests.
Show a summary per file
File Description
eng/scripts/validate-npm-release-aliases.ps1 New shared script for npm ESRP owner/approver validation with dot-source guard
eng/scripts/pack-cli-npm-package.ps1 Adds Read-TemplateFile / Expand-Template helpers, uses external README templates
eng/scripts/pack-cli-npm-package.rid.README.md New RID-package README template with __PLACEHOLDER__ tokens
eng/scripts/pack-cli-npm-package.pointer.README.md New pointer-package README template with install/update guidance
eng/pipelines/release-publish-nuget.yml Removes SkipNpmPublish/AllowNpmLatestDistTagMove, uses DownloadBuildArtifacts@0, moves required owners to pipeline-level variable, env-block isolation for parameters
eng/pipelines/common-variables.yml Removes NPM_PUBLISH_REQUIRED_OWNERS and NPM_PUBLISH_REQUIRED_APPROVERS (moved to release pipeline)
docs/specs/npm-cli-package.md Updates spec to reflect new parameter names, validation approach, and env-var forwarding
tests/Infrastructure.Tests/PowerShellScripts/ValidateNpmReleaseAliasesTests.cs New unit tests executing the validation script against sample inputs
tests/Infrastructure.Tests/Pipelines/ReleasePublishNugetPipelineTests.cs Updated assertions for new parameter names, validation helpers, artifact downloads
tests/Infrastructure.Tests/Pipelines/NpmCliPackageTests.cs New tests executing the pack script and verifying package.json/README output
tests/Shared/CliInstallStrategy.cs New GetDotnetAddPackageCommand helper using local hive version with prerelease fallback
tests/Aspire.Cli.EndToEnd.Tests/Helpers/KubernetesDeployTestHelpers.cs Uses new GetDotnetAddPackageCommand for API client packages
tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliInstallStrategyTests.cs Unit test for the new dotnet add package command helper
tests/Aspire.Cli.EndToEnd.Tests/ChannelUpdateWorkflowTests.cs Handles CLI self-update prompt during stable-channel update preview
.gitignore Adds extension/.test-workspace/ to ignored paths

Copilot's findings

  • Files reviewed: 14/15 changed files
  • Comments generated: 1

Comment thread tests/Infrastructure.Tests/PowerShellScripts/ValidateNpmReleaseAliasesTests.cs Outdated
@radical

Copy link
Copy Markdown
Member

Adam Ratzman (@adamint) could you please list the differences from the PR to 13.4?

Adam Ratzman (adamint) and others added 2 commits June 12, 2026 12:53
Update the main release-process docs for the new npm skip parameters and fix the TypeScript npm README sample path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the shared Infrastructure.Tests repo-root helper in the npm alias validation tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 17:00
@adamint

Copy link
Copy Markdown
Member Author

yep, differences from the 13.4 PR are:

  • docs/release-process.md only exists on main, and it still referenced the removed SkipNpmPublish / AllowNpmLatestDistTagMove knobs, so I updated those instructions to the RID/pointer split.
  • The npm pointer README TypeScript sample now uses the current generated TS AppHost shape (apphost.mts + ./.aspire/modules/aspire.mjs). The 13.4 PR had the older/mixed apphost.ts / aspire.js sample.
  • ValidateNpmReleaseAliasesTests uses the existing main RepoRoot.Path helper instead of carrying the copied FindRepoRoot() from the 13.4 patch.
  • Conflict-resolution only: main had VS Code extension publishing in release-publish-nuget.yml, extra common variables, and most of the new .gitignore entries already, so those were preserved rather than overwritten.

Everything else should be the same npm release behavior from #18093, adapted onto main.

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's findings

  • Files reviewed: 15/16 changed files
  • Comments generated: 0 new

@radical Ankit Jain (radical) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Forward port of approved #18093 to main. Reviewed only the delta from the approved PR (assuming #18093's changes were already approved).

Delta verified:

  • npm pointer README TS sample updated to the current generated shape (apphost.mts + ./.aspire/modules/aspire.mjs), confirmed against TypeScriptLanguageSupport.cs and the ts-starter/py-starter templates. NpmCliPackageTests assertions match and are falsifiable. This is more correct than the 13.4 sample.
  • ValidateNpmReleaseAliasesTests uses the standard RepoRoot.Path helper instead of the copied FindRepoRoot().
  • ReleasePublishNugetPipelineTests uses main's existing FindYamlVariableValue/FindYamlParameterDefault helpers; same values asserted (joperezr,ankj, adamratzman).
  • release-publish-nuget.yml conflict-merge preserves all npm RID/pointer/validation-summary/signature logic; main-only additions are VS Code extension publishing. Final npm param block matches 13.4.

No npm behavior change vs the approved PR; no logic lost in the merge.

@radical
Ankit Jain (radical) enabled auto-merge (squash) June 12, 2026 20:15
@radical
Ankit Jain (radical) merged commit 67c3771 into microsoft:main Jun 12, 2026
666 of 669 checks passed
@github-actions github-actions Bot added this to the 13.5 milestone Jun 12, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants