Merge pull request #257047 from minijackson/netbox-3.6.2

This commit is contained in:
Ryan Lahfa 2023-09-27 18:50:54 +02:00 committed by GitHub
commit e909050efd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 47 additions and 35 deletions

View File

@ -128,6 +128,8 @@
- A list of all extras (and the extras enabled by default) can be found at the [option's reference for `services.matrix-synapse.extras`](#opt-services.matrix-synapse.extras).
- In some cases (e.g. for running synapse workers) it was necessary to re-use the `PYTHONPATH` of `matrix-synapse.service`'s environment to have all plugins available. This isn't necessary anymore, instead `config.services.matrix-synapse.package` can be used as it points to the wrapper with properly configured `extras` and also all plugins defined via [`services.matrix-synapse.plugins`](#opt-services.matrix-synapse.plugins) available. This is also the reason for why the option is read-only now, it's supposed to be set by the module only.
- `netbox` was updated to 3.6. NixOS' `services.netbox.package` still defaults to 3.5 if `stateVersion` is earlier than 23.11. Please review upstream's breaking changes [for 3.6.0](https://github.com/netbox-community/netbox/releases/tag/v3.6.0) and upgrade NetBox by changing `services.netbox.package`. Database migrations will be run automatically.
- `etcd` has been updated to 3.5, you will want to read the [3.3 to 3.4](https://etcd.io/docs/v3.5/upgrades/upgrade_3_4/) and [3.4 to 3.5](https://etcd.io/docs/v3.5/upgrades/upgrade_3_5/) upgrade guides
- `gitlab` installations created or updated between versions \[15.11.0, 15.11.2] have an incorrect database schema. This will become a problem when upgrading to `gitlab` >=16.2.0. A workaround for affected users can be found in the [GitLab docs](https://docs.gitlab.com/ee/update/versions/gitlab_16_changes.html#undefined-column-error-upgrading-to-162-or-later).

View File

@ -74,9 +74,18 @@ in {
package = lib.mkOption {
type = lib.types.package;
default = if lib.versionAtLeast config.system.stateVersion "23.05" then pkgs.netbox else pkgs.netbox_3_3;
default =
if lib.versionAtLeast config.system.stateVersion "23.11"
then pkgs.netbox_3_6
else if lib.versionAtLeast config.system.stateVersion "23.05"
then pkgs.netbox_3_5
else pkgs.netbox_3_3;
defaultText = lib.literalExpression ''
if versionAtLeast config.system.stateVersion "23.05" then pkgs.netbox else pkgs.netbox_3_3;
if lib.versionAtLeast config.system.stateVersion "23.11"
then pkgs.netbox_3_6
else if lib.versionAtLeast config.system.stateVersion "23.05"
then pkgs.netbox_3_5
else pkgs.netbox_3_3;
'';
description = lib.mdDoc ''
NetBox package to use.

View File

@ -531,8 +531,8 @@ in {
netdata = handleTest ./netdata.nix {};
networking.networkd = handleTest ./networking.nix { networkd = true; };
networking.scripted = handleTest ./networking.nix { networkd = false; };
netbox = handleTest ./web-apps/netbox.nix { inherit (pkgs) netbox; };
netbox_3_3 = handleTest ./web-apps/netbox.nix { netbox = pkgs.netbox_3_3; };
netbox_3_5 = handleTest ./web-apps/netbox.nix { netbox = pkgs.netbox_3_5; };
netbox_3_6 = handleTest ./web-apps/netbox.nix { netbox = pkgs.netbox_3_6; };
netbox-upgrade = handleTest ./web-apps/netbox-upgrade.nix {};
# TODO: put in networking.nix after the test becomes more complete
networkingProxy = handleTest ./networking-proxy.nix {};

View File

@ -1,13 +1,15 @@
import ../make-test-python.nix ({ lib, pkgs, ... }: let
oldNetbox = pkgs.netbox_3_3;
oldNetbox = pkgs.netbox_3_5;
newNetbox = pkgs.netbox_3_6;
in {
name = "netbox-upgrade";
meta = with lib.maintainers; {
maintainers = [ minijackson ];
maintainers = [ minijackson raitobezarius ];
};
nodes.machine = { config, ... }: {
virtualisation.memorySize = 2048;
services.netbox = {
enable = true;
package = oldNetbox;
@ -32,7 +34,7 @@ in {
networking.firewall.allowedTCPPorts = [ 80 ];
specialisation.upgrade.configuration.services.netbox.package = lib.mkForce pkgs.netbox;
specialisation.upgrade.configuration.services.netbox.package = lib.mkForce newNetbox;
};
testScript = { nodes, ... }:
@ -43,7 +45,7 @@ in {
(lib.concatStringsSep ".")
];
oldApiVersion = apiVersion oldNetbox.version;
newApiVersion = apiVersion pkgs.netbox.version;
newApiVersion = apiVersion newNetbox.version;
in
''
start_all()

View File

@ -16,6 +16,7 @@ in import ../make-test-python.nix ({ lib, pkgs, netbox, ... }: {
};
nodes.machine = { config, ... }: {
virtualisation.memorySize = 2048;
services.netbox = {
enable = true;
package = netbox;

View File

@ -1,31 +1,11 @@
{ lib, nixosTests, callPackage, fetchpatch }:
{ lib, nixosTests, callPackage, }:
let
generic = import ./generic.nix;
in
{
netbox_3_3 = callPackage generic {
version = "3.3.10";
hash = "sha256-MeOfTU5IxNDoUh7FyvwAQNRC/CE0R6p40WnlF+3RuxA=";
extraPatches = [
# Allow setting the STATIC_ROOT from within the configuration and setting a custom redis URL
./config_3_3.patch
./graphql-3_2_0.patch
# fix compatibility ith django 4.1
(fetchpatch {
url = "https://github.com/netbox-community/netbox/pull/10341/commits/ce6bf9e5c1bc08edc80f6ea1e55cf1318ae6e14b.patch";
sha256 = "sha256-aCPQp6k7Zwga29euASAd+f13hIcZnIUu3RPAzNPqgxc=";
})
];
lib.fix (self: {
netbox = self.netbox_3_6;
tests = {
netbox = nixosTests.netbox_3_3;
inherit (nixosTests) netbox-upgrade;
};
maintainers = with lib.maintainers; [ n0emis raitobezarius ];
eol = true;
};
netbox = callPackage generic {
netbox_3_5 = callPackage generic {
version = "3.5.9";
hash = "sha256-CJbcuCyTuihDXrObSGyJi2XF+zgWAwcJzjxtkX8pmKs=";
extraPatches = [
@ -33,9 +13,26 @@ in
./config.patch
];
tests = {
inherit (nixosTests) netbox netbox-upgrade;
netbox = nixosTests.netbox_3_5;
inherit (nixosTests) netbox-upgrade;
};
maintainers = with lib.maintainers; [ minijackson n0emis raitobezarius ];
eol = true;
};
netbox_3_6 = callPackage generic {
version = "3.6.3";
hash = "sha256-8Xir2Gvwh2cllHu5qVAzumuH0lknMMtjd8BuFuuf9A0=";
extraPatches = [
# Allow setting the STATIC_ROOT from within the configuration and setting a custom redis URL
./config.patch
];
tests = {
netbox = nixosTests.netbox_3_6;
inherit (nixosTests) netbox-upgrade;
};
maintainers = with lib.maintainers; [ minijackson n0emis raitobezarius ];
};
}
})

View File

@ -1183,6 +1183,7 @@ mapAliases ({
nccl_cudatoolkit_11 = throw "nccl_cudatoolkit_11 has been renamed to cudaPackages_11.nccl"; # Added 2022-04-04
net_snmp = throw "'net_snmp' has been renamed to/replaced by 'net-snmp'"; # Converted to throw 2023-09-10
netbox_3_3 = throw "netbox 3.3 series has been removed as it was EOL"; # Added 2023-09-02
nagiosPluginsOfficial = monitoring-plugins;
navit = throw "navit has been removed from nixpkgs, due to being unmaintained"; # Added 2021-06-07
ncat = throw "'ncat' has been renamed to/replaced by 'nmap'"; # Converted to throw 2022-02-22

View File

@ -11081,7 +11081,7 @@ with pkgs;
netbootxyz-efi = callPackage ../tools/misc/netbootxyz-efi { };
inherit (callPackage ../servers/web-apps/netbox { })
netbox_3_3 netbox;
netbox netbox_3_5 netbox_3_6;
netbox2netshot = callPackage ../tools/admin/netbox2netshot { };