Repository navigation
Fix internal build break: 'aspire-managed --help' in CLI archive verifier returns exit 1 - #17341
Merged
David Fowler (davidfowl) merged 1 commit intoMay 21, 2026
Conversation
… exit 0 The signed build+sign pipeline (microsoft-aspire, definition 1602) started failing on main in all three RIDs (osx-arm64, linux-x64, win-x64) right after microsoft#17274 merged. The new "Verify CLI archive" step fails with: Verification failed: aspire-managed failed with exit code 1. Output: Usage: aspire-managed <dashboard|server|nuget> [args...] verify-cli-archive.ps1 smoke-tested the bundled server with `aspire-managed --help` and asserted exit 0, but Aspire.Managed's entry point is a hard `args switch` on dashboard|server|nuget; anything else -- including --help -- falls through to ShowUsage(), which writes the usage banner to stderr and returns 1 (src/Aspire.Managed/Program.cs:22-28,58-62). So the assertion was guaranteed to fail against the real binary. Not caught pre-merge because the AzDO build+sign pipeline doesn't run on GitHub PRs (it's the post-merge signed pipeline), and the acquisition test added alongside the verifier uses a synthetic fake archive whose aspire-managed doesn't share the real binary's exit behavior. Invoke `aspire-managed nuget --help` instead. The nuget subcommand dispatches through System.CommandLine's RootCommand, which adds --help automatically and returns 0 -- so it both smoke-tests the NativeAOT- compiled CommandLine path and satisfies the verifier's exit-code assertion. The Aspire.Managed binary itself is unchanged. Co-authored-by: Copilot <[email protected]>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17341Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17341" |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a post-merge internal signed pipeline build break by updating the CLI archive verifier’s smoke test to invoke aspire-managed in a way that correctly returns exit code 0 for --help, matching the real binary’s command dispatch behavior.
Changes:
- Update
verify-cli-archive.ps1to runaspire-managed nuget --help(instead ofaspire-managed --help) so the smoke test uses a valid top-level subcommand and gets a successful help exit code. - Add explanatory comments documenting why top-level
--helpfails and whynuget --helpis the appropriate verification target.
David Fowler (davidfowl)
approved these changes
May 21, 2026
Ankit Jain (radical)
deleted the
radical/fix-verify-cli-archive-aspire-managed-help
branch
May 21, 2026 04:32
This was referenced May 21, 2026
Ankit Jain (radical)
added a commit
to radical/aspire
that referenced
this pull request
May 21, 2026
verify-cli-archive.ps1 only runs in the post-merge AzDO build+sign pipeline (never on GitHub PRs), so regressions in its contract surface days late. The recent microsoft#17274 -> microsoft#17341 -> microsoft#17345 chain is the case in point: the verifier was broken on main for hours before anyone noticed. Add a synthetic-archive E2E test that exercises the verifier's current contract in GitHub CI against a fake `aspire` binary, with no real CLI, no bundle, and no network access: - VerifyCliArchive_AcceptsCleanPerRidArchive: per-RID archive with the fake `aspire` mock handles `aspire --version` and `aspire new aspire-starter`; asserts the verifier exits 0 and emits the expected per-step success lines. - VerifyCliArchive_RejectsArchiveWithStraySidecar: per-RID archive containing a stray `.aspire-install.json`; asserts the verifier exits non-zero with the user-facing error text from Test-ArchiveSidecar. This is the contract from microsoft#16817 that the verifier was originally written to enforce. Adds FakeArchiveHelper.CreateFakeVerifyArchiveAsync to produce these archives. Pre-existing CreateFakeArchiveAsync stays as-is so the install-script tests are unaffected. Unix-only because the fake aspire mock is a bash script. Co-authored-by: Copilot <[email protected]>
Ankit Jain (radical)
added a commit
that referenced
this pull request
May 21, 2026
…erifier checks, add GitHub-CI coverage, fix latent sidecar-scope bug (#17346) * Remove failing TypeScript starter and bundle-layout checks from CLI archive verifier The signed build+sign pipeline (microsoft-aspire, definition 1602) is broken on main since #17274 merged. Two checks added by that PR fail in the 1ES signed-build agent -- the only environment that actually runs verify-cli-archive.ps1 against the real signed archive: 1. Test-TypeScriptStarterProject runs `aspire new aspire-ts-starter`, whose packager-managed AppHost bootstrap performs a NuGet restore that resolves transitive deps (Microsoft.Extensions.*, Grpc.*, OpenTelemetry.*, etc.) to https://api.nuget.org/v3/index.json. The signed-build agent has no public-internet egress and the restore fails with `Permission denied (api.nuget.org:443)`. 2. Test-ExtractedBundleLayout's file assertions only succeed when the prior TypeScript starter step has triggered the AppHost server bootstrap and extracted ~/.aspire/bundle. The C# starter doesn't exercise that path. With the TS starter removed there's no trigger for the bundle layout to be populated, and its embedded `aspire-managed --help` smoke call returns exit 1 by design (the binary's top-level dispatch is dashboard|server|nuget; anything else falls through to ShowUsage()). This is the same class of regression as the earlier `aspire-managed --help` failure in the same script: the verifier doesn't run on GitHub PRs and only fires in the post-merge build+sign pipeline, so the incompatibility wasn't caught pre-merge. Surgical removal of the failing pieces: - Drop Test-TypeScriptStarterProject (function + call site). - Drop Test-ExtractedBundleLayout (function + call site). - Drop tests/Aspire.Acquisition.Tests/Scripts/VerifyCliArchivePowerShellTests.cs, which only covered the removed functions. - Drop CreateFakeBundleArchiveAsync and CreateFakeCliScript additions from FakeArchiveHelper.cs, which had no other consumers. - Drop the unused ScriptPaths.VerifyCliArchivePowerShell entry. Keep all the orthogonal infrastructure #17274 added so it can be reused when the TS check returns: - Helpers Get-ExecutableFileName, Get-ArchiveRoot, Get-ArchiveRidFamily. - Refactored Test-CSharpStarterProject function (functionally equivalent to the pre-#17274 inline C# starter check). - Test-ArchiveSidecar's use of Get-ArchiveRidFamily. - aspireBin discovery via Get-ArchiveRoot. The script header's step list is updated to match what now runs. Re-adding the TS coverage will require either an internal NuGet mirror config the agent can reach (e.g. dropping a NuGet.config that maps * -> dotnet-public into the temp project root before `aspire new`), or a way to skip the auto-restore on `aspire new aspire-ts-starter`. Tracked in #17345. Co-authored-by: Copilot <[email protected]> * Add slim GitHub-CI coverage for verify-cli-archive.ps1 verify-cli-archive.ps1 only runs in the post-merge AzDO build+sign pipeline (never on GitHub PRs), so regressions in its contract surface days late. The recent #17274 -> #17341 -> #17345 chain is the case in point: the verifier was broken on main for hours before anyone noticed. Add a synthetic-archive E2E test that exercises the verifier's current contract in GitHub CI against a fake `aspire` binary, with no real CLI, no bundle, and no network access: - VerifyCliArchive_AcceptsCleanPerRidArchive: per-RID archive with the fake `aspire` mock handles `aspire --version` and `aspire new aspire-starter`; asserts the verifier exits 0 and emits the expected per-step success lines. - VerifyCliArchive_RejectsArchiveWithStraySidecar: per-RID archive containing a stray `.aspire-install.json`; asserts the verifier exits non-zero with the user-facing error text from Test-ArchiveSidecar. This is the contract from #16817 that the verifier was originally written to enforce. Adds FakeArchiveHelper.CreateFakeVerifyArchiveAsync to produce these archives. Pre-existing CreateFakeArchiveAsync stays as-is so the install-script tests are unaffected. Unix-only because the fake aspire mock is a bash script. Co-authored-by: Copilot <[email protected]> * Fix Test-ArchiveSidecar scope and pin the regression with a test Test-ArchiveSidecar was called with $archiveRoot (the directory Get-ArchiveRoot picks out as the binary's home), not $extractDir (the true extraction directory). When a per-RID archive nests its binary under a single sub-directory (e.g. {.aspire-install.json, payload/aspire}), Get-ArchiveRoot returns the sub-directory, and the sidecar scan only recurses into that sub-directory -- missing a stray .aspire-install.json at the actual archive root. The sidecar contract from #16817 ("per-RID archives are shared across install routes; each route authors its own sidecar after extraction") is about the archive, not whichever directory happens to hold the binary. Scan the full extraction directory instead. Latent bug only -- today's signed archives put `aspire` at the extraction root, so Get-ArchiveRoot returns $extractDir unchanged and the scope-narrowing didn't matter in practice. A producer-side refactor that introduced a top-level directory would have silently hidden a contract violation. Add VerifyCliArchive_RejectsStraySidecarWhenBinaryIsNestedUnderSubdirectory to pin the fix: it builds an archive with the binary nested under `payload/` and a stray sidecar at the archive root, and asserts the verifier rejects it. Without the script fix the verifier accepts the archive; with it the test passes. CreateFakeVerifyArchiveAsync gains a nestAspireUnderSubdir parameter so the same helper covers both the binary-at-root and binary-in-subdir shapes Get-ArchiveRoot has to handle. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The signed build+sign pipeline (
microsoft-aspire, definition 1602) started failing onmainin all three RIDs (osx-arm64, linux-x64, win-x64) right after #17274 merged. The new🟣Verify CLI archivestep fails with:See https://dev.azure.com/dnceng/internal/_build/results?buildId=2980569.
Root cause
eng/scripts/verify-cli-archive.ps1smoke-tests the bundled server withaspire-managed --helpand asserts exit 0. ButAspire.Managed's entry point is a hardargs switchondashboard|server|nuget; anything else — including--help— falls through toShowUsage(), which prints the usage banner to stderr and returns1(src/Aspire.Managed/Program.cs:22-28,58-62). So the assertion was guaranteed to fail against the real binary.The bug was not caught pre-merge because the AzDO build+sign pipeline doesn't run on GitHub PRs (it's the post-merge signed pipeline), and the acquisition test added alongside the verifier uses a synthetic fake archive whose
aspire-manageddoesn't share the real binary's exit behavior.Fix
Invoke
aspire-managed nuget --helpinstead. Thenugetsubcommand dispatches throughSystem.CommandLine'sRootCommand, which adds--helpautomatically and returns 0 — so it both smoke-tests the NativeAOT-compiled CommandLine path and satisfies the verifier's exit-code assertion. TheAspire.Managedbinary itself is unchanged.Surprises
None. No behavior change for users of the shipped CLI; only the post-merge verifier script changes.