packages feed

hercules-ci-agent 0.10.3 → 0.10.4

raw patch · 3 files changed

+15/−8 lines, 3 filesdep +file-embedPVP ok

version bump matches the API change (PVP)

Dependencies added: file-embed

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -5,6 +5,12 @@ 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). +## [0.10.4] - 2024-06-12++### Fixed++ - Embed data file to make packaging easier.+ ## [0.10.3] - 2024-05-19  ### Fixed
hercules-ci-agent.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4  name:           hercules-ci-agent-version:        0.10.3+version:        0.10.4 synopsis:       Runs Continuous Integration tasks on your machines category:       Nix, CI, Testing, DevOps homepage:       https://docs.hercules-ci.com@@ -17,9 +17,8 @@     cbits/hercules-error.hh     cbits/hercules-logger.hh     cbits/nix-2.4/hercules-store.hh-    testdata/vm-test-run-agent-test.drv-data-files:     data/default-herculesCI-for-flake.nix+    testdata/vm-test-run-agent-test.drv  flag nix-2_15   description: Build for Nix >=2.15.0@@ -155,6 +154,7 @@     , directory     , dlist     , exceptions+    , file-embed     , filepath     , hercules-ci-api-agent     , hercules-ci-api-core
src/Hercules/Agent/NixFile.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE OverloadedLabels #-}+{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-}  module Hercules.Agent.NixFile@@ -32,6 +33,7 @@ where  import Control.Monad.Trans.Maybe (MaybeT (MaybeT), runMaybeT)+import Data.FileEmbed (embedFileRelative) import Data.Map qualified as M import Data.Type.Equality (type (~)) import Hercules.API.Agent.Evaluate.EvaluateEvent.InputDeclaration (InputDeclaration (SiblingInput), SiblingInput (MkSiblingInput))@@ -46,7 +48,6 @@     Match (IsAttrs),     NixAttrs,     Value (Value, rtValue),-    addAllowedPath,     assertType,     autoCallFunction,     evalFile,@@ -62,7 +63,6 @@ import Hercules.CNix.Expr.Schema (Attrs, Dictionary, MonadEval, PSObject (PSObject), Provenance (Other), StringWithoutContext, basicAttrsWithProvenance, dictionaryToMap, fromPSObject, toPSObject, (#.), (#?), ($?), (.$), (>>$.), type (->.), type (->?), type (.), type (::.), type (::?), type (::??), type (?), type (|.)) import Hercules.CNix.Expr.Schema qualified as Schema import Hercules.Error (escalateAs)-import Paths_hercules_ci_agent (getDataFileName) import Protolude hiding (evalState) import System.Directory qualified as Dir import System.FilePath (takeDirectory, takeFileName, (</>))@@ -324,10 +324,11 @@         & fmap join     _ -> pure Nothing +defaultHerculesCIAttrFileContents :: ByteString+defaultHerculesCIAttrFileContents = $(embedFileRelative "data/default-herculesCI-for-flake.nix")+ loadDefaultHerculesCI :: (MonadEval m) => m (PSObject DefaultHerculesCIHelperSchema) loadDefaultHerculesCI = do-  fname <- liftIO $ getDataFileName "data/default-herculesCI-for-flake.nix"   evalState <- ask-  liftIO $ addAllowedPath evalState . encodeUtf8 . toS $ fname-  v <- liftIO $ evalFile evalState fname+  v <- liftIO $ valueFromExpressionString evalState defaultHerculesCIAttrFileContents "/"   pure (PSObject {value = v, provenance = Other "<default herculesCI helper shim>"})