Allow non-admin users to see the machine status page

[?]
Feb 20, 2013, 3:40 PM
R2PON6R7RJT63XVKGEXAIKB76RHIQL3WCDTZQM5JLKAZ7B5AZAFQC

Dependencies

  • [2] JZVRK5QJ Group some menu items together under a "Status" menu
  • [3] AS2OXLRM * Editing releases.
  • [4] QL55ECJ6 - adapted ui for hydra, more in line with nixos.org website
  • [5] PZL3SZM3 Give every page a consistent title
  • [6] NEQ4BISO Add bootstrap.zip
  • [7] IK2KI6KZ Add create-user action that was mostly present already.
  • [8] 6KJXJB7N qualify ordery_by clauses when necessary, remove unnecessary order_by's, reported by Ludo, resulted in errors in sqlite
  • [9] WRIU3S5E * UI for cloning builds (not functional yet).
  • [10] NVEFBXAM hydra: order machines by enabled/disabled, add green and red color for enabled/disabled
  • [11] P5X4P6VK * Renaming "release sets" to "views" (not finished yet). Having
  • [12] MOX7XJ2E Merge the BuildSchedulingInfo table into the Builds table
  • [13] 3JBUMW3E forgot to commit a file
  • [14] QT4FO2HP refactored admin controller, using chains, to avoid using requireadmin on each endpoint
  • [15] RSEGBU6C Hydra/20: Jobset clone feature
  • [16] SZYDW2DG hydra: added some user admin
  • [17] JARRBLZD Bootstrapify the Hydra forms (except the project and jobset edit pages)
  • [18] XDDCO6CH * hydra: add dependency list with links to logfiles
  • [19] FV2M6MOT hydra: use autoconf/-make
  • [20] SMCOU72F hydra: add some admin for adding/enabling/etc build machines
  • [21] RBNQKATL * Adding persistant releases. A release is a named set of builds.
  • [22] 5DSDXORD hydra: missing plain.tt
  • [23] ZWCTAZGL added newsitems, added some admin options to clear various caches.
  • [24] TRDGNILT Remove unused file
  • [25] 7ZQAHJQM Fix indentation
  • [26] YTSIRIMK * Separate job status and all builds pages.
  • [27] EFWN7JBV * Added a status page that shows all the currently executing build steps.
  • [28] ODNCGFQ5 * Improved the navigation bar: don't include all projects (since that
  • [29] KXGOUX7P * Creating releases.
  • [30] U4TD3AIQ Add support for viewing jobset evaluations
  • [31] D5QIOJGP * Move everything up one directory.
  • [32] 2BUX775I * More release -> view.
  • [33] SMTMFEKE hydra: add missing templates
  • [34] 75XUS62Y * Added a page to quickly see all failed builds and failed evaluations
  • [35] 6FRLEP4P first try for timeline of last 24 hours in hydra
  • [36] OEPUOUNB Using twitter bootstrap for more consistent looks for Hydra
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] FPK5LF53 * Put the project-related actions in a separate controller. Put the

Change contents

  • edit in src/lib/Hydra/Controller/Admin.pm at line 55
    [3.7][3.65:142](),[3.240][3.65:142](),[3.142][3.912:981](),[3.981][3.28:40](),[3.40][3.0:51](),[3.994][3.0:51](),[3.51][3.1027:1320](),[3.1027][3.1027:1320](),[3.1320][3.487:626](),[3.125][3.1472:1487](),[3.626][3.1472:1487](),[3.1472][3.1472:1487](),[3.142][3.240:280](),[3.1487][3.240:280](),[3.240][3.240:280](),[3.280][3.8:11](),[3.11][3.126:127](),[3.1491][3.126:127]()
    sub index : Chained('admin') PathPart('') Args(0) {
    my ($self, $c) = @_;
    $c->stash->{machines} = [$c->model('DB::BuildMachines')->search(
    {},
    { order_by => ["enabled DESC", "hostname"]
    , '+select' => ["(select bs.stoptime from buildsteps as bs where bs.machine = (me.username || '\@' || me.hostname) and not bs.stoptime is null order by bs.stoptime desc limit 1)"]
    , '+as' => ['idle']
    })];
    $c->stash->{steps} = [ $c->model('DB::BuildSteps')->search(
    { finished => 0, 'me.busy' => 1, 'build.busy' => 1, },
    { join => [ 'build' ]
    , order_by => [ 'machine', 'stepnr' ]
    } ) ];
    $c->stash->{template} = 'admin.tt';
    }
  • edit in src/lib/Hydra/Controller/Admin.pm at line 103
    [3.181][3.181:182]()
  • edit in src/lib/Hydra/Controller/Admin.pm at line 105
    [3.517][3.517:518]()
  • edit in src/lib/Hydra/Controller/Root.pm at line 105
    [3.650]
    [39.9461]
    sub machines :Local Args(0) {
    my ($self, $c) = @_;
    $c->stash->{machines} = [$c->model('DB::BuildMachines')->search(
    {},
    { order_by => ["enabled DESC", "hostname"]
    , '+select' => ["(select bs.stoptime from buildsteps as bs where bs.machine = (me.username || '\@' || me.hostname) and not bs.stoptime is null order by bs.stoptime desc limit 1)"]
    , '+as' => ['idle']
    })];
    $c->stash->{steps} = [ $c->model('DB::BuildSteps')->search(
    { finished => 0, 'me.busy' => 1, 'build.busy' => 1, },
    { join => [ 'build' ]
    , order_by => [ 'machine', 'stepnr' ]
    } ) ];
    $c->stash->{template} = 'machine-status.tt';
    }
  • replacement in src/root/all.tt at line 1
    [3.1038][3.48:90]()
    [% WRAPPER layout.tt title="All builds" _
    [3.1038]
    [3.90]
    [% WRAPPER layout.tt title="Recent builds" _
  • file move: admin.tt (----------)machine-status.tt (----------)
    [3.1486]
    [3.8348]
  • edit in src/root/machines.tt at line 38
    [3.13695][3.3993:4145](),[3.3993][3.3993:4145]()
    <p>
    Resulting <tt>/etc/nix.machines</tt> [% IF nixMachinesWritable == 0 %](note: file is not writable!)[% END%]:
    </p>
    <pre>
    [% nixMachines %]
    </pre>
  • replacement in src/root/topbar.tt at line 34
    [2.228][2.228:292]()
    uri = c.uri_for(c.controller(Root).action_for('status'))
    [2.228]
    [2.292]
    uri = c.uri_for(c.controller('Root').action_for('status'))
  • replacement in src/root/topbar.tt at line 37
    [2.355][2.355:421]()
    uri = c.uri_for(c.controller('Admin').action_for('index'))
    [2.355]
    [2.421]
    uri = c.uri_for(c.controller('Root').action_for('machines'))