Add failure label to "AutoBuilder - Failed" notifications for recent build failures#2093
Draft
Add failure label to "AutoBuilder - Failed" notifications for recent build failures#2093
Conversation
…ild failures The failure label was only added when an exception was thrown, not when the category was 'Failed' due to recent build failures. This caused these actionable issues to be immediately closed by NotificationService. Change the condition from `exception is not null` to `category == "Failed"` so both failure paths (exception and recent failed builds) get the failure label and remain open. Agent-Logs-Url: https://github.com/dotnet/docker-tools/sessions/89cbb121-4c87-422e-83ec-09a65bd377c6 Co-authored-by: lbussell <36081148+lbussell@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix NotificationService to leave 'AutoBuilder - Failed' issues open
Add failure label to "AutoBuilder - Failed" notifications for recent build failures
Apr 20, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes notification triage for AutoBuilder failures by ensuring GitHub issues created for “AutoBuilder - Failed” states consistently include the failure label, preventing NotificationService from auto-closing them.
Changes:
- Update
QueueBuildCommandto add thefailurelabel whenever the notification category is"Failed"(covers both exceptions and recent-failure throttling). - Add a new unit test asserting the
failurelabel is included when builds are skipped due to too many recent failures. - Introduce a
TestContexthelper to verify notification labels.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/ImageBuilder/Commands/QueueBuildCommand.cs | Adjusts failure-label assignment logic to align with the "Failed" notification category. |
| src/ImageBuilder.Tests/QueueBuildCommandTests.cs | Adds coverage for recent-failure throttling notifications including the failure label, plus a label-verification helper. |
| NotificationLabels.AutoBuilder, | ||
| NotificationLabels.GetRepoLocationLabel(subscription.Manifest.Repo, subscription.Manifest.Branch) | ||
| }.AppendIf(NotificationLabels.Failure, () => exception is not null), | ||
| }.AppendIf(NotificationLabels.Failure, () => category == "Failed"), |
Comment on lines
+643
to
+647
| It.IsAny<string>(), | ||
| It.IsAny<string>(), | ||
| It.IsAny<GitHubAuthOptions>(), | ||
| It.IsAny<bool>(), | ||
| It.IsAny<IEnumerable<string>>())); |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
NotificationServiceimmediately closes any issue without thefailurelabel.QueueBuildCommandonly added this label on exceptions, not when the category was "Failed" due to recent build failures — so "AutoBuilder - Failed" issues were created and immediately closed.Changes
QueueBuildCommand.cs: Changed theAppendIfcondition fromexception is not nulltocategory == "Failed", which covers both failure paths (exceptions and recent build failures):QueueBuildCommandTests.cs: AddedQueueBuildCommand_RecentFailedBuilds_IncludesFailureLabeltest and aVerifyNotificationLabelsContainhelper onTestContext.