Tie custom channels into channel-contents.tt.

[?]
Apr 27, 2015, 1:03 AM
ZQUPXSBMVCZP7QSGKNY5JDNWIPVV444FJAXQCIT2HEHXSLUSEAMQC

Dependencies

  • [2] RX7USXWQ jobset: Add a new "channels" tab.
  • [3] TNIHMBCR Jobset.pm: Factor out build->eval mapping.
  • [*] 5NO7NCKT * Refactoring.
  • [*] HXBXDEFK Speed up channel processing
  • [*] BHZXGT2H * Channels: provide an index page that lists all the packages in the
  • [*] D5QIOJGP * Move everything up one directory.

Change contents

  • edit in src/lib/Hydra/Base/Controller/NixChannel.pm at line 133
    [6.2171]
    [7.228]
    $c->stash->{genericChannel} = 1;
  • file addition: Channel.pm (----------)
    [8.188]
    package Hydra::Controller::Channel;
    use strict;
    use warnings;
    use base 'Hydra::Base::Controller::REST';
    sub channel : Chained('/') PathPart('channel/custom') CaptureArgs(3) {
    my ($self, $c, $projectName, $jobsetName, $channelName) = @_;
    $c->stash->{project} = $c->model('DB::Projects')->find($projectName);
    notFound($c, "Project $projectName doesn't exist.")
    if !$c->stash->{project};
    $c->stash->{jobset} = $c->stash->{project}->jobsets->find({
    name => $jobsetName
    });
    notFound($c, "Jobset $jobsetName doesn't exist.")
    if !$c->stash->{jobset};
    my $lastSuccessful = $c->model('DB::Builds')->find(
    { 'eval.hasnewbuilds' => 1
    , project => $projectName
    , jobset => $jobsetName
    , job => $channelName
    , buildstatus => 0
    },
    { rows => 1, order_by => "eval.id desc"
    , join => { jobsetevalmembers => 'eval' }
    }
    );
    notFound($c, "Channel $channelName either doesn't exist ".
    "or was never built successfully.")
    if !$lastSuccessful;
    $c->stash->{lastSuccessful} = $lastSuccessful;
    }
    sub overview : Chained('channel') PathPart('') Args(0) {
    my ($self, $c) = @_;
    $c->stash->{constituents} = [
    $c->stash->{lastSuccessful}->constituents_->search(
    {}, {order_by => ["job"]}
    )
    ];
    $c->stash->{genericChannel} = 0;
    $c->stash->{template} = 'channel-contents.tt';
    }
    1;
  • edit in src/root/channel-contents.tt at line 30
    [7.3614]
    [7.3614]
    [% IF genericChannel %]
  • edit in src/root/channel-contents.tt at line 73
    [7.4590]
    [7.4590]
    [% ELSE %]
    [% PROCESS "product-list.tt" %]
  • edit in src/root/channel-contents.tt at line 76
    [7.4591]
    [7.4591]
    <h2>Contents</h2>
    [% INCLUDE renderProductList build=lastSuccessful %]
    <p>Upgrades depend on the success/failure of the following constituents:</p>
    [% INCLUDE renderBuildList builds=constituents %]
  • edit in src/root/channel-contents.tt at line 85
    [7.4601]
    [% END %]
  • replacement in src/root/jobset-channels-tab.tt at line 25
    [2.1875][2.1875:1984]()
    <th><span>[% INCLUDE renderJobName project=project.name jobset=jobset.name job=chan %]</span></th>
    [2.1875]
    [2.1984]
    <th><span><a href="[% c.uri_for('/channel/custom' project.name jobset.name chan) %]">[% chan %]</a></span></th>