Skip to content

Commit 24edde9

Browse files
CopilotIEvangelist
andauthored
Add breaking changes documentation for pipeline activity reporter API rename (PR #12137) (#5310)
* Initial plan * Add breaking changes article for PR #12137 and update documentation Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> * Fix parameter naming consistency in breaking change examples Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> * Fix cross reference warnings by using inline code formatting Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: David Pine <david.pine@microsoft.com>
1 parent 7d37af5 commit 24edde9

File tree

5 files changed

+156
-11
lines changed

5 files changed

+156
-11
lines changed

docs/compatibility/13.0/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Breaking changes in Aspire 13.0
33
titleSuffix: ""
44
description: Navigate to the breaking changes in Aspire 13.0.
5-
ms.date: 10/17/2025
5+
ms.date: 10/20/2025
66
---
77

88
# Breaking changes in Aspire 13.0
@@ -18,4 +18,5 @@ If you're migrating an app to Aspire 13.0, the breaking changes listed here migh
1818

1919
| Title | Type of change | Introduced version |
2020
|--|--|--|
21+
| [Activity reporter and pipeline context renamed](pipeline-activity-reporter-renamed.md) | Binary incompatible, source incompatible | 13.0 |
2122
| [DefaultAzureCredential defaults to ManagedIdentityCredential on ACA and App Service](defaultazurecredential-managedidentity-default.md) | Behavioral change | 13.0 |
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
title: "Breaking change - Activity reporter and pipeline context renamed"
3+
description: "Learn about the breaking change in Aspire 13.0 where publishing activity reporter APIs and context types were renamed to reflect pipeline architecture."
4+
ms.date: 10/20/2025
5+
ai-usage: ai-assisted
6+
ms.custom: https://github.com/dotnet/aspire/pull/12137
7+
---
8+
9+
# Activity reporter and pipeline context renamed
10+
11+
In Aspire 13.0, the publishing activity reporter APIs and context types have been renamed to better reflect the pipeline architecture. The publishing step creation process has been simplified, with steps now automatically created during pipeline execution rather than requiring explicit creation within step actions.
12+
13+
## Version introduced
14+
15+
Aspire 13.0 Preview 1
16+
17+
## Previous behavior
18+
19+
The previous API used publishing-specific names and required explicit step creation within pipeline actions:
20+
21+
```csharp
22+
builder.Pipeline.AddStep("assign-storage-role", async (context) =>
23+
{
24+
var roleAssignmentStep = await context.ActivityReporter
25+
.CreateStepAsync($"assign-storage-role", context.CancellationToken);
26+
27+
await using (roleAssignmentStep.ConfigureAwait(false))
28+
{
29+
var assignRoleTask = await roleAssignmentStep
30+
.CreateTaskAsync($"Granting file share access...", context.CancellationToken);
31+
32+
await using (assignRoleTask.ConfigureAwait(false))
33+
{
34+
// ... task work
35+
}
36+
}
37+
});
38+
```
39+
40+
The types used were:
41+
42+
- `DeployingContext` - Provided context for pipeline execution
43+
- `IPublishingActivityReporter` - Interface for reporting activities
44+
- `PublishingActivityReporter` - Implementation of the activity reporter
45+
- `NullPublishingActivityReporter` - Null object pattern implementation
46+
- `IPublishingStep` - Interface for publishing steps
47+
- `IPublishingTask` - Interface for publishing tasks
48+
49+
## New behavior
50+
51+
The API now uses pipeline-specific names and automatically creates steps during pipeline execution:
52+
53+
```csharp
54+
builder.Pipeline.AddStep("assign-storage-role", async (stepContext) =>
55+
{
56+
var assignRoleTask = await stepContext.ReportingStep
57+
.CreateTaskAsync($"Granting file share access...", stepContext.CancellationToken);
58+
59+
await using (assignRoleTask.ConfigureAwait(false))
60+
{
61+
// ... task work
62+
}
63+
});
64+
```
65+
66+
The types have been renamed as follows:
67+
68+
- `DeployingContext``PipelineContext` - Shared context across all pipeline steps
69+
- `IPublishingActivityReporter``IPipelineActivityReporter` - Interface for reporting pipeline activities
70+
- `PublishingActivityReporter``PipelineActivityReporter` - Implementation of the pipeline activity reporter
71+
- `NullPublishingActivityReporter``NullPipelineActivityReporter` - Null object pattern implementation
72+
- `IPublishingStep``IReportingStep` - Interface for reporting steps
73+
- `IPublishingTask``IReportingTask` - Interface for reporting tasks
74+
75+
Additionally, a new `PipelineStepContext` type has been introduced that combines the shared `PipelineContext` with a step-specific `IReportingStep`, allowing each step to track its own tasks and completion state independently.
76+
77+
## Type of breaking change
78+
79+
This change can affect [binary compatibility](../categories.md#binary-compatibility) and [source compatibility](../categories.md#source-compatibility).
80+
81+
## Reason for change
82+
83+
The previous three-level hierarchy (`ActivityReporter → Step → Task`) was unnecessarily complex. The new architecture simplifies this by automatically creating steps during pipeline execution and integrating step management directly into the pipeline. This provides a cleaner separation between the shared pipeline context and step-specific execution context, making the API more intuitive and reducing boilerplate code.
84+
85+
## Recommended action
86+
87+
Update your code to use the new type names and simplified step creation pattern:
88+
89+
1. Replace `DeployingContext` with `PipelineContext` for shared pipeline context or `PipelineStepContext` for step-specific context.
90+
1. Replace `IPublishingActivityReporter` with `IPipelineActivityReporter`.
91+
1. Replace `PublishingActivityReporter` with `PipelineActivityReporter`.
92+
1. Replace `NullPublishingActivityReporter` with `NullPipelineActivityReporter`.
93+
1. Replace `IPublishingStep` with `IReportingStep`.
94+
1. Replace `IPublishingTask` with `IReportingTask`.
95+
1. Update pipeline step actions to accept `PipelineStepContext` instead of `DeployingContext`.
96+
1. Remove explicit step creation calls within pipeline actions and use the automatically created `context.ReportingStep` instead.
97+
98+
Migration example:
99+
100+
```csharp
101+
// Before
102+
builder.Pipeline.AddStep("my-step", async (context) =>
103+
{
104+
var step = await context.ActivityReporter
105+
.CreateStepAsync("my-step", context.CancellationToken);
106+
107+
await using (step.ConfigureAwait(false))
108+
{
109+
var task = await step.CreateTaskAsync("Doing work...", context.CancellationToken);
110+
await using (task.ConfigureAwait(false))
111+
{
112+
// Do work
113+
await task.CompleteAsync("Done", CompletionState.Completed, context.CancellationToken);
114+
}
115+
}
116+
});
117+
118+
// After
119+
builder.Pipeline.AddStep("my-step", async (stepContext) =>
120+
{
121+
var task = await stepContext.ReportingStep
122+
.CreateTaskAsync("Doing work...", stepContext.CancellationToken);
123+
124+
await using (task.ConfigureAwait(false))
125+
{
126+
// Do work
127+
await task.CompleteAsync("Done", CompletionState.Completed, stepContext.CancellationToken);
128+
}
129+
});
130+
```
131+
132+
## Affected APIs
133+
134+
- <xref:Aspire.Hosting.ApplicationModel.DeployingContext?displayProperty=fullName>
135+
- <xref:Aspire.Hosting.Publishing.IPublishingActivityReporter?displayProperty=fullName>
136+
- `Aspire.Hosting.Publishing.PublishingActivityReporter`
137+
- <xref:Aspire.Hosting.Publishing.NullPublishingActivityReporter?displayProperty=fullName>
138+
- <xref:Aspire.Hosting.Publishing.IPublishingStep?displayProperty=fullName>
139+
- <xref:Aspire.Hosting.Publishing.IPublishingTask?displayProperty=fullName>
140+
- `Aspire.Hosting.Publishing.PublishingStep`
141+
- `Aspire.Hosting.Publishing.PublishingTask`
142+
- <xref:Aspire.Hosting.Publishing.PublishingExtensions?displayProperty=fullName>

docs/compatibility/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ items:
1313
- name: Breaking changes in 13.0
1414
expanded: true
1515
items:
16+
- name: Activity reporter and pipeline context renamed
17+
href: 13.0/pipeline-activity-reporter-renamed.md
1618
- name: DefaultAzureCredential defaults to ManagedIdentityCredential on ACA and App Service
1719
href: 13.0/defaultazurecredential-managedidentity-default.md
1820
- name: Aspire 9.5

docs/extensibility/interaction-service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ These approaches help you create interactive, user-friendly experiences for loca
8787
> });
8888
> ```
8989
>
90-
> For CLI specific contexts, the interaction service is retrieved from either the `PublishingContext` or `DeploymentContext` depending on the operation being performed.
90+
> For CLI specific contexts, the interaction service is retrieved from either the `PublishingContext` or `PipelineStepContext` depending on the operation being performed.
9191
9292
## Display messages
9393

docs/fundamentals/custom-deployments.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Aspire provides powerful APIs for building container images from your resources
1414
During publishing and deployment, the container image builder is available to create images for resources that need them. Aspire uses this builder when a resource requires a container image, such as when publishing with Docker Compose. The process involves two main components:
1515

1616
- <xref:Aspire.Hosting.Publishing.IResourceContainerImageBuilder>: The service that turns resource definitions into runnable container images.
17-
- <xref:Aspire.Hosting.Publishing.IPublishingActivityReporter>: The API that provides structured progress reporting during long-running operations.
17+
- `IPipelineActivityReporter`: The API that provides structured progress reporting during long-running operations.
1818

1919
These APIs give you fine-grained control over the image building process and provide real-time feedback to users during lengthy build operations.
2020

@@ -53,27 +53,27 @@ The <xref:Aspire.Hosting.Publishing.ContainerBuildOptions> class provides strong
5353

5454
The builder performs container runtime health checks (Docker/Podman) only when at least one resource requires a Dockerfile build. This change eliminates false-positive errors in projects that publish directly from .NET assemblies. If the container runtime is required but unhealthy, the builder throws an explicit `InvalidOperationException` to surface the problem early.
5555

56-
## Publishing activity reporter API
56+
## Pipeline activity reporter API
5757

58-
The `PublishingActivityProgressReporter` API enables structured progress reporting during [`aspire publish`](../cli-reference/aspire-publish.md) and [`aspire deploy`](../cli-reference/aspire-deploy.md) commands. This reduces uncertainty during long-running operations and surfaces failures early.
58+
The `PipelineActivityReporter` API enables structured progress reporting during [`aspire publish`](../cli-reference/aspire-publish.md) and [`aspire deploy`](../cli-reference/aspire-deploy.md) commands. This reduces uncertainty during long-running operations and surfaces failures early.
5959

6060
### API overview and behavior
6161

6262
The progress reporter uses a hierarchical model with guaranteed ordering and thread-safe operations:
6363

6464
| Concept | Description | CLI Rendering | Behavior |
6565
|---------|-------------|---------------|----------|
66-
| **Step** | Top-level phase, such as "Build images" or "Deploy workloads". | Step message with status glyph and elapsed time. | Forms a strict tree structure; nested steps are unsupported. |
66+
| **Step** | Top-level phase, such as "Build images" or "Deploy workloads". | Step message with status glyph and elapsed time. | Forms a strict tree structure; nested steps are unsupported. Steps are created automatically during pipeline execution. |
6767
| **Task** | Discrete unit of work nested under a step. | Task message with indentation. | Belongs to a single step; supports parallel creation with deterministic completion ordering. |
6868
| **Completion state** | Final status: `Completed`, `Warning`, or `Error`. | ✅ (Completed), ⚠️ (Warning), ❌ (Error) | Each step/task transitions exactly once to a final state. |
6969

7070
### API structure and usage
7171

7272
The reporter API provides structured access to progress reporting with the following characteristics:
7373

74-
- **Acquisition**: Retrieved from `PublishingContext.ActivityReporter` or `DeployingContext.ActivityReporter`.
75-
- **Step creation**: `CreateStepAsync(title, ct)` returns an `IPublishingActivityStep`.
76-
- **Task creation**: `IPublishingActivityStep.CreateTaskAsync(title, ct)` returns an `IPublishingActivityTask`.
74+
- **Acquisition**: Retrieved from `PublishingContext.ActivityReporter` or through the `PipelineStepContext.ReportingStep` property in pipeline steps.
75+
- **Step creation**: Steps are now created automatically during pipeline execution. The `CreateStepAsync(title, ct)` method returns an `IReportingStep`.
76+
- **Task creation**: `IReportingStep.CreateTaskAsync(title, ct)` returns an `IReportingTask`.
7777
- **State transitions**: `SucceedAsync`, `WarnAsync`, `FailAsync` methods accept a summary message.
7878
- **Completion**: `CompletePublishAsync(message, state, isDeploy, ct)` marks the entire operation.
7979
- **Ordering**: Creation and completion events preserve call order; updates are serialized.
@@ -130,7 +130,7 @@ The preceding code:
130130

131131
- Implements a publishing pipeline that builds container images and generates deployment manifests.
132132
- Uses the `IResourceContainerImageBuilder` API to build container images.
133-
- Reports progress and completion status using the `PublishingActivityProgressReporter` API.
133+
- Reports progress and completion status using the `PipelineActivityReporter` API.
134134

135135
Your publishing callback might use `IResourceContainerImageBuilder` to build container images, while your deployment callback might use the built images and push them to a registry or deployment target.
136136

@@ -143,7 +143,7 @@ Like the publishing callback, the deploying callback is registered using the `De
143143
The preceding code:
144144

145145
- Simulates deploying workloads to a Kubernetes cluster.
146-
- Uses the `PublishingActivityProgressReporter` API to create and manage deployment steps and tasks.
146+
- Uses the `PipelineActivityReporter` API to create and manage deployment steps and tasks.
147147
- Reports progress and marks each deployment phase as completed.
148148
- Completes the deployment operation with a final status update.
149149
- Handles cancellation through the provided `CancellationToken`.

0 commit comments

Comments
 (0)