* Provide some redirects to build products by type so that we can for

[?]
Apr 8, 2009, 8:09 AM
XJFHFZCA2VXGYSRDJDLAZZX3MLRH2KDT242DHWRU5XQRJ6XIHZUQC

Dependencies

  • [2] BTUDUY6F * Provide some redirects to the latest successful build for a job (or
  • [3] SMM4HQTP * Put actions related to builds under /build (e.g. /log/<buildid>
  • [4] AKAZKCR6 * At top-level and for each project, provide two channels: "latest"
  • [5] NUIKDEHL * A quick hack to list the contents of various types of files (RPM,
  • [6] VVDQKVNL
  • [7] JFZNAYJX * Showing releases.
  • [*] FPK5LF53 * Put the project-related actions in a separate controller. Put the
  • [*] LBNVQXUB * Build the /build stuff in a separate controller.
  • [*] D3DIBMOK * For products that are directories (like manuals), allow a default

Change contents

  • replacement in src/lib/Hydra/Base/Controller/ListBuilds.pm at line 64
    [2.103][2.103:128]()
    my ($self, $c) = @_;
    [2.103]
    [2.128]
    my ($self, $c, @rest) = @_;
  • replacement in src/lib/Hydra/Base/Controller/ListBuilds.pm at line 71
    [2.372][2.372:474]()
    $c->res->redirect($c->uri_for($c->controller('Build')->action_for("view_build"), [$latest->id]));
    [2.372]
    [2.474]
    $c->res->redirect($c->uri_for($c->controller('Build')->action_for("view_build"), [$latest->id], @rest));
  • replacement in src/lib/Hydra/Base/Controller/ListBuilds.pm at line 78
    [2.614][2.614:648]()
    my ($self, $c, $system) = @_;
    [2.614]
    [2.648]
    my ($self, $c, $system, @rest) = @_;
  • edit in src/lib/Hydra/Base/Controller/ListBuilds.pm at line 86
    [2.1031][2.1031:1138]()
    $c->res->redirect($c->uri_for($c->controller('Build')->action_for("view_build"), [$latest->id]));
  • edit in src/lib/Hydra/Base/Controller/ListBuilds.pm at line 87
    [2.1143]
    [3.702]
    $c->res->redirect($c->uri_for($c->controller('Build')->action_for("view_build"), [$latest->id], @rest));
  • edit in src/lib/Hydra/Controller/Build.pm at line 91
    [10.2286]
    [10.2286]
  • edit in src/lib/Hydra/Controller/Build.pm at line 93
    [10.2287]
    [10.2287]
    sub defaultUriForProduct {
    my ($self, $c, $product, @path) = @_;
    my $x = $product->productnr
    . ($product->name ? "/" . $product->name : "")
    . ($product->defaultpath ? "/" . $product->defaultpath : "");
    return $c->uri_for($self->action_for("download"), $c->req->captures, $x, @path);
    }
  • edit in src/lib/Hydra/Controller/Build.pm at line 101
    [10.2288]
    [3.145]
  • edit in src/lib/Hydra/Controller/Build.pm at line 110
    [10.2672]
    [11.45]
    return $c->res->redirect(defaultUriForProduct($self, $c, $product, @path))
    if scalar @path == 0 && ($product->name || $product->defaultpath);
  • edit in src/lib/Hydra/Controller/Build.pm at line 137
    [10.3293]
    [3.189]
    }
    # Redirect to a download with the given type. Useful when you want to
    # link to some build product of the latest build (i.e. in conjunction
    # with the .../latest redirect).
    sub download_by_type : Chained('build') PathPart('download-by-type') {
    my ($self, $c, $type, $subtype, @path) = @_;
    notFound($c, "You need to specify a type and a subtype in the URI.")
    unless defined $type && defined $subtype;
    (my $product) = $c->stash->{build}->buildproducts->search(
    {type => $type, subtype => $subtype});
    notFound($c, "Build doesn't have a build product with type $type/$subtype.")
    if !defined $product;
    $c->res->redirect(defaultUriForProduct($self, $c, $product, @path));
  • edit in src/root/product-list.tt at line 106
    [3.5266]
    [3.5266]
    <td><a href="[% uri %]"><tt>[% uri %]</tt></a></td>
    </tr>
    <tr>
    <th>Links to latest:</th>
  • replacement in src/root/product-list.tt at line 111
    [3.5285][3.2457:2531](),[3.2531][3.5477:5498](),[3.5477][3.5477:5498]()
    <a href="[% uri %]">
    <tt>[% uri %]</tt>
    </a>
    [3.5285]
    [3.5498]
    [% uri2 = "${c.uri_for('/job' build.project.name build.jobset.name build.job.name 'latest' 'download-by-type' product.type product.subtype)}" %]
    <a href="[% uri2 %]"><tt>[% uri2 %]</tt></a>
    <br />
    [% uri2 = "${c.uri_for('/job' build.project.name build.jobset.name build.job.name 'latest' 'download' product.productnr)}" %]
    <a href="[% uri2 %]"><tt>[% uri2 %]</tt></a>