Add publisher output path contract#18875
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 55316bf5-3565-4b4d-bcc6-716c769618cc
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 55316bf5-3565-4b4d-bcc6-716c769618cc
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18875Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18875" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Adds a hosting-core output contract for publish/deploy pipeline steps, enabling safe output discovery and relocation.
Changes:
- Introduces named output definitions, resolution, validation, and execution authorization.
- Exposes output plans through the CLI backchannel.
- Migrates built-in publishers and adds contract tests.
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/Aspire.Hosting.Tests/Pipelines/PipelineOutputRegistryTests.cs |
Tests output planning and relocation. |
tests/Aspire.Hosting.Tests/Backchannel/BackchannelContractTests.cs |
Covers new backchannel DTOs. |
tests/Aspire.Cli.Tests/TestServices/TestAppHostCliBackchannel.cs |
Extends the test backchannel. |
tests/Aspire.Cli.Tests/Commands/PublishCommandPromptingIntegrationTests.cs |
Updates the publish test double. |
tests/Aspire.Cli.Tests/Backchannel/BackchannelJsonSerializerContextTests.cs |
Tests output-plan serialization. |
src/Shared/PublishingContextUtils.cs |
Uses the resolved primary output. |
src/Aspire.Hosting/README.md |
Documents publisher outputs. |
src/Aspire.Hosting/Publishing/PipelineExecutor.cs |
Freezes and authorizes execution plans. |
src/Aspire.Hosting/Publishing/ManifestPublishingExtensions.cs |
Adds manifest relocation support. |
src/Aspire.Hosting/Publishing/BeforePublishEvent.cs |
Documents frozen-plan semantics. |
src/Aspire.Hosting/Pipelines/ResolvedPipelineOutput.cs |
Defines resolved outputs. |
src/Aspire.Hosting/Pipelines/PipelineStepContext.cs |
Exposes output resolution. |
src/Aspire.Hosting/Pipelines/PipelineStep.cs |
Adds output declarations and relocation support. |
src/Aspire.Hosting/Pipelines/PipelineOutputRegistry.cs |
Implements output planning and authorization. |
src/Aspire.Hosting/Pipelines/PipelineOutputKind.cs |
Defines file and directory output kinds. |
src/Aspire.Hosting/Pipelines/PipelineOutputDefinition.cs |
Defines named output metadata. |
src/Aspire.Hosting/Pipelines/IPipelineOutputResolver.cs |
Defines output resolution APIs. |
src/Aspire.Hosting/Pipelines/DistributedApplicationPipeline.cs |
Separates preparation from execution. |
src/Aspire.Hosting/DistributedApplicationBuilder.cs |
Registers output services. |
src/Aspire.Hosting/Backchannel/BackchannelDataTypes.cs |
Adds output-plan RPC contracts. |
src/Aspire.Hosting/Backchannel/AppHostRpcTarget.cs |
Exposes output inspection and authorization. |
src/Aspire.Hosting.Radius/Publishing/RadiusBicepPublishingContext.cs |
Enables Radius relocation. |
src/Aspire.Hosting.Kubernetes/KubernetesEnvironmentResource.cs |
Enables Kubernetes relocation. |
src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs |
Marks validation as relocation-safe. |
src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs |
Routes EF artifacts through primary output. |
src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResourceBuilderExtensions.cs |
Updates output-path documentation. |
src/Aspire.Hosting.Docker/DockerComposeEnvironmentResource.cs |
Enables Compose relocation. |
src/Aspire.Hosting.Azure/AzureEnvironmentResource.cs |
Routes Azure artifacts through primary output. |
src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentResource.cs |
Marks validation as relocation-safe. |
src/Aspire.Cli/Backchannel/BackchannelJsonSerializerContext.cs |
Registers new RPC DTOs. |
src/Aspire.Cli/Backchannel/AppHostCliBackchannel.cs |
Implements output-plan RPC calls. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
PR Testing ReportPR Information
Artifact Version Verification
Changes AnalyzedFiles Changed
Change Categories
Test Scenarios ExecutedScenario 1: Exact-head artifact and focused source validationObjective: Verify the tested dogfood artifact matches the PR and exercise the output plan, relocation authorization, backchannel contract, and CLI serialization directly from the same commit. Coverage Type: Artifact identity, unit, and integration Status: PASS Steps:
Results:
Evidence:
Scenario 2: Custom directory and file outputsObjective: Verify a custom publisher can declare both output kinds and write through the resolved paths rooted at the AppHost directory. Coverage Type: Happy path Status: PASS Steps:
Results:
Evidence:
Scenario 3: Configured named-output overrideObjective: Verify Coverage Type: Boundary/configuration Status: PASS Steps:
Evidence:
Scenario 4: Built-in manifest and Docker Compose publishersObjective: Verify built-in publishers use the new primary output resolver without regressing file-vs-directory output behavior. Coverage Type: Happy path and boundary Status: PASS Steps:
Results:
Evidence:
Scenario 5: Fail-closed output validationObjective: Verify invalid output plans fail during preparation before publisher actions write artifacts. Coverage Type: Unhappy path Status: PASS Cases:
Expected Unhappy-Path Outcome: A non-zero exit, a specific validation error, and no pipeline-action writes. Evidence:
Summary
Overall ResultPASS - PR VERIFIED IN THE APPROVED TEST SCOPE No product defects were found. The relocation-only backchannel flow is not yet exposed as a CLI verification command in this PR, so its pause, inspection, authorization, and relocated-write behavior was validated through the exact-head Hosting integration tests. Artifacts
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 55316bf5-3565-4b4d-bcc6-716c769618cc
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. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 55316bf5-3565-4b4d-bcc6-716c769618cc
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 55316bf5-3565-4b4d-bcc6-716c769618cc
Tests selector (audit mode)The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement. 50 / 100 test projects · 5 jobs, from 33 changed files. Selected test projects (50 / 100)
Selected jobs (5)
How these were chosen — grouped by what changed
🔧 show 32
🔧 🔧 🧪 🔧 🔧 📦 affected project 📦 affected project 🔧 🔧 🔧 🔧 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Description
Custom pipeline publishers can currently write only through the primary
--output-pathcontract. Publishers that also generate repository artifacts such as.configgen/and.pipelines/must discover roots themselves, and the CLI cannot safely inventory or relocate those writes for drift verification.This change adds an experimental publisher output contract rooted at the AppHost project directory. Pipeline steps can declare named file or directory outputs, resolve the authoritative writable path at execution time, and use a separate logical target path when generated content refers to its checked-in destination.
User-facing usage
context.Outputs.AppHostDirectoryprovides the authoritative AppHost root. Named targets can be overridden withPipeline:Outputs:<step-name>:<output-name>:Path.The runtime now freezes the selected step graph and output plan before
BeforePublishEvent, exposes that plan through the versionedpipeline-outputs.v1main-backchannel capability, and pauses relocated execution until the CLI explicitly authorizes it. Non-relocatable selected steps fail closed at authorization. Built-in manifest, Docker Compose, Kubernetes, Azure, Radius, EF Core, and JavaScript publishing steps now use or opt into this contract.This is the output-contract prerequisite for
aspire publish --verifyin #18833; the CLI drift reconciliation is intentionally a follow-up.Validation
Fixes #18873
Checklist
<remarks />and<code />elements on your triple slash comments?