* hydra: added initial version of build graph

[?]
Feb 10, 2010, 10:15 AM
2R7GHSA4NUXPRWRPVXYDYWFIVVJGSUWUI2IPJGFN6ILZIAZGXGCAC

Dependencies

  • [2] NZI7E2E3 * hydra: handle case where logfile is empty
  • [3] PHX2HIVG * Store info about the build inputs in the build record.
  • [4] WHAFVCEI
  • [5] ZI535LI6 * hydra: 'new' UI for project/jobset/job/build
  • [6] A52HEFHQ * Allow builds to be restarted (if they failed with a transient error,
  • [7] TW5ZQX5Z * Move up the build products in the builds page, since they're more
  • [8] J5UVLXOK * Start of a basic Catalyst web interface.
  • [9] GWCV3TQV * BuildInputs table: link to dependencies, include store paths.
  • [10] BVOPAMLS
  • [11] L2E6EVE2 * Merged the Build and Job tables.
  • [12] S66BOMVU * Added authentication.
  • [*] T4LLYESZ * Nix expression for building Hydra.
  • [*] F3GR3UC5 * Actually, include jquery and tablesorter in the source tarball.
  • [*] O7HSEB3X
  • [*] KN3VYE5P * Cleaned up the foreign key constraints.
  • [*] LBNVQXUB * Build the /build stuff in a separate controller.
  • [*] VCOSLZRP

Change contents

  • edit in release.nix at line 31
    [15.384]
    [15.384]
    };
    flot = fetchurl {
    url = http://flot.googlecode.com/files/flot-0.6.zip;
    sha256 = "1k2mfijvr1jwga65wcd78lp9ia17v99f1cfm5nlmc0k8glllbj5a";
  • edit in release.nix at line 44
    [16.106]
    [17.33]
    unzip -d src/root/static/js $flot
  • edit in src/lib/Hydra/Controller/Build.pm at line 51
    [2.251]
    [2.251]
    }
    if($build->finished) {
    $c->stash->{prevBuilds} = [joinWithResultInfo($c, $c->model('DB::Builds'))->search(
    { project => $c->stash->{project}->name
    , jobset => $c->stash->{build}->jobset->name
    , job => $c->stash->{build}->job->name
    , system => $build->system
    , finished => 1
    , buildstatus => 0
    }
    , { order_by => "id DESC", rows => 20 }
    )
    ];
  • edit in src/root/build.tt at line 83
    [3.1369][3.2182:2183](),[3.1696][3.2182:2183](),[3.2820][3.2182:2183](),[3.5757][3.2182:2183](),[3.7438][3.2182:2183]()
  • edit in src/root/build.tt at line 84
    [3.7460][3.7460:7461]()
  • replacement in src/root/build.tt at line 90
    [3.4168][3.4168:4253]()
    [% IF build.dependents %]<li><a href="#tabs-usedby">Used by</a></li>[% END%]
    [3.4168]
    [3.4253]
    [% IF build.dependents %]<li><a href="#tabs-usedby">Used by</a></li>[% END%]
    <li><a href="#tabs-history">History chart</a></li>
  • edit in src/root/build.tt at line 94
    [3.4285]
    [3.4285]
  • edit in src/root/build.tt at line 417
    [19.763]
    [3.8443]
    <div id="tabs-history">
  • edit in src/root/build.tt at line 420
    [3.8444]
    [3.14397]
    <div id="placeholder" style="width:600px;height:300px;"></div>
    <script src="/static/js/flot/jquery.flot.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function() {
    var d = [ null [% FOREACH prevbuild IN prevBuilds %][% IF prevbuild.resultInfo.starttime != 0 && (prevbuild.resultInfo.stoptime - prevbuild.resultInfo.starttime) != 0 %],[[% prevbuild.resultInfo.starttime * 1000 %],[% prevbuild.resultInfo.stoptime - prevbuild.resultInfo.starttime %]] [% END %] [% END %] ] ;
    // helper for returning the weekends in a period
    function weekendAreas(axes) {
    var markings = [];
    var d = new Date(axes.xaxis.min);
    // go to the first Saturday
    d.setUTCDate(d.getUTCDate() - ((d.getUTCDay() + 1) % 7))
    d.setUTCSeconds(0);
    d.setUTCMinutes(0);
    d.setUTCHours(0);
    var i = d.getTime();
    do {
    // when we don't set yaxis, the rectangle automatically
    // extends to infinity upwards and downwards
    markings.push({ xaxis: { from: i, to: i + 2 * 24 * 60 * 60 * 1000 } });
    i += 7 * 24 * 60 * 60 * 1000;
    } while (i < axes.xaxis.max);
    return markings;
    }
    var now = (new Date()).getTime() ;
    var minimum = now;
    for (var i = 1; i < d.length; ++i)
    if ( minimum > d[i][0] )
    minimum = d[i][0] ;
    var now = (new Date()).getTime() ;
    var options = {
    xaxis: { mode: "time", min: minimum, max: now,
    },
    points: { show: true },
    lines: { show: true },
    selection: { mode: "x" },
    grid: { markings: weekendAreas }
    };
    $('#generic-tabs').bind('tabsshow', function(event, ui) {
    if (ui.panel.id == "tabs-history") {
    $.plot($("#placeholder"), [
    { data: d,
    clickable : true,
    hoverable : true,
    },
    ], options );
    }
    })
    });
    </script>
    </div>