Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 445150a

Browse files
committed
In authenticate exceptions, include the identity that the WI would have been assigned to
1 parent 2bff511 commit 445150a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/ApiService/ApiService/onefuzzlib/NotificationOperations.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public interface INotificationOperations : IOrm<Notification> {
99
IAsyncEnumerable<Notification> GetNotifications(Container container);
1010
IAsyncEnumerable<(Task, IEnumerable<Container>)> GetQueueTasks();
1111
Async.Task<OneFuzzResult<Notification>> Create(Container container, NotificationTemplate config, bool replaceExisting);
12+
Async.Task<Notification> GetNotification(Guid notifificationId);
1213
}
1314

1415
public class NotificationOperations : Orm<Notification>, INotificationOperations {
@@ -142,4 +143,8 @@ private async Async.Task<NotificationTemplate> HideSecrets(NotificationTemplate
142143
_logTracer.Error($"unable to find crash_report or no repro entry for report: {JsonSerializer.Serialize(report)}");
143144
return null;
144145
}
146+
147+
public async Async.Task<Notification> GetNotification(Guid notifificationId) {
148+
return await SearchByPartitionKeys(new[] { notifificationId.ToString() }).SingleAsync();
149+
}
145150
}

src/ApiService/ApiService/onefuzzlib/notifications/Ado.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public async Async.Task NotifyAdo(AdoTemplate config, Container container, strin
3333
await ado.Process(notificationInfo);
3434
} catch (Exception e)
3535
when (e is VssAuthenticationException || e is VssServiceException) {
36+
var _ = config.AdoFields.TryGetValue("System.AssignedTo", out var assignedTo);
37+
if (e is VssAuthenticationException && !string.IsNullOrEmpty(assignedTo)) {
38+
notificationInfo = notificationInfo.AddRange(new (string, string)[] { ("assigned_to", assignedTo) });
39+
}
40+
3641
if (!isLastRetryAttempt && IsTransient(e)) {
3742
_logTracer.WithTags(notificationInfo).Error($"transient ADO notification failure {report.JobId:Tag:JobId} {report.TaskId:Tag:TaskId} {container:Tag:Container} {filename:Tag:Filename}");
3843
throw;

0 commit comments

Comments
 (0)