Repository navigation
Allow pipeline steps to depend on deployment-target steps materialized during before-start - #21511
Conversation
Steps that depend on deployment-target provisioning steps (for example
provision-{name}-containerapp) failed with 'depends on unknown step'
because before-start validated the full step graph before the deployment
targets it materializes existed. Before-start now validates references for
the steps it executes; ExecuteAsync still validates the full graph.
Fixes #20301
Co-authored-by: Copilot <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21511Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21511" |
Tests selector52 / 100 PR test projects · 4 PR jobs, from 3 changed files. Selected PR test projects (52 / 100)
Selected PR jobs (4)
How these were chosen — grouped by what changed
🔧 show 44
🧪 📦 affected project 🧪 📦 affected project Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change allowing references to provisioning steps created during before-start.
No open issues 🎉
What changed in this PR
Fixes #20301 by allowing pipeline steps to reference deployment-target provisioning steps that are created during before-start, while preserving validation of steps needed for startup.
Changes:
- Limits sequential execution’s reference validation to the target step and its transitive dependencies.
- Preserves duplicate-name checks and full-graph validation for normal pipeline execution.
- Adds core regression tests and an Azure Container App Job publishing test.
| File | Description |
|---|---|
tests/Aspire.Hosting.Tests/Pipelines/DistributedApplicationPipelineTests.cs |
Tests deferred step creation and rejection of unknown references within the executed dependency closure. |
tests/Aspire.Hosting.Azure.Tests/AzureContainerAppEnvironmentExtensionsTests.cs |
Tests publishing with a custom step that depends on Container App Job provisioning. |
src/Aspire.Hosting/Pipelines/DistributedApplicationPipeline.cs |
Separates name and reference validation and defers unrelated reference checks during sequential execution. |
Review effort: Balanced
|
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. |
|
CI green on exact head 1d79cbe (338 pass / 14 skipped). Attempt-1 failures were unrelated: Hosting-6 (windows) runner lost communication (infra); Hosting.MongoDB (ubuntu) failed in attempts 1–2 with the pre-existing 🤖 Posted by AspireAgent (AI Agent) |
Mitch Denny (mitchdenny)
left a comment
There was a problem hiding this comment.
Reviewed the deferred before-start reference validation and regression coverage. No blocking findings.
|
Pull request created: #2035
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#2035 targeting Documented that pipeline steps can depend on per-resource deployment-target steps (e.g. Note This draft PR needs human review before merging. |
Documents changes from microsoft/aspire#21511 Author: ``@davidfowl`` (source PR author; see PR) **Target branch:** Targeting `release/17.0` based on the source PR milestone `17.0` (`exact_match`). ## Why The source PR lets pipeline steps depend on per-resource deployment-target steps (e.g. `provision-myjob-containerapp`) that are only materialized during `before-start`. Step references are now validated when executed, and the full graph is validated on publish/deploy/`--step`. Triggered signal: `pr_body_has_cli_flag_mention` (the PR body mentions `--step` validating the full graph). ## Changes - Updated `src/frontend/src/content/docs/deployment/pipelines.mdx` (existing page): added a "Depend on per-resource deployment steps" subsection under Step dependencies. > Generated by [PR Documentation Check](https://github.com/microsoft/aspire/actions/runs/41574970207) for #21511 · copilot · auto · 26 AIC · ⌖ 1.14 AIC · ⊞ 7.1K · [◷](https://github.com/search?q=repo%3Amicrosoft%2Faspire.dev+%22gh-aw-workflow-id%3A+pr-docs-check%22&type=pullrequests) <!-- gh-aw-agentic-workflow: PR Documentation Check, engine: copilot, model: auto, id: 41574970207, workflow_id: pr-docs-check, run: https://github.com/microsoft/aspire/actions/runs/41574970207 --> <!-- gh-aw-workflow-id: pr-docs-check --> <!-- gh-aw-workflow-call-id: microsoft/aspire/pr-docs-check --> --------- Co-authored-by: aspire-repo-bot[bot] <268009190+aspire-repo-bot[bot]@users.noreply.github.com> Co-authored-by: AJ Matthews <[email protected]>
Description
A pipeline step that depends on a per-resource deployment-target provisioning step (for example
provision-myjob-containerappfromPublishAsAzureContainerAppJob()) fails at startup with:Root cause
ExecuteBeforeStartHooksAsyncruns thebefore-startstep throughExecuteStepSequentiallyAsync, which calledResolveStepsAsyncand therefore validated everyDependsOn/RequiredByreference in the whole pipeline. But per-resource provisioning steps such asprovision-{name}-containerappcome from deployment targets that are only materialized whilebefore-startruns (byprepare-azure-container-apps-{env}). So a user step unrelated tobefore-start(it is required bydeploy) was rejected before the step it references could exist. Depending on an aggregate step likeprovision-azure-bicep-resourcesworked only because that step exists up front.Fix
ExecuteStepSequentiallyAsyncresolves steps without full-graph reference validation (duplicate names are still rejected;RequiredByedges to unresolved steps are skipped during normalization), then validates everyDependsOn/RequiredByreference of the steps it is about to execute (the target's transitive closure). Misconfigured steps that participate inbefore-startstill fail fast with the same messages.ExecuteAsync(publish/deploy/--step) is unchanged and still validates the full graph — by then the deployment targets exist, so the dependency onprovision-myjob-containerappresolves and is ordered correctly.Regression evidence
DistributedApplicationPipelineTests.ExecuteStepSequentiallyAsync_StepOutsideTargetClosureDependsOnStepMaterializedByTarget_Succeeds(core repro: a step factory that only yieldsprovision-computeafter a before-start step runs)Step 'start-job' depends on unknown step 'provision-compute'AzureContainerAppEnvironmentExtensionsTests.PipelineStepCanDependOnContainerAppJobProvisioningStep(the issue's AppHost: ACA env +PublishAsAzureContainerAppJob()+Pipeline.AddStep(dependsOn: "provision-myjob-containerapp", requiredBy: deploy), published end to end)Step 'start-myjob' depends on unknown step 'provision-myjob-containerapp'DependsOn/RequiredByinside the executed closure still throwBroader local runs with the fix (Linux):
Aspire.Hosting.TestsPipelines + PipelineExecutor + ComputeEnvironmentValidation + PythonAppDeployPipeline tests: 239/239 passed.Aspire.Hosting.Azure.TestsAzureContainerAppEnvironmentExtensions + AzureContainerApps + AzureDeployer + AzureAppService tests: 246/246 passed.Fixes #20301
Checklist
🤖 Posted by AspireAgent (AI Agent)