Re-enable the "Related Builds" tab

[?]
Mar 12, 2012, 7:14 PM
7ZVZJK54M4UA2PKHGJT572PKDBAEAYS5JWSBOOEY7XEB3YX3RCDAC

Dependencies

  • [2] MOX7XJ2E Merge the BuildSchedulingInfo table into the Builds table
  • [3] NZI7E2E3 * hydra: handle case where logfile is empty
  • [4] LBNVQXUB * Build the /build stuff in a separate controller.
  • [5] 3SQCOHZN * minor performance tweaks
  • [6] HB3OHPJL hydra: in case of cached build, add link to build that built the storepath
  • [7] MPVX6MKX * hydra: on build page, show tail of log on first tab when buildstatus == 1 (this specific build failed)

Change contents

  • replacement in src/lib/Hydra/Controller/Build.pm at line 83
    [3.250][2.1074:1432]()
    #my $r = joinWithResultInfo( $c, $c->model('DB::Builds'))->search(
    # { eval => { -in => $build->jobsetevalmembers->all->get_column('eval')->as_query } }
    # , { join => 'jobsetevalmembers', order_by => [ 'project', 'jobset', 'job'], distinct => 1 }
    # );
    #if ($r->count <= 100) {
    # $c->stash->{relatedbuilds} = [$r->all];
    #}
    [3.250]
    [3.1111]
    my $maxRelated = 100;
    my $r = $c->model('DB::Builds')->search(
    { eval => { -in => $build->jobsetevalmembers->search({}, {rows => 1})->get_column('eval')->as_query } },
    { join => 'jobsetevalmembers', order_by => [ 'project', 'jobset', 'job'], distinct => 1, rows => $maxRelated + 1 }
    );
    $c->stash->{relatedbuilds} = [$r->all];
    delete $c->stash->{relatedbuilds} if scalar(@{$c->stash->{relatedbuilds}}) > $maxRelated;