From 244300c1ade190b1b08799ed43354b479d4e54c9 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Tue, 25 Jan 2022 12:10:43 -0800 Subject: [PATCH] RunCommand: remove unused and problematic imports Since breaking the filename construction out to a helper function, Hydra::Model::DB is no longer used. Importing Hydra::Helper::Nix, however, has the potential to break tests, so just use the functions we need without importing the entire module. --- src/lib/Hydra/Plugin/RunCommand.pm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/Hydra/Plugin/RunCommand.pm b/src/lib/Hydra/Plugin/RunCommand.pm index d1ce8f55..94ed5a25 100644 --- a/src/lib/Hydra/Plugin/RunCommand.pm +++ b/src/lib/Hydra/Plugin/RunCommand.pm @@ -5,9 +5,6 @@ use warnings; use parent 'Hydra::Plugin'; use experimental 'smartmatch'; use JSON::MaybeXS; -use Digest::SHA1 qw(sha1_hex); -use Hydra::Model::DB; -use Hydra::Helper::Nix; use File::Basename qw(dirname); use File::Path qw(make_path); use IPC::Run3; @@ -166,8 +163,8 @@ sub buildFinished { $runlog->started(); - my $filename = constructRunCommandLogFilename(sha1_hex($command), $build->get_column('id')); - my $logPath = constructRunCommandLogPath($filename); + my $filename = Hydra::Helper::Nix::constructRunCommandLogFilename(sha1_hex($command), $build->get_column('id')); + my $logPath = Hydra::Helper::Nix::constructRunCommandLogPath($filename); my $dir = dirname($logPath); my $oldUmask = umask();