better gerrit integration #5
|
@ -173,7 +173,7 @@ class BuildTrigger(steps.BuildStep):
|
||||||
|
|
||||||
done = []
|
done = []
|
||||||
scheduled = []
|
scheduled = []
|
||||||
failed = []
|
failed = {}
|
||||||
all_results = SUCCESS
|
all_results = SUCCESS
|
||||||
ss_for_trigger = self.prepareSourcestampListForTrigger()
|
ss_for_trigger = self.prepareSourcestampListForTrigger()
|
||||||
while not self.ended and (len(build_schedule_order) > 0 or len(scheduled) > 0):
|
while not self.ended and (len(build_schedule_order) > 0 or len(scheduled) > 0):
|
||||||
|
@ -234,10 +234,15 @@ class BuildTrigger(steps.BuildStep):
|
||||||
failed_paths.append(build.get("drvPath"))
|
failed_paths.append(build.get("drvPath"))
|
||||||
build_schedule_order.remove(build)
|
build_schedule_order.remove(build)
|
||||||
removed.append(build.get("attr"))
|
removed.append(build.get("attr"))
|
||||||
|
failed[build.get("attr")] = (f"dependency {job.get('attr')} failed", [])
|
||||||
|
|
||||||
break
|
break
|
||||||
if old_paths == failed_paths:
|
if old_paths == failed_paths:
|
||||||
break
|
break
|
||||||
|
failed[job.get("attr")] = (
|
||||||
|
"failed",
|
||||||
|
[ getURLForBuildrequest(self.master, brid) for brid in brids.values() ]
|
||||||
|
)
|
||||||
print(' Removed jobs: ' + ', '.join(removed))
|
print(' Removed jobs: ' + ', '.join(removed))
|
||||||
all_results = worst_status(result, all_results)
|
all_results = worst_status(result, all_results)
|
||||||
print(f' New result: {util.Results[all_results].upper()}')
|
print(f' New result: {util.Results[all_results].upper()}')
|
||||||
|
@ -245,6 +250,7 @@ class BuildTrigger(steps.BuildStep):
|
||||||
if job.get("drvPath") in self.all_deps[dep]:
|
if job.get("drvPath") in self.all_deps[dep]:
|
||||||
self.all_deps[dep].remove(job.get("drvPath"))
|
self.all_deps[dep].remove(job.get("drvPath"))
|
||||||
print('Done!')
|
print('Done!')
|
||||||
|
build_props.setProperty("failed_builds", failed, "nix-eval-lix")
|
||||||
if self.ended:
|
if self.ended:
|
||||||
return util.CANCELLED
|
return util.CANCELLED
|
||||||
return all_results
|
return all_results
|
||||||
|
@ -647,62 +653,22 @@ def gerritReviewCB(builderName, build, result, master, arg):
|
||||||
if builderName != 'lix/nix-eval':
|
if builderName != 'lix/nix-eval':
|
||||||
return dict()
|
return dict()
|
||||||
|
|
||||||
all_checks = {}
|
failed = build['properties'].get('failed_builds', [{}])[0]
|
||||||
for step in build['steps']:
|
|
||||||
if step['name'] != 'build flake':
|
|
||||||
continue
|
|
||||||
|
|
||||||
for url in step['urls']:
|
labels = {
|
||||||
if url['name'].startswith('success: hydraJobs.'):
|
'Verified': -1 if failed else 1,
|
||||||
path = url['name'].split(' ')[1]
|
}
|
||||||
all_checks[path] = (True, url['url'])
|
|
||||||
elif url['name'].startswith('failure: hydraJobs.'):
|
|
||||||
path = url['name'].split(' ')[1]
|
|
||||||
all_checks[path] = (False, url['url'])
|
|
||||||
|
|
||||||
collected_oses = {}
|
|
||||||
for check in all_checks:
|
|
||||||
arch = check.split('.')[-1]
|
|
||||||
if not arch.endswith('-linux') and not arch.endswith('-darwin'):
|
|
||||||
# Not an architecture-specific job, just a test
|
|
||||||
os = "test"
|
|
||||||
else:
|
|
||||||
os = arch.split('-')[1]
|
|
||||||
(success, failure) = collected_oses.get(os, (0, 0))
|
|
||||||
if all_checks[check][0]:
|
|
||||||
success += 1
|
|
||||||
else:
|
|
||||||
failure += 1
|
|
||||||
|
|
||||||
collected_oses[os] = (success, failure)
|
|
||||||
labels = {}
|
|
||||||
|
|
||||||
if 'linux' in collected_oses:
|
|
||||||
(success, failure) = collected_oses['linux']
|
|
||||||
if success > 0 and failure == 0:
|
|
||||||
labels['Verified-On-Linux'] = 1
|
|
||||||
elif failure > 0:
|
|
||||||
labels['Verified-On-Linux'] = -1
|
|
||||||
|
|
||||||
if 'darwin' in collected_oses:
|
|
||||||
(success, failure) = collected_oses['darwin']
|
|
||||||
if success > 0 and failure == 0:
|
|
||||||
labels['Verified-On-Darwin'] = 1
|
|
||||||
elif failure > 0:
|
|
||||||
labels['Verified-On-Darwin'] = -1
|
|
||||||
|
|
||||||
message = "Buildbot finished compiling your patchset!\n"
|
message = "Buildbot finished compiling your patchset!\n"
|
||||||
message += "The result is: %s\n" % util.Results[result].upper()
|
message += "The result is: %s\n" % util.Results[result].upper()
|
||||||
if result != util.SUCCESS:
|
if result != util.SUCCESS:
|
||||||
successful_checks = []
|
message += "\nFailed checks:\n"
|
||||||
failed_checks = []
|
for check, context in sorted(failed.items()):
|
||||||
for check in all_checks:
|
how, urls = context
|
||||||
if not all_checks[check][0]:
|
message += f" - {check}: {how}"
|
||||||
failed_checks.append(f" - {check} (see {all_checks[check][1]})")
|
if urls:
|
||||||
|
message += f" (see {', '.join(urls)})"
|
||||||
if len(failed_checks) > 0:
|
message += "\n"
|
||||||
message += "Failed checks:\n" + "\n".join(failed_checks) + "\n"
|
|
||||||
|
|
||||||
|
|
||||||
if arg:
|
if arg:
|
||||||
message += "\nFor more details visit:\n"
|
message += "\nFor more details visit:\n"
|
||||||
|
|
Loading…
Reference in a new issue