-
Notifications
You must be signed in to change notification settings - Fork 761
[release/13.0] Register IPipelineOutputService in DI for pipeline output directory management #12581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
…ext level Co-authored-by: davidfowl <[email protected]>
- Create IPipelineOutputService interface with GetOutputDirectory() and GetTempDirectory() methods - Implement PipelineOutputService with better naming than IntermediateOutputPath - Expose service via PipelineContext.OutputService and PipelineStepContext.OutputService - Keep backward compatible OutputPath property for existing consumers - Remove direct IntermediateOutputPath property per feedback Co-authored-by: davidfowl <[email protected]>
- Add GetOutputDirectory(IResource) overload for resource-specific output directories - Add GetTempDirectory(IResource) overload for resource-specific temp directories - Implementation creates subdirectories using resource.Name under base directories - Enables per-resource isolation of output and temp artifacts Co-authored-by: davidfowl <[email protected]>
- Remove OutputPath convenience property per @davidfowl feedback - Consumers now explicitly call OutputService.GetOutputDirectory() - Update AzureEnvironmentResource to use OutputService.GetOutputDirectory() - Update PublishingContextUtils to use OutputService.GetOutputDirectory() - Update test helper to use OutputService.GetOutputDirectory() - Keep OutputService property for explicit access to output management Co-authored-by: davidfowl <[email protected]>
- Register IPipelineOutputService in DI container with PipelineOptions - Remove OutputService property from PipelineContext and PipelineStepContext - Remove outputPath parameter from PipelineContext constructor - Update all consumers to resolve IPipelineOutputService from Services - AzureEnvironmentResource - PublishingContextUtils - JsonDocumentManifestPublisher test helper - Remove IOptions<PipelineOptions> dependency from PipelineExecutor - Steps now explicitly resolve IPipelineOutputService when needed Co-authored-by: davidfowl <[email protected]>
…specific overload - PipelineOutputService now injects IOptions<PipelineOptions> and IConfiguration directly in constructor - Simplified DI registration to use standard AddSingleton without factory lambda - PublishingContextUtils uses GetOutputDirectory(environment) for resource-specific paths - Removes manual path combination logic in favor of service method Co-authored-by: davidfowl <[email protected]>
Co-authored-by: Copilot <[email protected]>
- Update Experimental attribute from ASPIREPIPELINES001 to ASPIREPIPELINES004 - Add XML documentation for GetOutputDirectory() default behavior - Add XML documentation for private fields in PipelineOutputService - Document purpose of AppHost:PathSha256 usage in CreateTempDirectory - Suppress ASPIREPIPELINES004 diagnostic in all consuming files Co-authored-by: captainsafia <[email protected]>
Contributor
Author
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12581Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12581" |
davidfowl
approved these changes
Nov 1, 2025
captainsafia
approved these changes
Nov 1, 2025
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.
Backport of #12563 to release/13.0
/cc @davidfowl @copilot
Customer Impact
Customers were experiencing issues when using the Aspire CLI publish command without specifying an output path. The previous implementation always required an OutputPath and would throw
InvalidOperationExceptionin Azure, Kubernetes, and Docker Compose publishing contexts when OutputPath was null. This PR introduces a newIPipelineOutputServicethat provides a default output path ({CurrentDirectory}/aspire-output) when none is specified, eliminating these exceptions and providing a consistent, predictable behavior.Testing
outputPathparameter fromPipelineContextconstructorRisk
Low to Medium. This is a refactoring that changes how output paths are managed internally:
PipelineContext,PipelineStepContext) and introduces a new service that multiple publishing contexts depend onIPipelineOutputServiceis marked as[Experimental("ASPIREPIPELINES004")], appropriately flagging the API surface as subject to changeRegression?
No - This is a bug fix that resolves exceptions when OutputPath is not specified. It maintains backward compatibility by still respecting explicitly provided output paths.