Skip to content

Rename WaitBehavior enumeration values for clarity - #7703

Closed
Mitch Denny (mitchdenny) wants to merge 4 commits into
mainfrom
mitchdenny/wait-behavior-enum-names
Closed

Mitch Denny (mitchdenny) wants to merge 4 commits into
mainfrom
mitchdenny/wait-behavior-enum-names

Conversation

@mitchdenny

Copy link
Copy Markdown
Member

Update enumeration values to improve understanding of their intent, changing WaitOnResourceUnavailable to Wait and StopOnResourceUnavailable to Throw. Adjust related code to reflect these changes.

Copilot AI review requested due to automatic review settings February 20, 2025 02:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

src/Aspire.Hosting/ApplicationModel/WaitAnnotation.cs:68

  • The comment should be updated to reflect the new behavior accurately. Suggestion: 'Throw an exception if the resource enters a terminal state.'
/// Throw if the resource enters a terminal state.

src/Aspire.Hosting/ApplicationModel/ResourceNotificationService.cs:15

  • The error message could be more descriptive. Consider updating it to: "The operation was cancelled before the resource '{resourceName}' met the predicate condition."
throw new OperationCanceledException("The operation was cancelled before the resource met the predicate condition.");

Comment thread src/Aspire.Hosting/ApplicationModel/WaitAnnotation.cs Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mitchdenny Mitch Denny (mitchdenny) added the area-app-testing Issues pertaining to the APIs in Aspire.Hosting.Testing label Feb 20, 2025
@mitchdenny Mitch Denny (mitchdenny) added this to the 9.1 milestone Feb 20, 2025
@danmoseley Dan Moseley (danmoseley) added the Servicing-approved Approved for servicing release label Feb 20, 2025

@eerhardt Eric Erhardt (eerhardt) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I commented #7374 (comment) that "WaitBehavior.Throw" is a little oxymoronic, but this is used in WaitFor and WaitAnnotation, so no other name really makes sense for the enum.

This change is better than what we have. So LGTM.

@danmoseley

Copy link
Copy Markdown
Contributor

/backport to release/9.1

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/9.1: https://github.com/dotnet/aspire/actions/runs/13449758642

@JamesNK

Copy link
Copy Markdown
Member

Mitch Denny (@mitchdenny) Is this PR still happening? What was the final outcome of bike shedding?

@mitchdenny

Copy link
Copy Markdown
Member Author

No just closed it and the backport. But this one is going in: #7728

@mitchdenny

Copy link
Copy Markdown
Member Author

Once it merges to main I backport I had a build failure and Dan make a suggestion so just doing a build loop again.

@mitchdenny
Mitch Denny (mitchdenny) deleted the mitchdenny/wait-behavior-enum-names branch March 5, 2025 03:31
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-testing Issues pertaining to the APIs in Aspire.Hosting.Testing Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants