Declarative jobsets: move event handling to a plugin

[?]
Aug 12, 2021, 2:42 PM
TNS4QKM4D6IDN6BGS55WGJN5J3ELUVYXNS753SX62ZLVHDL34NLAC

Dependencies

  • [2] 32KJOERM Turn hydra-notify into a daemon
  • [3] AWPYSGP6 hydra-notify: Don't do an unnecessary fetch of Jobsets
  • [4] FCTX433O Add buildStarted plugin hook
  • [5] 6WRGCITD Enable declarative projects.
  • [6] NTEDD7T4 Provide a plugin hook for when build steps finish
  • [7] IE2PRAQU hydra-queue-runner: Send build notifications
  • [*] 5EQYVRWE Add a plugin mechanism

Change contents

  • file addition: DeclarativeJobsets.pm (----------)
    [9.1]
    package Hydra::Plugin::DeclarativeJobsets;
    use strict;
    use parent 'Hydra::Plugin';
    use Hydra::Helper::AddBuilds;
    sub buildFinished {
    my ($self, $build, $dependents) = @_;
    my $project = $build->project;
    my $jobsetName = $build->get_column('jobset');
    if (length($project->declfile) && $jobsetName eq ".jobsets" && $build->iscurrent) {
    handleDeclarativeJobsetBuild($self->{"db"}, $project, $build);
    }
    }
    1;
  • edit in src/script/hydra-notify at line 51
    [2.1971][2.1971:1972](),[2.1972][4.5667:5702](),[4.1823][4.5667:5702](),[4.5702][3.0:139](),[3.139][4.5825:5892](),[4.5825][4.5825:5892]()
    my $project = $build->project;
    my $jobsetName = $build->get_column('jobset');
    if (length($project->declfile) && $jobsetName eq ".jobsets" && $build->iscurrent) {
    handleDeclarativeJobsetBuild($db, $project, $build);
    }