Skip to content

Add failure label to "AutoBuilder - Failed" notifications for recent build failures#2093

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-autobuilder-issue-closing
Draft

Add failure label to "AutoBuilder - Failed" notifications for recent build failures#2093
Copilot wants to merge 2 commits intomainfrom
copilot/fix-autobuilder-issue-closing

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

NotificationService immediately closes any issue without the failure label. QueueBuildCommand only 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 the AppendIf condition from exception is not null to category == "Failed", which covers both failure paths (exceptions and recent build failures):
// Before
}.AppendIf(NotificationLabels.Failure, () => exception is not null),

// After
}.AppendIf(NotificationLabels.Failure, () => category == "Failed"),
  • QueueBuildCommandTests.cs: Added QueueBuildCommand_RecentFailedBuilds_IncludesFailureLabel test and a VerifyNotificationLabelsContain helper on TestContext.

…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
Copilot AI requested a review from lbussell April 20, 2026 18:28
@lbussell lbussell requested a review from Copilot May 7, 2026 23:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 QueueBuildCommand to add the failure label whenever the notification category is "Failed" (covers both exceptions and recent-failure throttling).
  • Add a new unit test asserting the failure label is included when builds are skipped due to too many recent failures.
  • Introduce a TestContext helper 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>>()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"AutoBuilder - Failed" issues should be left open

3 participants