Skip to content

Commit

Permalink
Merge pull request #98973 from Ma27/bump-hydra
Browse files Browse the repository at this point in the history
hydra-unstable: 2020-09-02 -> 2020-10-20
  • Loading branch information
edolstra authored Oct 22, 2020
2 parents d82e635 + 1308817 commit 05bdfd6
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 152 deletions.
33 changes: 2 additions & 31 deletions nixos/modules/services/continuous-integration/hydra/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ let

haveLocalDB = cfg.dbi == localDB;

inherit (config.system) stateVersion;

hydra-package =
let
makeWrapperArgs = concatStringsSep " " (mapAttrsToList (key: value: "--set \"${key}\" \"${value}\"") hydraEnv);
Expand Down Expand Up @@ -96,7 +94,8 @@ in

package = mkOption {
type = types.package;
defaultText = "pkgs.hydra";
default = pkgs.hydra-unstable;
defaultText = "pkgs.hydra-unstable";
description = "The Hydra package.";
};

Expand Down Expand Up @@ -225,34 +224,6 @@ in

config = mkIf cfg.enable {

warnings = optional (cfg.package.migration or false) ''
You're currently deploying an older version of Hydra which is needed to
make some required database changes[1]. As soon as this is done, it's recommended
to run `hydra-backfill-ids` and set `services.hydra.package` to `pkgs.hydra-unstable`
after that.
[1] https://github.com/NixOS/hydra/pull/711
'';

services.hydra.package = with pkgs;
mkDefault (
if pkgs ? hydra
then throw ''
The Hydra package doesn't exist anymore in `nixpkgs`! It probably exists
due to an overlay. To upgrade Hydra, you need to take two steps as some
bigger changes in the database schema were implemented recently[1]. You first
need to deploy `pkgs.hydra-migration`, run `hydra-backfill-ids` on the server
and then deploy `pkgs.hydra-unstable`.
If you want to use `pkgs.hydra` from your overlay, please set `services.hydra.package`
explicitly to `pkgs.hydra` and make sure you know what you're doing.
[1] https://github.com/NixOS/hydra/pull/711
''
else if versionOlder stateVersion "20.03" then hydra-migration
else hydra-unstable
);

users.groups.hydra = {
gid = config.ids.gids.hydra;
};
Expand Down
1 change: 0 additions & 1 deletion nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ in
hostname = handleTest ./hostname.nix {};
hound = handleTest ./hound.nix {};
hydra = handleTest ./hydra {};
hydra-db-migration = handleTest ./hydra/db-migration.nix {};
i3wm = handleTest ./i3wm.nix {};
icingaweb2 = handleTest ./icingaweb2.nix {};
iftop = handleTest ./iftop.nix {};
Expand Down
92 changes: 0 additions & 92 deletions nixos/tests/hydra/db-migration.nix

This file was deleted.

2 changes: 1 addition & 1 deletion nixos/tests/hydra/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let
inherit (import ./common.nix { inherit system; }) baseConfig;

hydraPkgs = {
inherit (pkgs) hydra-migration hydra-unstable;
inherit (pkgs) hydra-unstable;
};

makeHydraTest = with pkgs.lib; name: package: makeTest {
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/tools/misc/hydra/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ let
TextDiff
TextTable
XMLSimple
YAML
nix
nix.perl-bindings
git
Expand Down
29 changes: 3 additions & 26 deletions pkgs/development/tools/misc/hydra/default.nix
Original file line number Diff line number Diff line change
@@ -1,40 +1,17 @@
{ fetchFromGitHub, nixStable, callPackage, nixFlakes, nixosTests }:

{
# Package for phase-1 of the db migration for Hydra.
# https://github.com/NixOS/hydra/pull/711
hydra-migration = callPackage ./common.nix {
version = "2020-02-10";
src = fetchFromGitHub {
owner = "NixOS";
repo = "hydra";
rev = "add4f610ce6f206fb44702b5a894d877b3a30e3a";
sha256 = "1d8hdgjx2ys0zmixi2ydmimdq7ml20h1ji4amwawcyw59kssh6l3";
};
nix = nixStable;
migration = true;

tests = {
db-migration = nixosTests.hydra-db-migration.mig;
basic = nixosTests.hydra.hydra-migration;
};
};

# Hydra from latest master branch. Contains breaking changes,
# so when having an older version, `pkgs.hydra-migration` should be deployed first.

hydra-unstable = callPackage ./common.nix {
version = "2020-09-02";
version = "2020-10-20";
src = fetchFromGitHub {
owner = "NixOS";
repo = "hydra";
rev = "e707990e2d6afab203c7ef1d769d49c564eff151";
sha256 = "0iilf953f6s58szzyd1hzc9b2b2yw8lhbsb8xrb08szpfz7ifwqa";
rev = "79d34ed7c93af2daf32cf44ee0e3e0768f13f97c";
sha256 = "1lql899430137l6ghnhyz0ivkayy83fdr087ck2wq3gf1jv8pccj";
};
nix = nixFlakes;

tests = {
db-migration = nixosTests.hydra-db-migration.mig;
basic = nixosTests.hydra.hydra-unstable;
};
};
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13042,7 +13042,7 @@ in
hwloc = callPackage ../development/libraries/hwloc {};

inherit (callPackage ../development/tools/misc/hydra { })
hydra-migration hydra-unstable;
hydra-unstable;

hydra-flakes = throw ''
Flakes support has been merged into Hydra's master. Please use
Expand Down

0 comments on commit 05bdfd6

Please sign in to comment.