Commit graph

2712 commits

Author SHA1 Message Date
Robin Gloster f4e7c104ff
Create a gitlab status plugin
This plugin expects as inputs to a jobset the following:
 - gitlab_status_repo => Name of the repository input pointing to that
   status updates should be POST'ed, i.e. the jobset has a git input
   "nixexprs": "https://gitlab.example.com/project/nixexprs", in which
   case "gitlab_status_repo" would be "nixexprs".
 - gitlab_project_id => ID of the project in Gitlab, i.e. in the above
   case the ID in gitlab of "nixexprs"
2019-04-11 16:40:44 +02:00
danbst 4171ab4c4f tests: change postgresql socket dir to /tmp
In https://github.com/NixOS/nixpkgs/pull/57677 default postgresql socket directory was changed
to `/run/postgresql`, which doesn't exist (and can't be created) in
Nix build environment. We'll use /tmp as socket dir explicitly then.

Fixes build failure https://hydra.nixos.org/build/91221682

Cc @aszlig @edolstra
2019-03-29 23:46:38 +02:00
Graham Christensen 0e337e6f9c
Merge pull request #644 from input-output-hk/declarative-jobset-error-message
improve the error messages when invalid declarative jobsets are defined
2019-03-21 14:25:23 -04:00
Michael Bishop c741576563
improve the error messages when invalid declarative jobsets are defined
(cherry picked from commit 7568b89a1a9da3a58a0cdddc7b5bcea7bb6209d8)
2019-03-20 15:27:37 -04:00
Graham Christensen 2c142868a0
Merge pull request #643 from input-output-hk/github-plugin-short-context-debug
allow using a shorter context and increase hydra-notify debug
2019-03-20 14:23:31 -05:00
Michael Bishop 3ad091faf3
allow using a shorter context and increase hydra-notify debug
(cherry picked from commit 1c76ad393669af2f728fd519a050f417319412a6)
2019-03-20 15:22:24 -04:00
Graham Christensen 8a41ea5f60
Merge pull request #571 from kquick/moreinfo
Additional helpful information in error messages.
2019-03-18 15:18:14 -05:00
Graham Christensen 215ca5da9c
Merge pull request #607 from nlewo/json-search
Add JSON search API endpoint
2019-03-18 15:08:32 -05:00
Kevin Quick 2e225ba7c8
Do not attempt to report dir for grab command failure if not specified. 2019-03-17 23:15:24 -07:00
Graham Christensen 0721f6623f
Merge pull request #627 from samueldr/hydra-eval-jobs/warn-max-heap-size
hydra-eval-jobs: Warn and resets maxHeapSize on bad values
2019-03-17 19:36:53 -04:00
Graham Christensen 44e7f0dece
Merge pull request #530 from pinktrink/master
Fix bad ordering in projects documentation.
2019-03-17 17:28:51 -04:00
Graham Christensen baf828a560
Merge pull request #624 from kquick/job_headers
Add job status headers (web useability for red/green colorblindness).
2019-03-17 17:24:38 -04:00
Graham Christensen 88a92256e1
Merge pull request #636 from Ma27/serve-json-for-evals-and-machines
Serialize data as JSON with `Accept: application/json`
2019-03-17 17:17:17 -04:00
Graham Christensen 21a4433fec
Merge branch 'master' into job_headers 2019-03-17 17:16:37 -04:00
Graham Christensen c8fa7ffc12
Merge pull request #629 from Ma27/fix-maintainer-notifications
hydra-eval-jobs: fix maintainer resolution
2019-03-17 17:12:55 -04:00
Graham Christensen 014e5aa10d
Merge pull request #628 from dasJ/patch-1
Support $X-Request-Base for the Logo
2019-03-17 16:22:53 -04:00
Eelco Dolstra be2791330e
Merge pull request #641 from basvandijk/fix-linux-build-on-darwin
Fix Linux build on Darwin
2019-03-15 21:33:00 +08:00
Bas van Dijk e9d032bfe9 Fix Linux build on Darwin
Without this patch running the following on MacOS:

  nix-build release.nix -A build.x86_64-linux

results in the following error during the configuration phase (note that Nix
should be configured with a x86_64-linux build machine):

  building '/nix/store/jb6ca1gmplyb69ayd43z7fb0y9npxd53-hydra-0.1.2581.8b5948f4cf12424c04df67a6eb136c9846fb2cfd.drv' on 'ssh://my-linux-build-machine'...
  ...
  checking whether /nix/store/s6bhdppx66bkgf741vk4d29hgsj1h1zp-hydra-perl-deps/bin/nix-store is recent enough... ./configure: line 16254: /nix/store/s6bhdppx66bkgf741vk4d29hgsj1h1zp-hydra-perl-deps/bin/nix-store: cannot execute binary file: Exec format error
  no
  configure: error: `/nix/store/s6bhdppx66bkgf741vk4d29hgsj1h1zp-hydra-perl-deps/bin/nix-store' doesn't support `--timeout'; please use a newer version.
  build time elapsed:  0m1.624s 0m1.774s 0m9.366s 0m6.110s
  builder for '/nix/store/jb6ca1gmplyb69ayd43z7fb0y9npxd53-hydra-0.1.2581.8b5948f4cf12424c04df67a6eb136c9846fb2cfd.drv' failed with exit code 1

This problem is that the `nix` dependency of hydra is selected from a nixpkgs
set configured with a default `system` parameter,
i.e. `builtin.currentSystem`. This means that the hydra derivation which is
build for and on Linux depends on the nix derivation build for Darwin.

The fix is to select nix from the nixpkgs set configured with a system specified
by the user.
2019-03-15 11:27:16 +01:00
Maximilian Bosch 1cbbc6c52c
Serialize data as JSON with Accept: application/json
Similar to #607. According to the Catalyst[1] docs it's possible to
specify a data structure that is supposed to be serialized when
requesting i.e. a JSON response.

[1] https://metacpan.org/pod/Catalyst::Controller::REST#status_ok
2019-02-14 01:22:48 +01:00
Eelco Dolstra 8b5948f4cf
Merge pull request #634 from NixOS/fix-build
tests: disable sandbox
2019-02-01 09:17:39 +01:00
Graham Christensen 4160132278 tests: disable sandbox
Prior, tests would all fail to build, causing, roughly, the following
error (roughly, because I added some debug log messages :)):

    ok 68 - Evaluating jobs/build-products.nix should result in 2 builds
    Queue runner stderr: using 4185024512 bytes for the NAR buffer
    locking path '/build/source/tests/data/queue-runner/lock'
    lock acquired on '/build/source/tests/data/queue-runner/lock.lock'
    warning: unknown setting 'max-connection-age'
    warning: unknown setting 'max-connections'
    dispatcher woken up
    dispatcher woken up
    dispatcher sleeping for 7674380800s
    adding new machine ‘localhost’
    dispatcher woken up
    checking the queue for builds > 0...
    dispatcher sleeping for 7674380800s
    sending notification about build 1
    loading build 18 (tests:build-products:simple)
    considering derivation ‘/build/source/tests/nix/store/24h0i450d4k00a4jhhk6r7qpqdvzskw6-build-product-simple.drv’
    sending notification about build 2
    creating build step ‘/build/source/tests/nix/store/24h0i450d4k00a4jhhk6r7qpqdvzskw6-build-product-simple.drv’
    added build 18 (top-level step /build/source/tests/nix/store/24h0i450d4k00a4jhhk6r7qpqdvzskw6-build-product-simple.drv, 1 new steps)
    got 1 new runnable steps from 1 new builds
    step ‘/build/source/tests/nix/store/24h0i450d4k00a4jhhk6r7qpqdvzskw6-build-product-simple.drv’ is now runnable
    dispatcher woken up
    dispatcher sleeping for 7674380800s
    performing step ‘/build/source/tests/nix/store/24h0i450d4k00a4jhhk6r7qpqdvzskw6-build-product-simple.drv’ 1 times on ‘localhost’ (needed by build 18
    and 0 others)
    sending closure of ‘/build/source/tests/nix/store/24h0i450d4k00a4jhhk6r7qpqdvzskw6-build-product-simple.drv’ to ‘localhost’
    building ‘/build/source/tests/nix/store/24h0i450d4k00a4jhhk6r7qpqdvzskw6-build-product-simple.drv’ on ‘localhost’
    killing process 10462
    marking build 18 as failed
    finishing build step ‘/build/source/tests/nix/store/24h0i450d4k00a4jhhk6r7qpqdvzskw6-build-product-simple.drv’

    ok 69 - Build 'simple' from jobs/build-products.nix should exit with code 0
    ok 70 - newbuild->finished was '1' instead of 1
    not ok 71 - newbuild->buildstatus was '1' instead of 0
    not ok 72 - Build 'simple' from jobs/build-products.nix should have buildstatus 0
    Can't call method "name" on an undefined value at ./evaluation-tests.pl line 173.
    FAIL: evaluation-tests.pl
2019-02-01 04:31:11 +01:00
Eelco Dolstra 5dd4736aed
Merge pull request #632 from nlewo/localhost-error-message
hydra-queue-runner: better error message if nix-store can not be started
2019-01-23 10:46:30 +01:00
Antoine Eiche 9a73ec6455 hydra-queue-runner: better error message if nix-store can not be started
The hydra-queue-runner opens a connection to the builder. If the
builder is 'localhost' it starts `nix-store`, otherwise it starts
'ssh'.

Currently, if the hydra-queue-runner can not start `nix-store` (not in
the PATH for instance), the error message is:

  cannot connect to ‘localhost’: error: cannot start ssh: No such file
  or directory

This is not useful since ssh is actually not started:/

With this patch the error message is now:

  cannot connect to ‘localhost’: error: cannot start nix-store: No such file
  or directory
2019-01-23 10:42:47 +01:00
Eelco Dolstra f5686e0958
Merge pull request #633 from samueldr/feature/dev-server
Add hydra-dev-server which uses the classic Catalyst server
2019-01-23 10:39:47 +01:00
Eelco Dolstra 804c29703f
Merge pull request #631 from samueldr/feature/dates
Enhances user-facing dates
2019-01-23 10:36:40 +01:00
Samuel Dionne-Riel 04ff9e217b Add hydra-dev-server which uses the classic Catalyst server
This, in turns allows

 - Using --restart for reloading the perl code
 - Printing traces on error
2019-01-22 20:34:21 -05:00
Samuel Dionne-Riel a16d0c7d6b Makes user-facing dates local when possible
Also ensures it makes available the hydra timezone in the title of the
dates.
2019-01-22 17:53:46 -05:00
Samuel Dionne-Riel 2430b12ec9 Adds moment.js for client-side date manipulations 2019-01-21 19:57:22 -05:00
Eelco Dolstra e0d8dcfe2d
Merge pull request #619 from samueldr/feature/lazy_errors
Adds error messages to lazy tabs
2019-01-20 23:22:17 +01:00
Shea Levy b298ba4bbe
Merge branch 'pr-gitlabpulls' of git://github.com/nlewo/hydra 2019-01-11 10:08:23 -05:00
Maximilian Bosch aa87e7a52e
hydra-eval-jobs: fix maintainer resolution
Some time ago the data structure for maintainer descriptions in
`nixpkgs` changed from a simple attr set with maintainer emails as
values to an attribute set where the maintainer' nick is associated to
an attribute set with email, GitHub handle and full name.

Hydra can either parse a Nix list or fetches `shortName` from the
associated attribute set (which is used for `meta.licenses` as each
value in it contains a `shortName`). This behavior needs to be
replicated for maintainers to retrieve the emails for `hydra-notify`.

This change is backwards-compatible since `queryMetaStrings` is still
able to understand lists, so old versions of `nixpkgs` or packages using
the old maintainer data structure remain usable.
2018-12-29 14:47:03 +01:00
Janne Heß 3a70688985
Support $X-Request-Base for the Logo 2018-12-27 17:08:20 +01:00
Samuel Dionne-Riel dd188d3035 hydra-eval-jobs: Warn and resets maxHeapSize on bad values
This is because setting only the initial heap size to more than
the default value (or the configured value) will cause all initial evals
until maxHeapSize expands to the given value to abort.

The 1.1 multiplier comes from the the configured defaults on NixOS' hydra,
and from the previous multiplier used before
7876cf677c.
2018-12-21 22:57:07 -05:00
Eelco Dolstra 423c0440ea
Typo 2018-12-20 12:07:02 +01:00
Kevin Quick 8315e20ab5 Lighten delta mark to blend better with other column headers. 2018-12-16 22:34:22 -08:00
Kevin Quick dfce2ad69a Use rowspans to align Jobs reference in evaluations rendering 2018-12-16 22:26:44 -08:00
Kevin Quick 0e7593a4a1 Remove blank lines, consistent attribute quoting, use svg for delta header, column sizes. 2018-12-15 22:25:02 -08:00
Kevin Quick 5716e69767 Add job status headers (web useability for red/green colorblindness). 2018-12-15 11:58:26 -08:00
Samuel Dionne-Riel 51ce620681 Stops the pager from blocking at configurePhase (#618)
This is caused by the autoconf check for `nix-store` which is equivalent
to running this:

```
$ nix-store --timeout 123 -q
```

This would open the pager on a 2.1.1 version of nix.

```
$ nix-store --version
nix-store (Nix) 2.1.1
```

Setting `PAGER` to `cat` ensures the pager doesn't block the
configurePhase.

```
$ PAGER=cat nix-store --timeout 123 -q
```
2018-12-01 22:01:40 +00:00
Samuel Dionne-Riel ed85daf2ac User: jobs tab returns its error as a lazy error. 2018-12-01 13:40:41 -05:00
Samuel Dionne-Riel 9986053e73 Controllers: allows lazy tabs to return custom errors. 2018-12-01 13:40:41 -05:00
Antoine Eiche d9253543e4 plugin/GitLabPulls: support for using a personal access token (PAT)
In order to access protected or private repositories. Using the target
repository URL along with the merge-request ref instead of the source
repository url and branch is necessary to avoid running into issues if
the source repository is not actually accessible to the user Hydra is
authenticating as.

Thanks Alexei Robyn for this patch.
2018-11-20 16:27:40 +01:00
Rob Vermaas 14d5577bf8 Add duration to Slack notification. 2018-11-20 14:57:50 +01:00
Eelco Dolstra cd234f6a14
Merge pull request #529 from bennofs/feat-all-builds
feat: add /eval/<id>/builds endpoint
2018-11-19 17:36:19 +01:00
Eelco Dolstra f9870b5fce
Merge pull request #612 from input-output-hk/devops-1126
[DEVOPS-1126] throttle github status calls to remain under api ratelimits
2018-11-12 10:09:38 +01:00
Michael Bishop 7916c6b185 [DEVOPS-1126] throttle github status calls to remain under api ratelimits 2018-11-09 12:06:37 -04:00
Eelco Dolstra 1c44de1779
Merge pull request #567 from phile314/bitbucket_pulls
Add BitBucket pull request support
2018-11-06 10:48:37 +01:00
Antoine Eiche 0d2a2d8923 Add json output for the search API endpoint
This commit also add a test of this feature.

Note the search JSON output doesn't contain any jobs because they can
not be exported to JSON yet.

The JSON output on a search query matching a build looks like:

```
{
  "builds": [
    {
      "buildoutputs": {
        "out": {
          "path": "/nix/store/wdag3pznrvqk01byk989irg7rq3q2a2c-job"
        }
      },
      "finished": 0,
      "releasename": null,
      "starttime": null,
      "project": "sample",
      "buildproducts": {},
      "timestamp": 1541007629,
      "buildstatus": null,
      "nixname": "job",
      "drvpath": "/nix/store/n9zqndn7j7nyr6gg3bmxvw26cfmdwv2n-job.drv",
      "job": "job",
      "id": 1,
      "stoptime": null,
      "priority": 100,
      "system": "x86_64-linux",
      "jobsetevals": [
        1
      ],
      "jobset": "default",
      "buildmetrics": {}
    }
  ],
  "projects": [],
  "jobsets": [],
  "buildsdrv": []
}
```
2018-11-01 09:31:15 +01:00
Antoine Eiche dd1e4a92c0 api-test: make created project and jobset visible 2018-10-31 18:51:02 +01:00
Rob Vermaas adf59a3959
Merge pull request #604 from andir/single-build-restart
allow users with 'restart-jobs' role to restart individual builds
2018-10-31 12:26:35 +01:00