Commit Graph

338 Commits

Author SHA1 Message Date
182f725612 Don't pass an undefined input 2013-08-12 18:15:11 +02:00
d96df42c03 GitInput.pm: Don't do a chdir to the Git clone
Doing a chdir in the parent is evil.  For instance, we had Hydra core
dumps ending up in the cloned directory.  Therefore, the function
‘run’ allows doing a chdir in the child.  The function ‘grab’ returns
the child's stdout and throws an exception if the child fails.
2013-08-12 17:46:26 +02:00
687ca429c3 Pass project and jobset to fetchInput
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-29 15:33:22 -04:00
12ca755bea Don't redirect to /login if authentication is required
We can just serve the login page in place.
2013-07-09 12:02:15 +02:00
efd011fbc3 Revert "Don't call buildFinished after we already know it failed"
I don't understand perl strings.

This reverts commit b2f6be9686.

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-08 14:30:46 -04:00
b2f6be9686 Don't call buildFinished after we already know it failed
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-08 13:52:51 -04:00
166d56088f Call buildFinished when a cached build is added
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-08 13:35:34 -04:00
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
698d6eac89 Eliminate duplicate getPreviousBuild functions
And move some stuff into CatalystUtils for use by other plugins.
2013-06-27 18:08:00 +02:00
51f0185797 Allow _ in release names 2013-06-18 16:00:24 +02:00
77e37c1ea3 Don't add a nix-build build product unless $out is a directory 2013-05-28 18:43:05 +02:00
1f1615e80b Support revision control systems via plugins 2013-05-25 15:36:58 -04:00
7b5e92868b Remove unused Jobs columns
Actually, we can *almost* get rid of the Jobs table entirely...
2013-05-23 12:12:19 -04:00
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
26b3da5d13 Fix tests
http://hydra.nixos.org/build/4902041
2013-05-09 14:29:04 +02:00
591aee0793 getPrimaryBuildsForView: Return all view results
Returning only the first 20 results can cause NixOS/Nixpkgs channel
generation to fail, if the first 20 view results correspond to
evaluations that haven't finished yet.  Then URLs like
/view/nixos/tested/latest-finished will return 500 rather than the
latest finished view.
2013-04-26 13:21:41 +02:00
e7926e046b Security: Improve checking of build products
Build product paths cannot reference locations outside of the Nix
store.  We previously disallowed paths from being symlinks, but this
didn't take into account that parent path elements can be symlinks as
well.  So a build product /nix/store/bla.../foo/passwd, with
/nix/store/bla.../foo being a symlink to /etc, would still work.

So now we check all paths encountered during path resolution.
Symlinks are allowed again so long as they point to the Nix store.
2013-04-02 23:32:04 +02:00
03189bf62b Implemented quoted strings support in hydra-build-products to allow file names with spaces + testcase 2013-03-20 18:05:21 +01:00
c96e427ec0 Log segfaults from the evaluator 2013-03-14 17:39:24 +01:00
f9426f365b machine-status: Read /etc/nix.machines instead of using the BuildMachines table 2013-03-04 15:37:20 -05:00
a77161e40a Allow users to edit their own settings
Also, don't use the flash anymore for going back to the referer.
2013-03-04 15:25:23 +01:00
e8cbcb50ac Add user registration 2013-02-27 18:33:47 +01:00
d1c2771ab8 Ensure that each eval is compared to the previous one from the same jobset
Also, reduce the number of database hits.
2013-02-26 19:08:39 +01:00
d596b58991 "Evaluate" command: push the jobset to the front of the eval queue
Don't let hydra-server call hydra-evaluate.  That will probably just
timeout, get killed, etc.
2013-02-26 16:56:19 +01:00
4b70be6753 Fix same system inputs 2013-02-26 15:51:56 +01:00
42d2015357 Support push notification of repository changes
External machines can now notify Hydra that it should check a
repository by sending a GET or PUSH request to /api/push, providing a
list of jobsets to be checked and/or a list of repository URLs.  In
the latter case, all jobsets that have any of the specified
repositories as an input will be checked.

For instance, you can configure GitHub or BitBucket to send a request
to the URL

  http://hydra.example.org/api/push?repos=git://github.com/NixOS/nixpkgs.git

to trigger evaluation of all jobsets that have
git://github.com/NixOS/nixpkgs.git as an input, or to the URL

  http://hydra.example.org/api/push?jobsets=patchelf:trunk,nixpkgs:trunk

to trigger evaluation of just the specified jobsets.
2013-02-25 21:10:32 +01:00
6658419f69 Disallow build products that are symlinks
Otherwise you can do

  ln -s /etc/passwd $out/foo
  echo "file misc $out/foo" >> $out/nix-support/hydra-build-products

and get Hydra to serve its /etc/passwd file.
2013-02-23 16:28:44 +01:00
aa7ddeb8e9 Use hashFile instead of nix-hash
Calling a shell command is a security hole if $path contains special
characters (e.g. "${foo}").  Observed in
http://hydra.nixos.org/build/4041321.
2013-02-23 16:09:34 +01:00
ba68826860 Add a page to show the latest evaluations for the entire server 2013-02-21 17:27:17 +01:00
767cab6cd2 Correctly redirect to the referring page when logging in 2013-02-21 14:38:18 +01:00
fec45d1f07 Remove dead code 2013-02-21 13:45:11 +01:00
cd83b8e3aa Security: Ensure that a build product refers to the Nix store 2013-02-13 18:26:00 +01:00
10882a1ffd Add multiple output support
This requires turning the outPath columns in the Builds and BuildSteps
tables into separate tables, and so requires a schema upgrade.
2013-02-13 16:49:28 +00:00
58dd49e645 Fix handling of IPC::Run::run exit status
Turns out that the exit status is returned in $?, not as the return
value of run().  So our error checking was completely bogus.
2013-01-23 15:56:28 +01:00
e0de5de91d Fix some warnings 2013-01-23 12:41:57 +00:00
30e5185acf Remove the logfile and logSize columns from the database
It's pointless to store these, since Nix knows where the logs are.
Also handle (in fact require) Nix's new log storage scheme.  Also some
cleanups in the build page.
2013-01-22 22:48:02 +01:00
67aefde62c Remove trailing whitespace 2013-01-22 14:41:02 +01:00
aa28ffe3a8 Die tabs die 2013-01-22 14:09:37 +01:00
f188fe5683 hydra-evaluator: Don't require $HYDRA_CONFIG 2013-01-22 13:19:28 +01:00
d4e49773c5 Allow dashes in attrNames 2013-01-11 12:16:21 +01:00
f27ae1d566 Add support for Guile & Guix. 2012-10-17 16:23:00 +02:00
4ade8c5a1b Add dollar to pathCompRE, which allows files with dollars in them to be served by Hydra, e.g. sphinx generated docs often has these types of files. 2012-10-12 13:48:11 +02:00
f4a24b94ee Fallback for git fetch, which allows specific gits revisions to be used as build inputs. 2012-09-11 22:31:49 +02:00
d37c2c239c export logContents 2012-06-26 12:09:05 +02:00
a2f56ce574 * Read logs using logContents function in stead of handling it everywhere separately. 2012-06-26 12:00:18 +02:00
0701cd0da8 * Fix getBuildLog for bzip2'd files. 2012-06-26 08:04:35 +02:00
0fdcd3176b Add numbered revision id of mercurial as revCount. 2012-05-01 09:15:52 +02:00
437e59c4a8 When checking if build is already built, check for potential 'failed with result'. Fixes issue #7. 2012-04-30 19:47:21 +02:00
4a6f798ef4 Fix Mercurial input fetching if a cached input has been GC'ed
Fixes Hydra/76.
2012-04-30 16:21:28 +02:00
6d5567bb16 Use git fetch -fu origin +$branch:$branch to fetch all changes for branch. 2012-04-26 08:36:40 +02:00