From d311a0d002802f9c68823fa7935cbf0394f5c745 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 Aug 2021 15:51:51 -0400 Subject: [PATCH 1/4] hydraJobs.tests.notifications: fixup file reference --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 25aaa1aa..9ee5b87e 100644 --- a/flake.nix +++ b/flake.nix @@ -554,7 +554,7 @@ su - hydra -c "hydra-create-user root --email-address 'alice@example.org' --password foobar --role admin" mkdir /run/jobset chmod 755 /run/jobset - cp ${./t/api-test.nix} /run/jobset/default.nix + cp ${./t/jobs/api-test.nix} /run/jobset/default.nix chmod 644 /run/jobset/default.nix chown -R hydra /run/jobset """ From e572a5e576dd0bf9629803a29c632b71cb401e93 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 Aug 2021 15:52:14 -0400 Subject: [PATCH 2/4] hydra-notify: use Hydra::Event --- src/script/hydra-notify | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/script/hydra-notify b/src/script/hydra-notify index 2c323b7f..b8138bfc 100755 --- a/src/script/hydra-notify +++ b/src/script/hydra-notify @@ -2,12 +2,13 @@ use strict; use utf8; +use Getopt::Long; +use Hydra::Event; use Hydra::Event::BuildFinished; use Hydra::Helper::AddBuilds; use Hydra::Helper::Nix; use Hydra::Plugin; use Hydra::PostgresListener; -use Getopt::Long; STDERR->autoflush(1); STDOUT->autoflush(1); From 2c502270826ec4e26c7eafae74150cb47d961a89 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 Aug 2021 15:52:25 -0400 Subject: [PATCH 3/4] hydra-notify: properly call new_event --- src/script/hydra-notify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/hydra-notify b/src/script/hydra-notify index b8138bfc..a8f48252 100755 --- a/src/script/hydra-notify +++ b/src/script/hydra-notify @@ -68,7 +68,7 @@ while (!$queued_only) { my $payload = $message->{"payload"}; eval { - my $event = Hydra::Event::new_event($channelName, $message->{"payload"}); + my $event = Hydra::Event->new_event($channelName, $message->{"payload"}); runPluginsForEvent($event); 1; From 6e65c3b3206b0f2c8d15b9f75905718849b89483 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 Aug 2021 16:05:08 -0400 Subject: [PATCH 4/4] hydra-notify: fixup printing of build IDs Used to print: sending notifications for build Hydra::Model::DB::Builds=HASH(0x124cf960)->id... Now it prints: sending notifications for build 123... --- src/script/hydra-notify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/hydra-notify b/src/script/hydra-notify index a8f48252..181fba36 100755 --- a/src/script/hydra-notify +++ b/src/script/hydra-notify @@ -50,7 +50,7 @@ sub runPluginsForEvent { for my $build ($db->resultset('Builds')->search( { notificationpendingsince => { '!=', undef } })) { - print STDERR "sending notifications for build $build->id...\n"; + print STDERR "sending notifications for build ${\$build->id}...\n"; my $event = Hydra::Event::BuildFinished->new($build->id);