Skip to content

Commit a650bd9

Browse files
Copilotdavidfowl
andcommitted
Remove OutputPath property from PipelineContext and PipelineStepContext
- 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 <95136+davidfowl@users.noreply.github.com>
1 parent e0d5ffd commit a650bd9

5 files changed

Lines changed: 4 additions & 14 deletions

File tree

src/Aspire.Hosting.Azure/AzureEnvironmentResource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private Task PublishAsync(PipelineStepContext context)
122122
{
123123
var azureProvisioningOptions = context.Services.GetRequiredService<IOptions<AzureProvisioningOptions>>();
124124
var publishingContext = new AzurePublishingContext(
125-
context.OutputPath,
125+
context.OutputService.GetOutputDirectory(),
126126
azureProvisioningOptions.Value,
127127
context.Services,
128128
context.Logger,

src/Aspire.Hosting/Pipelines/PipelineContext.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,4 @@ public sealed class PipelineContext(
5656
/// Gets the service for managing pipeline output directories.
5757
/// </summary>
5858
public IPipelineOutputService OutputService { get; } = new PipelineOutputService(outputPath, serviceProvider.GetRequiredService<IConfiguration>());
59-
60-
/// <summary>
61-
/// Gets the output path for deployment artifacts.
62-
/// </summary>
63-
public string OutputPath => OutputService.GetOutputDirectory();
6459
}

src/Aspire.Hosting/Pipelines/PipelineStepContext.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,4 @@ public sealed class PipelineStepContext
5959
/// Gets the service for managing pipeline output directories.
6060
/// </summary>
6161
public IPipelineOutputService OutputService => PipelineContext.OutputService;
62-
63-
/// <summary>
64-
/// Gets the output path for deployment artifacts.
65-
/// </summary>
66-
public string OutputPath => PipelineContext.OutputPath;
6762
}

src/Shared/PublishingContextUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ public static string GetEnvironmentOutputPath(PipelineStepContext context, IComp
1515
if (context.Model.Resources.OfType<IComputeEnvironmentResource>().Count() > 1)
1616
{
1717
// If there are multiple compute environments, append the environment name to the output path
18-
return Path.Combine(context.OutputPath, environment.Name);
18+
return Path.Combine(context.OutputService.GetOutputDirectory(), environment.Name);
1919
}
2020

2121
// If there is only one compute environment, use the root output path
22-
return context.OutputPath;
22+
return context.OutputService.GetOutputDirectory();
2323
}
2424
}

tests/Aspire.Hosting.Tests/Helpers/JsonDocumentManifestPublisher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static IDistributedApplicationPipeline AddJsonDocumentManifestPublishing(
7878
using var stream = new MemoryStream();
7979
using var writer = new Utf8JsonWriter(stream, new() { Indented = true });
8080

81-
var manifestPath = context.OutputPath ?? "aspire-manifest.json";
81+
var manifestPath = context.OutputService.GetOutputDirectory();
8282
var publishingContext = new ManifestPublishingContext(executionContext, manifestPath, writer, context.CancellationToken);
8383

8484
await publishingContext.WriteModel(context.Model, context.CancellationToken).ConfigureAwait(false);

0 commit comments

Comments
 (0)