-
Notifications
You must be signed in to change notification settings - Fork 647
Add isError parameter to CompleteStepAsync method in PublishingActivityProgressReporter #9979
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
Conversation
Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com>
@copilot Update the CompatabilitySuppression.xml file in Aspire.Hosting to account for the new parameter on the CompleteStepAsyc method. |
…h new isError parameter Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com>
Updated the CompatibilitySuppressions.xml file to include the new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds an optional isError
flag to CompleteStepAsync
to report error states, updates call sites and tests for the new parameter, and keeps existing behavior backward compatible.
- Interface and implementations updated with
isError = false
default - Call sites modified to use named
cancellationToken
argument - Tests refactored to a parameterized
[Theory]
covering both error and non-error flows
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs | Added isError parameter and passed it through to activity data |
src/Aspire.Hosting/Publishing/NullPublishingActivityProgressReporter.cs | Updated null reporter signature to include isError |
src/Aspire.Hosting/Publishing/ResourceContainerImageBuilder.cs | Changed call to CompleteStepAsync to named cancellationToken |
src/Aspire.Hosting/CompatibilitySuppressions.xml | Updated suppression target to match new method signature |
tests/Aspire.Hosting.Tests/Publishing/PublishingActivityProgressReporterTests.cs | Converted test to [Theory] with InlineData for both error cases |
Comments suppressed due to low confidence (2)
src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs:143
- The
<returns>
tag in the XML documentation is empty; consider adding a descriptive summary for the returnedTask
, e.g., "ATask
that completes when the step has been reported as complete."
/// <returns></returns>
tests/Aspire.Hosting.Tests/Publishing/PublishingActivityProgressReporterTests.cs:113
- Add a test case that calls
CompleteStepAsync
without specifyingisError
to confirm the default behavior (isError=false
) and ensure backward compatibility.
[InlineData(false, "Step completed successfully", false)]
The
PublishingActivityProgressReporter.CompleteStepAsync
method now supports completing steps with error state through a new optionalisError
parameter. This brings the step completion API in line with the existing task completion functionality.Changes Made
Interface Updates
Key Features
isError
parameter defaults tofalse
, ensuring all existing code continues to work without modificationCompleteTaskAsync
method which already supports error statesPublishingActivityData.IsError
and submitted over RPCFiles Modified
src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs
- AddedisError
parameter to interface and implementationsrc/Aspire.Hosting/Publishing/NullPublishingActivityProgressReporter.cs
- Updated null implementation to match interfacesrc/Aspire.Hosting/Publishing/ResourceContainerImageBuilder.cs
- Updated method call to use named parameter syntaxtests/Aspire.Hosting.Tests/Publishing/PublishingActivityProgressReporterTests.cs
- Enhanced test coverage with Theory testsExample Usage
The implementation maintains full backward compatibility while enabling publishers to properly report step completion status, allowing the publishing activity system to accurately track both successful and failed step completions.
Fixes #9978.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.