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:
Noah McGregor Harper
2023-07-05 14:57:01 -07:00
committed by GitHub
parent 2bb627c8a3
commit e2b34a0dae
2 changed files with 23 additions and 11 deletions

View File

@ -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) {
var filename = reportable.FileName();
if (reportable is RegressionReport) {
_logTracer.LogInformation("ado integration does not support regression report. container:{Container} filename:{Filename}", container, filename);
return OneFuzzResultVoid.Ok;
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;
}
} else {
report = (Report)reportable;
}
var report = (Report)reportable;
var notificationInfo = new List<(string, string)> {
("notification_id", notificationId.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;
if (_config.OnDuplicate.SetState.TryGetValue(systemState, out var v)) {
document.Add(new JsonPatchOperation() {

View File

@ -110,14 +110,18 @@ 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])
self.logger.info("creating notification config for %s", container)
self.onefuzz.notifications.create(container, config, replace_existing=True)
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)
def upload_setup(
self,