diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-07-05 22:57:49 +0200 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-07-09 19:45:40 +0200 |
| commit | 0b3b675bfc9e78ee563d526f17184e317a962ae8 (patch) | |
| tree | d88a9a768338435cdcc4d316902b3dba30dbb397 /src/Expression.hs | |
| parent | 439481ad37868c732fa68fc31b65c581d0dcd7fa (diff) | |
Diffstat (limited to 'src/Expression.hs')
| -rw-r--r-- | src/Expression.hs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Expression.hs b/src/Expression.hs index cd6c9dc..6b1adc9 100644 --- a/src/Expression.hs +++ b/src/Expression.hs @@ -19,6 +19,7 @@ import Data.Maybe import Data.Text (Text) import Job.Types +import Output import Repo @@ -62,13 +63,17 @@ textCommitRef :: CommitRef -> Text textCommitRef (CommitRef suffix cid) = textCommitId cid <> suffix -evaluateDeclaredRevision :: (MonadIO m, MonadFail m) => Repo -> DeclaredRevisionExpression -> m RevisionExpression +evaluateDeclaredRevision :: (MonadIO m, MonadFail m, MonadOutput m) => Repo -> DeclaredRevisionExpression -> m RevisionExpression evaluateDeclaredRevision repo = \case StaticRef ref -> StaticRef <$> readCommit repo ref - WatchedRef ref -> WatchedRef . BranchRef <$> watchBranch repo ref + WatchedRef ref -> do + watched <- watchBranch repo ref + output <- getOutput + outputEvent output $ TestMessage $ "watch-branch-started " <> ref + return $ WatchedRef $ BranchRef watched ModifiedRevision suffix rev -> ModifiedRevision suffix <$> evaluateDeclaredRevision repo rev -evaluateDeclaredRange :: (MonadIO m, MonadFail m) => Repo -> DeclaredRangeExpression -> m RangeExpression +evaluateDeclaredRange :: (MonadIO m, MonadFail m, MonadOutput m) => Repo -> DeclaredRangeExpression -> m RangeExpression evaluateDeclaredRange repo (RangeExpression a b) = RangeExpression <$> evaluateDeclaredRevision repo a <*> evaluateDeclaredRevision repo b |