Don't use given/when

[?]
Dec 12, 2014, 10:27 AM
MRJCQ4EO525TGAZFHIHPXH3WHNH3BFPEO2XBZTJ7EJJZHNP7EV5AC

Dependencies

  • [2] RPTSGIRC Eliminate duplicate getPreviousBuild functions
  • [3] Z52T2BC4 Support passing a jobset evaluation as an input
  • [4] THUMRES3 hydra: add Coverity Scan plugin
  • [5] N22GPKYT * Put info about logs / build products in the DB.
  • [6] PCKLFRT5 Support push notification of repository changes
  • [7] 7DWCXNC7 Use the new Nix Perl bindings
  • [8] T4LLYESZ * Nix expression for building Hydra.
  • [9] AKRVETP5 Handle UTF-8 characters in eval error messages
  • [10] 2WUNXJGW Hydra/26: Go back to using "svn export" as default for svn, added svn-checkout type for jobset which need .svn dirs. export is much more efficient
  • [11] WVX47J4E properly pass bazaar inputs
  • [12] 3XTHEUMP * Implemented the clone feature.
  • [13] LBNVQXUB * Build the /build stuff in a separate controller.
  • [14] 7UJ5YV4V * Provide a channel for each project containing all the latest
  • [15] FV2M6MOT hydra: use autoconf/-make
  • [16] JZE7DC2F Whitespace
  • [17] YFPZ46YK * hydra: added variant of build input type, 'build output (same system)' to allow better continous integration in one jobset for multiple system. it makes sure that the system of the build that is passed as input for a job has the same system as the job.
  • [18] QMW24O5S Add support for Guile & Guix.
  • [19] JTRG7RDQ add support for git as jobinput
  • [20] POPU2ATH * hydra_scheduler: use eval-jobs.
  • [21] IMQRX4MP hydra-eval-jobs: Use JSON instead of XML
  • [22] CS7T2XFI
  • [23] O25D52TA initial support for mercurial
  • [24] JAH3UPWA Support revision control systems via plugins
  • [25] SM5M2J3A Pass inputs to release expressions using -I
  • [26] R4MHON3O pass svn/bzr revisions as integers
  • [27] OOQ2D3KC * Refactoring: move fetchInput out of hydra_scheduler into a separate
  • [28] L4AI5YL6 Rename hydra_*.pl to hydra-*
  • [29] PGSSRA7C Add an input type "nix" for passing arbitrary Nix expressions

Change contents

  • edit in src/lib/Hydra/Helper/AddBuilds.pm at line 4
    [5.2711][5.1250:1272]()
    use feature 'switch';
  • replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 294
    [5.1521][5.1521:1709](),[5.1709][5.2144:2235](),[5.2235][5.1772:1790](),[5.1772][5.1772:1790](),[5.1790][5.87:118](),[5.118][3.3043:3156](),[3.3156][5.118:181](),[5.118][5.118:181](),[5.181][3.3157:3642](),[3.3642][5.181:199](),[5.181][5.181:199](),[5.199][5.1475:1501](),[5.1790][5.1475:1501](),[5.1501][5.2236:2321](),[5.68][5.2236:2321](),[5.423][5.423:441](),[5.441][5.2245:2259](),[5.2245][5.2245:2259]()
    given ($alt->{type}) {
    when ("string") {
    push @res, "--argstr", $input, $alt->{value};
    }
    when ("boolean") {
    push @res, "--arg", $input, booleanToString($exprType, $alt->{value});
    }
    when ("nix") {
    die "input type ‘nix’ only supported for Nix-based jobsets\n" unless $exprType eq "nix";
    push @res, "--arg", $input, $alt->{value};
    }
    when ("eval") {
    die "input type ‘eval’ only supported for Nix-based jobsets\n" unless $exprType eq "nix";
    my $s = "{ ";
    # FIXME: escape $_. But dots should not be escaped.
    $s .= "$_ = builtins.storePath ${\$alt->{jobs}->{$_}}; "
    foreach keys %{$alt->{jobs}};
    $s .= "}";
    push @res, "--arg", $input, $s;
    }
    default {
    push @res, "--arg", $input, buildInputToString($exprType, $alt);
    }
    }
    [5.1521]
    [5.2259]
    if ($alt->{type} eq "string") {
    push @res, "--argstr", $input, $alt->{value};
    }
    elsif ($alt->{type} eq "boolean") {
    push @res, "--arg", $input, booleanToString($exprType, $alt->{value});
    }
    elsif ($alt->{type} eq "nix") {
    die "input type ‘nix’ only supported for Nix-based jobsets\n" unless $exprType eq "nix";
    push @res, "--arg", $input, $alt->{value};
    }
    elsif ($alt->{type} eq "eval") {
    die "input type ‘eval’ only supported for Nix-based jobsets\n" unless $exprType eq "nix";
    my $s = "{ ";
    # FIXME: escape $_. But dots should not be escaped.
    $s .= "$_ = builtins.storePath ${\$alt->{jobs}->{$_}}; "
    foreach keys %{$alt->{jobs}};
    $s .= "}";
    push @res, "--arg", $input, $s;
    }
    else {
    push @res, "--arg", $input, buildInputToString($exprType, $alt);
    }
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 9
    [5.561][2.68:92]()
    use feature qw/switch/;
  • replacement in src/lib/Hydra/Helper/CatalystUtils.pm at line 240
    [2.527][2.527:799]()
    given ($build->buildstatus) {
    when (0) { $status = "Success"; }
    when (1) { $status = "Failed"; }
    when (2) { $status = "Dependency failed"; }
    when (4) { $status = "Cancelled"; }
    when (6) { $status = "Failed with output"; }
    }
    [2.527]
    [2.799]
    if ($build->buildstatus == 0) { $status = "Success"; }
    elsif ($build->buildstatus == 1) { $status = "Failed"; }
    elsif ($build->buildstatus == 2) { $status = "Dependency failed"; }
    elsif ($build->buildstatus == 4) { $status = "Cancelled"; }
    elsif ($build->buildstatus == 6) { $status = "Failed with output"; }
  • replacement in src/lib/Hydra/Helper/CatalystUtils.pm at line 246
    [2.800][2.800:819]()
    return $status;
    [2.800]
    [5.1814]
    return $status;
  • edit in src/lib/Hydra/Plugin/CoverityScan.pm at line 4
    [4.52][4.52:74]()
    use feature 'switch';
  • replacement in src/lib/Hydra/Plugin/CoverityScan.pm at line 65
    [4.2044][4.2044:2435]()
    given ($ext) {
    when ('.xz') { $mimetype = "application/x-xz"; }
    when ('.lzma') { $mimetype = "application/x-xz"; }
    when ('.zip') { $mimetype = "application/zip"; }
    when ('.bz2') { $mimetype = "application/x-bzip2"; }
    when ('.tgz') { $mimetype = "application/x-gzip"; }
    default { die "couldn't parse extension of $covTarball"; }
    }
    [4.2044]
    [4.2435]
    if ($ext eq '.xz') { $mimetype = "application/x-xz"; }
    elsif ($ext eq '.lzma') { $mimetype = "application/x-xz"; }
    elsif ($ext eq '.zip') { $mimetype = "application/zip"; }
    elsif ($ext eq '.bz2') { $mimetype = "application/x-bzip2"; }
    elsif ($ext eq '.tgz') { $mimetype = "application/x-gzip"; }
    else { die "couldn't parse extension of $covTarball"; }
  • edit in src/script/hydra-evaluator at line 4
    [5.1346][5.267:289]()
    use feature 'switch';