fix(jobPatched) Removed too frequent filtering of variables

Removed excessive disposal of environment variables containing paths to nix store package files,
plus improved tests for this functionality.
This commit is contained in:
Skryta Istota 2025-11-30 12:33:55 +01:00
parent f84edb7760
commit d2f8a70675
No known key found for this signature in database
2 changed files with 6 additions and 7 deletions

View file

@ -3,7 +3,7 @@
helpers, helpers,
}: let }: let
inherit (lib) toList optionalAttrs optional; inherit (lib) toList optionalAttrs optional;
inherit (helpers) prependToBeforeScript appendToAfterScript filterJobVariables; inherit (helpers) prependToBeforeScript appendToAfterScript;
in in
{ {
key, key,
@ -18,9 +18,8 @@ in
)) ))
// optionalAttrs nixConfig.enable ( // optionalAttrs nixConfig.enable (
(let (let
variables = variables = job.variables or {} //
(filterJobVariables false job) optionalAttrs nixConfig.enableRunnerCache {
// optionalAttrs nixConfig.enableRunnerCache {
NIX_CI_CACHE_STRATEGY = "runner"; NIX_CI_CACHE_STRATEGY = "runner";
}; };
in in

View file

@ -88,7 +88,7 @@
after_script = [ "finalize_nix_ci" ]; after_script = [ "finalize_nix_ci" ];
before_script = [ "source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\"" ]; before_script = [ "source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\"" ];
variables = { variables = {
#BASH = toString pkgs.bash; BASH = toString pkgs.bash;
TEST = "work"; TEST = "work";
}; };
cache = [{ cache = [{
@ -129,7 +129,7 @@
}]; }];
variables = { variables = {
NIX_CI_CACHE_STRATEGY = "runner"; NIX_CI_CACHE_STRATEGY = "runner";
#BASH = toString pkgs.bash; BASH = toString pkgs.bash;
TEST = "work"; TEST = "work";
}; };
}; };
@ -264,7 +264,7 @@
}]; }];
variables = { variables = {
SAMPLE = "working"; SAMPLE = "working";
#HELLO = toString pkgs.hello; HELLO = toString pkgs.hello;
NIX_CI_CACHE_STRATEGY = "runner"; NIX_CI_CACHE_STRATEGY = "runner";
}; };
}; };