hercules-ci-agent 0.9.8 → 0.9.9
raw patch · 5 files changed
+56/−18 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +11/−1
- data/default-herculesCI-for-flake.nix +37/−11
- hercules-ci-agent.cabal +1/−1
- hercules-ci-agent/Hercules/Agent.hs +1/−1
- hercules-ci-agent/Hercules/Agent/Nix/Init.hs +6/−4
CHANGELOG.md view
@@ -5,8 +5,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## [0.9.9] - 2022-12-02++### Fixed++ - The flake `templates` check now allows filtered sources.++ - Tweaks to diagnostic messages++## [0.9.8] - 2022-11-15+ ### Added - `herculesCI.onSchedule` jobs, which a created at set times. These can be used@@ -632,6 +641,7 @@ - Initial release +[0.9.8]: https://github.com/hercules-ci/hercules-ci-agent/compare/hercules-ci-agent-0.9.7...hercules-ci-agent-0.9.8 [0.9.7]: https://github.com/hercules-ci/hercules-ci-agent/compare/hercules-ci-agent-0.9.6...hercules-ci-agent-0.9.7 [0.9.6]: https://github.com/hercules-ci/hercules-ci-agent/compare/hercules-ci-agent-0.9.5...hercules-ci-agent-0.9.6 [0.9.5]: https://github.com/hercules-ci/hercules-ci-agent/compare/hercules-ci-agent-0.9.3...hercules-ci-agent-0.9.5
data/default-herculesCI-for-flake.nix view
@@ -11,6 +11,7 @@ intersectAttrs listToAttrs mapAttrs+ typeOf ; # lib@@ -115,6 +116,41 @@ then throw "Attribute is not a shell derivation" else drv // { buildDependenciesOnly = true; }; + hasPrefix = pre: s: builtins.substring 0 (builtins.stringLength pre) s == pre;++ stringIsStorePath = s: hasPrefix builtins.storeDir (dirOf s);++ isPathLike =+ v: (builtins.typeOf v == "path" && stringIsStorePath (toString v))+ || (builtins.typeOf v == "string" && stringIsStorePath v)+ || (v?__toString && isPathLike (v.__toString v))+ || (v?outPath && isPathLike v.outPath);++ checkTemplate = name: template:+ if !builtins.isAttrs template+ then throw "Template `templates.${name}` is not an attribute set."++ else if !template?description+ then throw "Template `templates.${name}` does not have a `description` string attribute."++ else if typeOf template.description != "string"+ then throw "`templates.${name}.description` must be a string, but its type is ${typeOf template.description}."++ else if !template?path+ then throw "Template `templates.${name}` does not have a `path` attribute."++ else if !isPathLike template.path+ then+ if builtins.typeOf template.path == "string" ||+ builtins.typeOf template.path == "path"+ then throw "`templates.${name}.path` must be a path value in the store, or a string representing a store path, or an attribute set coercible to such values (e.g. cleanSource return value). However, the value is ${toString template.path}"+ else throw "`templates.${name}.path` must be a path value in the store, or a string representing a store path, or an attribute set coercible to such values (e.g. cleanSource return value). However, the type is ${builtins.typeOf template.path}"++ else if !(builtins.pathExists template.path)+ then throw "Template path `templates.${name}.path` points to a location that does not exist."++ else template;+ translations = let ignore = args: x: null;@@ -131,17 +167,7 @@ nixosConfigurations = args: attrs: mapAttrs (k: sys: { config.system.build.toplevel = sys.config.system.build.toplevel; }) (filterSystemConfigs args.ciSystems attrs); darwinConfigurations = args: attrs: mapAttrs (k: sys: { config.system.build.toplevel = sys.config.system.build.toplevel; }) (filterSystemConfigs args.ciSystems attrs); formatter = forSystems (sys: formatter: formatter);- templates = args: attrs: mapAttrs- (name: template:- if builtins.typeOf (template.description or null) != "string"- then throw "Template `templates.${name}` does not have a `description` string attribute."- else if builtins.typeOf template.path != "path"- then throw "Template `templates.${name}` does not have a `path` attribute, containing a path value."- else if !(builtins.pathExists template.path)- then throw "Template path `templates.${name}.path` points to a directory that does not exist."- else template- )- attrs;+ templates = args: attrs: mapAttrs checkTemplate attrs; effects = args: effects: if builtins.isAttrs effects
hercules-ci-agent.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4 name: hercules-ci-agent-version: 0.9.8+version: 0.9.9 synopsis: Runs Continuous Integration tasks on your machines category: Nix, CI, Testing, DevOps homepage: https://docs.hercules-ci.com
hercules-ci-agent/Hercules/Agent.hs view
@@ -100,7 +100,7 @@ configChecks = do trusted <- asks (Config.nixUserIsTrusted . Env.config) when (not trusted) do- logLocM WarningS "Your config does not indicate you have set up your user as a trusted user on the system. Running the agent as a trusted user ensures that your cache configuration is compatible with the system and improves performance if you have more than one agent. The NixOS and nix-darwin modules should configure this automatically. If this agent was set up with a manually written config file, see https://docs.hercules-ci.com/hercules-ci/reference/agent-config/"+ logLocM WarningS "Your config does not indicate you have set up the user that runs the agent as a trusted-user on the system. Running the agent as a trusted-user ensures that your cache configuration is compatible with the system and it improves performance. The NixOS and nix-darwin modules configure this automatically. If this agent was set up with a manually written config file, add the user that runs the agent to nix.settings.trusted-users in your system configuration, or add it to the trusted-users line in your system nix.conf." run :: Env.Env -> Config.FinalConfig -> IO () run env _cfg = do
hercules-ci-agent/Hercules/Agent/Nix/Init.hs view
@@ -7,23 +7,25 @@ newEnv :: IO Env newEnv = do nixInfo <- EnvironmentInfo.getNixInfo- print nixInfo when (EnvironmentInfo.nixNarinfoCacheNegativeTTL nixInfo /= 0) $ do putErrText "\n\- \We have detected that the setting narinfo-cache-negative-ttl is non-zero.\n\+ \We have detected that the Nix setting narinfo-cache-negative-ttl is non-zero.\n\ \Running hercules-ci-agent on a system with a non-zero negative ttl will cause\n\ \problems when run in a cluster.\n\ \Note that this setting only affects the caching of paths that are *missing*\n\ \from a cache. Paths that *are* in the binary cache are cached as configured in\n\- \the 'positive' option.\n\+ \the narinfo-cache-positive-ttl option. You don't need to configure the positive\n\+ \option. \n\ \\n\ \On NixOS and nix-darwin, use the recommended installation method via module,\n\ \make sure that the `narinfo-cache-negative-ttl` isn't set via other means.\n\ \If you can't use the module, use\+ \ nix.settings.narinfo-cache-negative-ttl = 0;\n\+ \ or\n\ \ nix.extraOptions = \"narinfo-cache-negative-ttl = 0\"\n\ \\n\- \or add to your system nix.conf:\n\+ \or add to your system /etc/nix/nix.conf:\n\ \ narinfo-cache-negative-ttl = 0\n\ \n" throwIO $ FatalError "Please configure your system's Nix with: narinfo-cache-negative-ttl = 0 "