feat: support Gerrit in Buildbot #1
|
@ -91,11 +91,11 @@ class BuildTrigger(Trigger):
|
||||||
for job in self.jobs:
|
for job in self.jobs:
|
||||||
attr = job.get("attr", "eval-error")
|
attr = job.get("attr", "eval-error")
|
||||||
name = attr
|
name = attr
|
||||||
name = f"checks.{name}"
|
name = f"hydraJobs.{name}"
|
||||||
error = job.get("error")
|
error = job.get("error")
|
||||||
props = Properties()
|
props = Properties()
|
||||||
props.setProperty("virtual_builder_name", name, source)
|
props.setProperty("virtual_builder_name", name, source)
|
||||||
props.setProperty("status_name", f"nix-build .#checks.{attr}", source)
|
props.setProperty("status_name", f"nix-build .#hydraJobs.{attr}", source)
|
||||||
props.setProperty("virtual_builder_tags", "", source)
|
props.setProperty("virtual_builder_tags", "", source)
|
||||||
|
|
||||||
if error is not None:
|
if error is not None:
|
||||||
|
@ -153,7 +153,7 @@ class NixEvalCommand(buildstep.ShellMixin, steps.BuildStep):
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def run(self) -> Generator[Any, object, Any]:
|
def run(self) -> Generator[Any, object, Any]:
|
||||||
# run nix-eval-jobs --flake .#checks to generate the dict of stages
|
# run nix-eval-jobs --flake .#hydraJobs to generate the dict of stages
|
||||||
cmd: remotecommand.RemoteCommand = yield self.makeRemoteShellCommand()
|
cmd: remotecommand.RemoteCommand = yield self.makeRemoteShellCommand()
|
||||||
yield self.runCommand(cmd)
|
yield self.runCommand(cmd)
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ def nix_eval_config(
|
||||||
"--force-recurse",
|
"--force-recurse",
|
||||||
"--check-cache-status",
|
"--check-cache-status",
|
||||||
"--flake",
|
"--flake",
|
||||||
".#checks",
|
".#hydraJobs",
|
||||||
],
|
],
|
||||||
haltOnFailure=True,
|
haltOnFailure=True,
|
||||||
locks=[eval_lock.access("exclusive")],
|
locks=[eval_lock.access("exclusive")],
|
||||||
|
@ -614,17 +614,21 @@ def gerritReviewCB(builderName, build, result, master, arg):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for url in step['urls']:
|
for url in step['urls']:
|
||||||
if url['name'].startswith('success: checks.'):
|
if url['name'].startswith('success: hydraJobs.'):
|
||||||
path = url['name'].split(' ')[1]
|
path = url['name'].split(' ')[1]
|
||||||
all_checks[path] = (True, url['url'])
|
all_checks[path] = (True, url['url'])
|
||||||
elif url['name'].startswith('failure: checks.'):
|
elif url['name'].startswith('failure: hydraJobs.'):
|
||||||
path = url['name'].split(' ')[1]
|
path = url['name'].split(' ')[1]
|
||||||
all_checks[path] = (False, url['url'])
|
all_checks[path] = (False, url['url'])
|
||||||
|
|
||||||
collected_oses = {}
|
collected_oses = {}
|
||||||
for check in all_checks:
|
for check in all_checks:
|
||||||
arch = check.split('.')[1]
|
arch = check.split('.')[-1]
|
||||||
os = arch.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))
|
(success, failure) = collected_oses.get(os, (0, 0))
|
||||||
if all_checks[check][0]:
|
if all_checks[check][0]:
|
||||||
success += 1
|
success += 1
|
||||||
|
|
Loading…
Reference in a new issue