Repository navigation
Graduate required-command custom validation to stable - #22157
Maddy Montaquila (maddymontaquila) merged 2 commits into
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22157Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22157" |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the required-command validation API stabilization.
No open issues 🎉
What changed in this PR
Graduates Aspire Hosting’s existing custom required-command validation contract to stable without changing runtime behavior. Validation remains advisory: failures produce warnings but allow resources to attempt startup.
Changes:
- Removes
ASPIRECOMMAND001attributes and related suppressions while leaving generated API baselines untouched. - Documents the retired diagnostic and advisory validation semantics.
- Strengthens regression coverage to verify startup-event completion while a warning notification remains unanswered.
| File | Description |
|---|---|
tests/Aspire.Hosting.Tests/RequiredCommandAnnotationTests.cs |
Verifies advisory failure and non-blocking notifications; removes suppression. |
tests/Aspire.Hosting.Tests/DotnetToolResourceTests.cs |
Removes retired diagnostic suppression. |
tests/Aspire.Hosting.JavaScript.Tests/RequiredCommandTests.cs |
Removes retired diagnostic suppression. |
tests/Aspire.Hosting.Go.Tests/AddGoAppTests.cs |
Removes retired diagnostic suppression. |
tests/Aspire.Hosting.DotnetTool.Tests/AddDotnetToolTests.cs |
Removes suppressions around annotation assertions. |
tests/Aspire.Hosting.DevTunnels.Tests/DevTunnelResourceBuilderExtensionsTests.cs |
Removes retired diagnostic suppression. |
tests/Aspire.Hosting.DevTunnels.Tests/DevTunnelCliVersionValidationTests.cs |
Removes retired diagnostic suppression. |
tests/Aspire.Hosting.Azure.Tests/AzureFunctionsTests.cs |
Removes retired diagnostic suppression. |
src/Aspire.Hosting/RequiredCommandResourceExtensions.cs |
Stabilizes the callback overload and removes related suppressions. |
src/Aspire.Hosting/Lifecycle/RequiredCommandValidationEventingSubscriber.cs |
Removes retired diagnostic suppression. |
src/Aspire.Hosting/DistributedApplicationBuilder.cs |
Removes suppressions around validator registration. |
src/Aspire.Hosting/ApplicationModel/RequiredCommandValidator.cs |
Removes retired diagnostic suppression. |
src/Aspire.Hosting/ApplicationModel/RequiredCommandValidationResult.cs |
Stabilizes validation results and documents advisory failures. |
src/Aspire.Hosting/ApplicationModel/RequiredCommandValidationContext.cs |
Stabilizes the callback context. |
src/Aspire.Hosting/ApplicationModel/RequiredCommandAnnotation.cs |
Stabilizes the annotation and documents advisory failures. |
src/Aspire.Hosting/ApplicationModel/IRequiredCommandValidator.cs |
Stabilizes the validator interface. |
src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs |
Removes retired diagnostic suppression. |
src/Aspire.Hosting.DevTunnels/DevTunnelResourceBuilderExtensions.cs |
Removes retired diagnostic suppression. |
docs/list-of-diagnostics.md |
Documents diagnostic retirement and unchanged advisory behavior. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Retain advisory startup validation, graduate the related contract together, and remove obsolete diagnostic suppressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
5eefd63 to
d503439
Compare
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Preserve the release branch's Deno stabilization while resolving diagnostic documentation and suppression conflicts. Refresh generated Go and TypeScript documentation snapshots for the stable callback contract and scope the advisory-warning assertion to its validator logger. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Resolved release/17.0 merge conflicts in 3d5f9c9, preserving both Deno graduation and this PR’s required-command graduation. Regenerated the affected TypeScript and Go snapshots, addressing the latest review finding, and fixed the advisory-warning regression test to select the RequiredCommandValidator logger rather than unrelated hosting warnings. No API baselines or runtime behavior changed. Validation on macOS arm64 after the merge (all passed): ./restore.sh
# passed
dotnet test --project tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
# passed: 156 tests
dotnet test --project tests/Aspire.Hosting.CodeGeneration.Go.Tests/Aspire.Hosting.CodeGeneration.Go.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
# passed: 137 tests
dotnet test --project tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj --no-launch-profile -- --filter-class "*.RequiredCommandAnnotationTests" --filter-class "*.DotnetToolResourceTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
# passed: 30 tests
dotnet test --project tests/Aspire.Hosting.DevTunnels.Tests/Aspire.Hosting.DevTunnels.Tests.csproj --no-launch-profile -- --filter-class "*.DevTunnelCliVersionValidationTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
# passed: 10 tests
dotnet test --project tests/Aspire.Hosting.JavaScript.Tests/Aspire.Hosting.JavaScript.Tests.csproj --no-launch-profile -- --filter-class "*.RequiredCommandTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
# passed: 17 tests
git diff origin/release/17.0 --check
# passedFull repository suites were not run locally. New CI validation is required before merging; unrelated CLI staging-channel failures were not worked around in this PR. 🤖 AI-authored reply via Agency Finish PR. |
Tests selector52 / 101 PR test projects · 4 PR jobs, from 20 changed files. Selected PR test projects (52 / 101)
Selected PR jobs (4)
How these were chosen — grouped by what changed
🔧 show 37
🧪 📦 affected project 🔧 🧪 📦 affected project 🔧 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
The original stabilization received an APPROVED review from @eerhardt, who introduced the callback context/result and validator contract. That approval was on the original stabilization commit, before the release replay and latest target merge; it is not a fresh review of the current head. The replay preserved the stabilization patch, and the latest changes resolve release conflicts and repair documentation snapshots and the scoped warning assertion without broadening the API contract. Any required current-head approval remains governed by the repository merge rules. 🤖 AI-authored reply via Agency Finish PR. |
bcb6b84
into
release/17.0
|
Pull request created: #2168
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#2168 targeting Marks ASPIRECOMMAND001 as retired in 17.0 and documents advisory required-command validation semantics. Signals: Note This draft PR needs human review before merging. |

Description
Custom required-command validation can be consumed without opting into
ASPIRECOMMAND001. This graduates the existing callback overload ofWithRequiredCommandtogether withIRequiredCommandValidator,RequiredCommandAnnotation,RequiredCommandValidationContext, andRequiredCommandValidationResult; no APIs are deleted or renamed.The contract remains advisory: missing commands or failed callback validation log warnings and allow resources to attempt startup. This is annotation-driven, run-time app-model validation, already used by .NET tool SDK validation. The startup subscriber awaits validation but does not block startup based on its result. The strengthened regression test verifies that a failed callback logs a warning and completes the startup event while its warning notification is still unanswered.
Removes only this contract's experimental attributes and directly related suppressions, documents the retired diagnostic and advisory semantics, and leaves generated
api/*baselines untouched. No runtime behavior, export names, dependencies, or unrelated experimental contracts change. This PR proposes graduation; it does not assert prior maintainer approval.Checked current
mainand open PRs forASPIRECOMMAND001andWithRequiredCommand; no overlapping graduation PR was found. After retargeting torelease/17.0, replayed only the stabilization commit from its verified original-main fork point (793dfe6e254fe050af24cb7bcfba214066dcaab8) onto release commit9a97ab889bfb731de74ead0280be279ffdd000bf. The release APIs already exist; no conflicts or release-specific adaptations were needed.git range-diffconfirms the replayed patch is unchanged. The original replay contained one intended commit and 19 changed files, without unrelated main history. Subsequently merged release/17.0 ata509f094e0ee87d17dc0e1cc9bca84f7ca2623da, preserving both Deno and required-command graduation when resolving conflicts. Refreshed the generated Go/TypeScript documentation snapshots and scoped the advisory-warning regression assertion to the validator logger. Current PR scope: two commits and 21 changed files; generated API compatibility baselines remain untouched.Original API contributors: cc David Fowler (@davidfowl), verified co-author with Copilot of the initial annotation and callback infrastructure, and Eric Erhardt (@eerhardt), who introduced the context/result callback contract and validator service, all in #11944. Attribution is based on the introducing commits, not the squash author or merge committer. These are mentions, not reviewer assignments.
User-facing usage
Existing callback-based validation no longer needs an
ASPIRECOMMAND001suppression:Callbacks can return
context.Failure("Install a supported tool version.")to report a warning without preventing a startup attempt.Validation
Latest post-merge validation at
3d5f9c9a5229621c684b8081ae834bf12fd61954: 350 tests passed (complete TypeScript and Go code-generation suites plus focused Hosting, DevTunnels, and JavaScript tests). Exact commands and individual results are in the validation comment. Restore and release-relative diff checks also passed. The earlier release-replay results below are historical, not a substitute for this validation.Release validation: rerun on macOS arm64 after replaying onto
release/17.0, at headd50343937f6cfedf6256f15e40206ad912cab91f:Result: passed, 30 tests, including advisory failure, notification non-blocking behavior, callback context/results, validation coalescing, and .NET SDK validation.
Result: passed, 10 tests, exercising a dependent custom-validation consumer.
Result: passed. Both test commands also passed previously on the original main-based commit (30 and 10 tests respectively); those earlier results are separate from the release validation above. Full repository and remaining integration suites were not run.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?