From ec2ef903ab517087297adff189b153234fefa82c Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Fri, 8 Mar 2024 23:28:49 +0000 Subject: [PATCH] use .#hydraJobs rather than .#checks --- buildbot_nix/__init__.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/buildbot_nix/__init__.py b/buildbot_nix/__init__.py index 4d864ce..2f50695 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -91,11 +91,11 @@ class BuildTrigger(Trigger): for job in self.jobs: attr = job.get("attr", "eval-error") name = attr - name = f"checks.{name}" + name = f"hydraJobs.{name}" error = job.get("error") props = Properties() 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) if error is not None: @@ -153,7 +153,7 @@ class NixEvalCommand(buildstep.ShellMixin, steps.BuildStep): @defer.inlineCallbacks 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() yield self.runCommand(cmd) @@ -341,7 +341,7 @@ def nix_eval_config( "--force-recurse", "--check-cache-status", "--flake", - ".#checks", + ".#hydraJobs", ], haltOnFailure=True, locks=[eval_lock.access("exclusive")], @@ -614,17 +614,21 @@ def gerritReviewCB(builderName, build, result, master, arg): continue for url in step['urls']: - if url['name'].startswith('success: checks.'): + if url['name'].startswith('success: hydraJobs.'): path = url['name'].split(' ')[1] all_checks[path] = (True, url['url']) - elif url['name'].startswith('failure: checks.'): + 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] - os = arch.split('-')[1] + 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