mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-18 20:58:06 +00:00
Resolving Regression Bugs - File Bugs on regression_report
and properly reset state on duplicate. (#3263)
* Resolving Regression Bugs. * lint * Fixing type. * Remove log line. * Switchin to log error.
This commit is contained in:
committed by
GitHub
parent
2bb627c8a3
commit
e2b34a0dae
@ -20,12 +20,18 @@ public class Ado : NotificationsBase, IAdo {
|
||||
|
||||
public async Async.Task<OneFuzzResultVoid> NotifyAdo(AdoTemplate config, Container container, IReport reportable, bool isLastRetryAttempt, Guid notificationId) {
|
||||
var filename = reportable.FileName();
|
||||
if (reportable is RegressionReport) {
|
||||
_logTracer.LogInformation("ado integration does not support regression report. container:{Container} filename:{Filename}", container, filename);
|
||||
Report? report;
|
||||
if (reportable is RegressionReport regressionReport) {
|
||||
if (regressionReport.CrashTestResult.CrashReport is not null) {
|
||||
report = regressionReport.CrashTestResult.CrashReport;
|
||||
_logTracer.LogInformation("parsing regression report for ado integration. container:{Container} filename:{Filename}", container, filename);
|
||||
} else {
|
||||
_logTracer.LogError("ado integration does not support this regression report. container:{Container} filename:{Filename}", container, filename);
|
||||
return OneFuzzResultVoid.Ok;
|
||||
}
|
||||
|
||||
var report = (Report)reportable;
|
||||
} else {
|
||||
report = (Report)reportable;
|
||||
}
|
||||
|
||||
var notificationInfo = new List<(string, string)> {
|
||||
("notification_id", notificationId.ToString()),
|
||||
@ -321,7 +327,9 @@ public class Ado : NotificationsBase, IAdo {
|
||||
});
|
||||
}
|
||||
|
||||
var systemState = JsonSerializer.Serialize(item.Fields["System.State"]);
|
||||
// the below was causing on_duplicate not to work
|
||||
// var systemState = JsonSerializer.Serialize(item.Fields["System.State"]);
|
||||
var systemState = (string)item.Fields["System.State"];
|
||||
var stateUpdated = false;
|
||||
if (_config.OnDuplicate.SetState.TryGetValue(systemState, out var v)) {
|
||||
document.Add(new JsonPatchOperation() {
|
||||
|
@ -110,12 +110,16 @@ class JobHelper:
|
||||
if not config:
|
||||
return
|
||||
|
||||
container: Optional[str] = None
|
||||
containers: List[Container] = []
|
||||
if ContainerType.unique_reports in self.containers:
|
||||
container = self.containers[ContainerType.unique_reports]
|
||||
containers.append(self.containers[ContainerType.unique_reports])
|
||||
else:
|
||||
container = self.containers[ContainerType.reports]
|
||||
containers.append(self.containers[ContainerType.reports])
|
||||
|
||||
if ContainerType.regression_reports in self.containers:
|
||||
containers.append(self.containers[ContainerType.regression_reports])
|
||||
|
||||
for container in containers:
|
||||
self.logger.info("creating notification config for %s", container)
|
||||
self.onefuzz.notifications.create(container, config, replace_existing=True)
|
||||
|
||||
|
Reference in New Issue
Block a user