Return 410 Gone (rather than 500) if an output is no longer available

[?]
Feb 26, 2014, 10:38 AM
MNKXBLNCAGESRG3AUMII3F5NPPMOYKXJCKZNNAVHIBDA6Z6ZPHUAC

Dependencies

  • [2] 45A23NZP Add an action to download a specific output of a build as a .nar.bz2
  • [3] LYVUXIGT Clean up the authorization code a bit
  • [4] 2CZSW5S5 Don't redirect to /login if authentication is required
  • [5] W3HI52QV use NIX_*_DIR env vars when defined
  • [6] XE6HD7BP Provide the nix-cache-info file required by the binary cache substituter
  • [7] XHVZXX6N
  • [8] CS7T2XFI
  • [9] HXBXDEFK Speed up channel processing
  • [10] XJFHFZCA * Provide some redirects to build products by type so that we can for
  • [11] MT5HGXFP Hydra/62 fix, broken nar download
  • [12] MVB7RRLT * Move NARs from the NixChannel controller to the Root controller and
  • [13] PMNWRTGJ Add multiple output support
  • [14] FPK5LF53 * Put the project-related actions in a separate controller. Put the
  • [15] SSMN5MPT Remove dead code
  • [16] J5UVLXOK * Start of a basic Catalyst web interface.
  • [17] UXVDOUBJ
  • [*] 5NO7NCKT * Refactoring.
  • [*] LBNVQXUB * Build the /build stuff in a separate controller.

Change contents

  • replacement in src/lib/Hydra/Base/Controller/NixChannel.pm at line 87
    [5.133][5.1430:1513](),[5.1513][5.1840:1973](),[5.1840][5.1840:1973]()
    unless (all { isValidPath($_->path) } $c->stash->{build}->buildoutputs->all) {
    $c->response->status(410); # "Gone"
    error($c, "Build " . $c->stash->{build}->id . " is no longer available.");
    }
    [5.133]
    [5.0]
    gone($c, "Build " . $c->stash->{build}->id . " is no longer available.")
    unless all { isValidPath($_->path) } $c->stash->{build}->buildoutputs->all;
  • replacement in src/lib/Hydra/Controller/Build.pm at line 245
    [2.366][2.366:442]()
    error($c, "Output is not available.") unless isValidPath $output->path;
    [2.366]
    [2.442]
    gone($c, "Output is no longer available.") unless isValidPath $output->path;
  • replacement in src/lib/Hydra/Controller/Root.pm at line 233
    [5.2638][5.456:602]()
    if (!isValidPath($path)) {
    $c->response->status(410); # "Gone"
    error($c, "Path " . $path . " is no longer available.");
    }
    [5.2638]
    [5.602]
    gone($c, "Path " . $path . " is no longer available.") unless isValidPath($path);
  • replacement in src/lib/Hydra/Helper/CatalystUtils.pm at line 18
    [5.70][3.231:263]()
    error notFound accessDenied
    [5.70]
    [3.263]
    error notFound gone accessDenied
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 103
    [4.603]
    [3.380]
    }
    sub gone {
    my ($c, $msg) = @_;
    error($c, $msg, 410);