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,13 +20,19 @@ public class Ado : NotificationsBase, IAdo {
|
|||||||
|
|
||||||
public async Async.Task<OneFuzzResultVoid> NotifyAdo(AdoTemplate config, Container container, IReport reportable, bool isLastRetryAttempt, Guid notificationId) {
|
public async Async.Task<OneFuzzResultVoid> NotifyAdo(AdoTemplate config, Container container, IReport reportable, bool isLastRetryAttempt, Guid notificationId) {
|
||||||
var filename = reportable.FileName();
|
var filename = reportable.FileName();
|
||||||
if (reportable is RegressionReport) {
|
Report? report;
|
||||||
_logTracer.LogInformation("ado integration does not support regression report. container:{Container} filename:{Filename}", container, filename);
|
if (reportable is RegressionReport regressionReport) {
|
||||||
return OneFuzzResultVoid.Ok;
|
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;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
report = (Report)reportable;
|
||||||
}
|
}
|
||||||
|
|
||||||
var report = (Report)reportable;
|
|
||||||
|
|
||||||
var notificationInfo = new List<(string, string)> {
|
var notificationInfo = new List<(string, string)> {
|
||||||
("notification_id", notificationId.ToString()),
|
("notification_id", notificationId.ToString()),
|
||||||
("job_id", report.JobId.ToString()),
|
("job_id", report.JobId.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;
|
var stateUpdated = false;
|
||||||
if (_config.OnDuplicate.SetState.TryGetValue(systemState, out var v)) {
|
if (_config.OnDuplicate.SetState.TryGetValue(systemState, out var v)) {
|
||||||
document.Add(new JsonPatchOperation() {
|
document.Add(new JsonPatchOperation() {
|
||||||
|
@ -110,14 +110,18 @@ class JobHelper:
|
|||||||
if not config:
|
if not config:
|
||||||
return
|
return
|
||||||
|
|
||||||
container: Optional[str] = None
|
containers: List[Container] = []
|
||||||
if ContainerType.unique_reports in self.containers:
|
if ContainerType.unique_reports in self.containers:
|
||||||
container = self.containers[ContainerType.unique_reports]
|
containers.append(self.containers[ContainerType.unique_reports])
|
||||||
else:
|
else:
|
||||||
container = self.containers[ContainerType.reports]
|
containers.append(self.containers[ContainerType.reports])
|
||||||
|
|
||||||
self.logger.info("creating notification config for %s", container)
|
if ContainerType.regression_reports in self.containers:
|
||||||
self.onefuzz.notifications.create(container, config, replace_existing=True)
|
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)
|
||||||
|
|
||||||
def upload_setup(
|
def upload_setup(
|
||||||
self,
|
self,
|
||||||
|
Reference in New Issue
Block a user