Fix Github status plugin for flakes

[?]
Feb 5, 2021, 11:02 PM
6XZA5RB6BSKGDOK7DM4BFIMVZ46NY6IETDORSRISGZAVR2ZEK4PAC

Dependencies

  • [2] YH2ITHUE [DEVOPS-1126] throttle github status calls to remain under api ratelimits
  • [3] 7LD275CW allow using a shorter context and increase hydra-notify debug
  • [4] 5K2OOGOQ Github status API: Pull authorization from github_authorization by default
  • [5] NSRWW6LC Add a plugin to interact with the github status API.
  • [6] WIM6VQOH GithubStatus: Include the full job name and build ID in the context.

Change contents

  • replacement in src/lib/Hydra/Plugin/GithubStatus.pm at line 60
    [4.1651][4.1651:2022]()
    foreach my $input (@inputs) {
    my $i = $eval->jobsetevalinputs->find({ name => $input, altnr => 0 });
    next unless defined $i;
    my $uri = $i->uri;
    my $rev = $i->revision;
    my $key = $uri . "-" . $rev;
    next if exists $seen{$input}->{$key};
    [4.1651]
    [4.2022]
    my $sendStatus = sub {
    my ($input, $owner, $repo, $rev) = @_;
    my $key = $owner . "-" . $repo . "-" . $rev;
    return if exists $seen{$input}->{$key};
  • replacement in src/lib/Hydra/Plugin/GithubStatus.pm at line 67
    [4.2069][4.2069:2132](),[4.2132][4.0:71]()
    $uri =~ m![:/]([^/]+)/([^/]+?)(?:.git)?$!;
    my $owner = $1;
    my $repo = $2;
    [4.2069]
    [3.569]
  • edit in src/lib/Hydra/Plugin/GithubStatus.pm at line 90
    [2.864]
    [2.864]
    }
    };
    if (defined $eval->flake) {
    my $fl = $eval->flake;
    print STDERR "Flake is $fl\n";
    $eval->flake =~ m!github:([^/]+)/([^/]+)/(.+)$!;
    $sendStatus->("src", $1, $2, $3);
    } else {
    foreach my $input (@inputs) {
    my $i = $eval->jobsetevalinputs->find({ name => $input, altnr => 0 });
    if (! defined $i) {
    print STDERR "Evaluation $eval doesn't have input $input\n";
    }
    next unless defined $i;
    my $uri = $i->uri;
    my $rev = $i->revision;
    $uri =~ m![:/]([^/]+)/([^/]+?)(?:.git)?$!;
    $sendStatus->($input, $1, $2, $rev);