Skip to content

Stage native CLI tool packages deterministically#16631

Merged
radical merged 2 commits intomicrosoft:mainfrom
radical:port-native-cli-tool-packages-to-main
May 1, 2026
Merged

Stage native CLI tool packages deterministically#16631
radical merged 2 commits intomicrosoft:mainfrom
radical:port-native-cli-tool-packages-to-main

Conversation

@radical
Copy link
Copy Markdown
Member

@radical radical commented May 1, 2026

Description

Adds deterministic staging for native Aspire CLI tool packages in the Azure DevOps publishing pipeline.

The pipeline now calls a shared PowerShell script that stages exactly one canonical Aspire.Cli pointer package and one RID-specific package per native archive artifact, while failing fast on missing pointer packages, RID/package mismatches, duplicate RID packages, and version mismatches. Both official and unofficial Azure DevOps pipeline definitions use the same script.

Validation:

  • ./restore.sh
  • ./build.sh --build /p:SkipNativeBuild=true
  • dotnet test --project tests/Infrastructure.Tests/Infrastructure.Tests.csproj --no-build --no-launch-profile -- --filter-class "*.StageNativeCliToolPackagesTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

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
  • Does the change require an update in our Aspire docs?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

🚀 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 -- 16631

Or

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

@radical
Copy link
Copy Markdown
Member Author

radical commented May 1, 2026

Validating this PR with the internal AzDO pipeline: https://dev.azure.com/dnceng/internal/_build/results?buildId=2964700

@radical radical marked this pull request as ready for review May 1, 2026 05:02
Copilot AI review requested due to automatic review settings May 1, 2026 05:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 makes native Aspire CLI tool package staging deterministic in the Azure DevOps publishing pipeline by centralizing staging logic in a shared PowerShell script and adding infrastructure tests to validate expected behaviors and failure modes.

Changes:

  • Added eng/scripts/stage-native-cli-tool-packages.ps1 to stage exactly one canonical Aspire.Cli pointer package plus one RID-specific package per native-archive RID, with validation for duplicates/mismatches.
  • Updated both official and unofficial Azure DevOps pipelines to invoke the shared staging script instead of inlining staging logic.
  • Added Infrastructure.Tests coverage for the staging script across success and multiple error scenarios.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/Infrastructure.Tests/PowerShellScripts/StageNativeCliToolPackagesTests.cs Adds test coverage for the staging script’s success path and fail-fast validations.
eng/scripts/stage-native-cli-tool-packages.ps1 Implements deterministic package discovery/validation and staging into the Shipping directory.
eng/pipelines/azure-pipelines.yml Switches official pipeline staging step to call the shared script.
eng/pipelines/azure-pipelines-unofficial.yml Switches unofficial pipeline staging step to call the shared script.

Comment thread eng/scripts/stage-native-cli-tool-packages.ps1
radical and others added 2 commits May 1, 2026 01:23
Extract native CLI package staging into a shared PowerShell script so the official and unofficial Azure DevOps pipelines select the canonical pointer package and matching RID-specific packages consistently.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add infrastructure tests for the native CLI package staging script across canonical pointer selection, RID matching, duplicate detection, version validation, and custom canonical artifact selection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@radical radical force-pushed the port-native-cli-tool-packages-to-main branch from b38b527 to 7795c52 Compare May 1, 2026 05:24
@radical
Copy link
Copy Markdown
Member Author

radical commented May 1, 2026

Updated internal AzDO validation after addressing review feedback: https://dev.azure.com/dnceng/internal/_build/results?buildId=2964869

Comment thread eng/scripts/stage-native-cli-tool-packages.ps1
@radical radical merged commit a6738f6 into microsoft:main May 1, 2026
287 checks passed
@radical radical deleted the port-native-cli-tool-packages-to-main branch May 1, 2026 18:07
@github-actions github-actions Bot added this to the 13.4 milestone May 1, 2026
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.

3 participants