Commit graph

1376 commits

Author SHA1 Message Date
Shea Levy 002ac9ef63 Merge in the first bits of the API work
The catalyst-action-rest branch from shlevy/hydra was an exploration of
using Catalyst::Action::REST to create a JSON API for hydra. This commit
merges in the best bits from that experiment, with the goal that further
API endpoints can be added incrementally.

In addition to migrating more endpoints, there is potential for
improvement in what's already been done:
* The web interface can be updated to use the same non-GET endpoints as
  the JSON interface (using x-tunneled-method) instead of having a
  separate endpoint
* The web rendering should use the $c->stash->{resource} data structure
  where applicable rather than putting the same data in two places in
  the stash
* Which columns to render for each endpoint is a completely debatable
  question
* Hydra::Component::ToJSON should turn has_many relations that have
  strings as their primary keys into objects instead of arrays

Fixes NixOS/hydra#98

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-02 14:00:46 -04:00
Eelco Dolstra d18fc4fc38 Include names of committers in HipChat notifications
HipChat notification messages now say which committers were
responsible, e.g.

  Job patchelf:trunk:tarball: Failed, probably due to 2 commits by Eelco Dolstra
2013-07-02 13:54:18 +02:00
Eelco Dolstra 7e11d01abf Remove tabs 2013-07-02 11:37:16 +02:00
Eelco Dolstra 663b6a747b release.nix: Get rid of the "system" argument 2013-07-01 19:37:14 +02:00
Eelco Dolstra fe030331b5 Revert "Don't compress already-compressed files."
This reverts commit 190bffd846.
2013-07-01 18:46:18 +02:00
Eelco Dolstra 11414b0447 Revert "Doh"
This reverts commit f1f938512d.
2013-07-01 18:46:14 +02:00
Rob Vermaas f1f938512d Doh 2013-07-01 18:12:33 +02:00
Rob Vermaas 9d7c14b342 Merge pull request #103 from civodul/nar-uncompressed
Don't compress already-compressed files.
2013-07-01 08:16:51 -07:00
Eelco Dolstra 9939ddf22c Add a plugin for HipChat notification
This plugin sends notification of build failure or success to a
HipChat room, if the status differs from the last build.

The plugin can be configured by adding one or more of these stanzas to
hydra.conf:

  <hipchat>
    jobs = (patchelf|nixops):.*:.*
    room = 1234
    token = 39ab2198fe...
  </hipchat>

Here "jobs" is a regular expression against which the fully qualified
job name of the build is matched (so for instance
"nixops:master:tarball" will match the stanza above).
2013-06-27 18:56:31 +02:00
Eelco Dolstra 698d6eac89 Eliminate duplicate getPreviousBuild functions
And move some stuff into CatalystUtils for use by other plugins.
2013-06-27 18:08:00 +02:00
Eelco Dolstra c65f40e146 Add common.js to the tarball 2013-06-25 12:48:25 +02:00
Eelco Dolstra 611f402a70 Move common Javascript code into a separate file 2013-06-25 01:16:28 +02:00
Eelco Dolstra a5436be2ce After editing a project/jobset, redirect back to the config tab 2013-06-25 01:00:59 +02:00
Eelco Dolstra 68a03bc674 When a tab is selected, change the fragment id
And when a page is visited, active the tab identified by the fragment
id.  This allows linking to a specific tab.

Fixes #93.
2013-06-25 00:55:14 +02:00
Eelco Dolstra afc90b36db Don't print to stdout 2013-06-24 22:22:43 +00:00
Ludovic Courtès 190bffd846 Don't compress already-compressed files.
Fixes <https://github.com/NixOS/hydra/issues/102>.
2013-06-23 15:23:16 +02:00
Eelco Dolstra 51f0185797 Allow _ in release names 2013-06-18 16:00:24 +02:00
Eelco Dolstra 98a105fe69 hydra-build: Give a nicer error message if the derivation is gone 2013-06-14 11:01:53 +00:00
Eelco Dolstra cceab7308b hydra-queue-runner: Handle restarted builds whose derivation is gone
Restarted builds whose derivation has been garbage-collected in the
meantime caused hydra-queue-runner to get stuck in a loop saying:

Jun 14 11:54:25 lucifer hydra-queue-runner[31844]: system type `x86_64-darwin': 0 active, 2 allowed, started 2 builds
Jun 14 11:54:25 lucifer hydra-queue-runner[31844]: {UNKNOWN}: path `/nix/store/wcizsch2garjlvs4pswrar47i1hwjaia-inconsolata.drv' is not valid at
/nix/store/ypkdm4v13yrk941rvp8h0y425a5ww6nm-hydra-0.1pre1353-40debf1/bin/.hydra-queue-runner-wrapped line 51. at
/nix/store/kjpsc2zdaxnd44azxyw60f2px839m1cd-hydra-perl-deps/lib/perl5/site_perl/5.16.2/Catalyst/Model/DBIC/Schema.pm line 501
2013-06-14 11:00:05 +00:00
Eelco Dolstra 289b29791f Add note on restarting builds that times out 2013-06-13 20:54:28 +02:00
Eelco Dolstra 0046c81857 Remove Switch dependency, we're not using it 2013-06-13 15:14:33 +02:00
Eelco Dolstra 7a926935a5 Add Catalyst::DispatchType::Regex for forward compatibility 2013-06-13 15:13:52 +02:00
Eelco Dolstra 1c30a777ad Fix project/jobset deletion 2013-06-11 16:57:22 +02:00
Eelco Dolstra 40debf1515 hydra-queue-runner: Don't unlock builds we just started
This happens if the previous iteration took more than 60 seconds.
Then the queue runner may think that builds failed to start properly
and unlock them, e.g.

build 5264936 pid 19248 died, unlocking
build 5264951 pid 19248 died, unlocking
build 5257073 pid 19248 died, unlocking
...
2013-06-07 20:15:37 +00:00
Eelco Dolstra 5d9b7c6ab2 Speed up findBuildDependencyInQueue
This was taking a long time due to the giant SQL query.

Issue #99.
2013-06-07 20:15:32 +00:00
Eelco Dolstra 8e36343b62 hydra-queue-runner: Start as many builds as possible on each iteration
Because we don't start a build if a dependency is already building,
it's possible that some or all of the $extraAllowed highest-priority
builds in the queue are not eligible.  E.g. with $extraAllowed = 32,
we might start only 3 builds even though there are thousands in the
queue.  The fix is to try all queued builds until $extraAllowed have
been started.

Issue #99.
2013-06-07 20:15:20 +00:00
Eelco Dolstra 2974fea1a7 Use https://ajax.googleapis.com if we're on https 2013-06-07 15:45:37 +02:00
Eelco Dolstra f4ecf27def Fix Perl warning about $path masking earlier definition 2013-06-02 23:32:09 +02:00
Eelco Dolstra 8e246a835a Don't do camel case in filenames 2013-06-02 23:30:46 +02:00
Eelco Dolstra 66c695e1c3 Fix ‘Unable to handle files with the extension 'conf'’
Config::Any uses Module::Pluggable to seach for plugins, so it needs
the patched Module::Pluggable in Nixpkgs (rather than the one in Perl
itself) to properly find plugins in symlink trees created by buildEnv.
2013-06-02 23:29:24 +02:00
Shea Levy 591acda6f9 reproduce.tt: Save the revCount when reproducing more than once
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-05-30 14:06:32 -04:00
Shea Levy 8e716ff062 reproduce.tt: Create the checkout dir before an hg clone
For some reason, hg clone from a local (path-based) repo will fail if
the parent directory of the destination directory doesn't exist (though
it succeeds when cloning from an http repo).

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-05-30 13:31:53 -04:00
Eelco Dolstra 1277a8fc1c Don't break certain table columns
For instance, if the "timestamp" column becomes too small, then every
timestamp is spread out across two lines, doubling the size of the
table.
2013-05-29 14:58:44 +02:00
Eelco Dolstra 47c49cf3d4 Show links on products of type "doc" 2013-05-29 11:39:23 +02:00
Eelco Dolstra 77e37c1ea3 Don't add a nix-build build product unless $out is a directory 2013-05-28 18:43:05 +02:00
Eelco Dolstra 1f1615e80b Support revision control systems via plugins 2013-05-25 15:36:58 -04:00
Eelco Dolstra 5e0542d3af Use buildEnv to combine Hydra's Perl dependencies
This makes the Perl search path ($PERL5LIB) much shorter, cutting down
the number of stat() calls when starting hydra-server from ~432000 to
~9000.
2013-05-24 15:26:47 -04:00
Eelco Dolstra e0c411220e built.tt: Handle the case where the original build is not known
And remove some parentheses.
2013-05-24 12:43:31 -04:00
Eelco Dolstra 9ac363d32a Fill in starttime/stoptime for cached builds 2013-05-24 12:43:02 -04:00
Petr Rockai 6c0577b226 Respect X-Request-Base header coming from a frontend proxy. 2013-05-23 13:07:40 -04:00
Eelco Dolstra 5e5b344527 Make latest/latest-for more efficient
Getting all matching rows from the database is expensive.
2013-05-23 12:18:38 -04:00
Eelco Dolstra 7b5e92868b Remove unused Jobs columns
Actually, we can *almost* get rid of the Jobs table entirely...
2013-05-23 12:12:19 -04:00
Eelco Dolstra b1f89bf92d Ensure that stoptime and starttime are set for finished builds 2013-05-23 12:05:12 -04:00
Eelco Dolstra 57b2bb0674 Let Builds.timestamp refer to the time the build was added
Previously, for scheduled builds, "timestamp" contained the time the
build was added to the queue, while for finished builds, it was the
time the build finished.  Now it's always the former.
2013-05-23 10:45:49 -04:00
Eelco Dolstra e09622eb29 Include # of failed builds in Subject 2013-05-21 18:30:05 -04:00
Shea Levy 4b1a8384db reproduce.tt: Set revCount for hg repos
The revision counting changes depending on which revision is cloned
initially, so clone the default branch first and then checkout the
required revision to match hydra's revCount.

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-05-16 11:24:17 -04:00
Rob Vermaas 666f398e98 Always show the links related to the build product. 2013-05-16 11:29:54 +00:00
Eelco Dolstra 444b03bad2 Omit the system type if it's part of the job name 2013-05-15 11:43:06 +02:00
Eelco Dolstra ac6a152ec5 Improve email notifications status messages
Add "Failed with output", and shorten "Failed with non-zero exit code"
to "Failed".
2013-05-15 11:31:37 +02:00
Rob Vermaas 43785dfca9 Merge pull request #85 from peti/dont-clutter-system-log-with-debug-messages
hydra-queue-runner: don't clutter the system log with debug message
2013-05-10 14:52:13 -07:00