From f3dbad3df9f8c9c1aca873d74a34c6f9169133b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 23 Mar 2025 12:40:53 +0100 Subject: Evaluate canonical job ids Changelog: Added `jobid` command resolving job reference to canonical id --- src/Config.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Config.hs') diff --git a/src/Config.hs b/src/Config.hs index 08bc3f2..5631179 100644 --- a/src/Config.hs +++ b/src/Config.hs @@ -157,14 +157,14 @@ parseConfig contents = do Left $ prettyPosWithSource pos contents err Right conf -> Right conf -loadConfigForCommit :: MonadIO m => Commit -> m (Either String Config) -loadConfigForCommit commit = do - readCommittedFile commit configFileName >>= return . \case +loadConfigForCommit :: MonadIO m => Tree -> m (Either String Config) +loadConfigForCommit tree = do + readCommittedFile tree configFileName >>= return . \case Just content -> either (\_ -> Left $ "failed to parse " <> configFileName) Right $ parseConfig content Nothing -> Left $ configFileName <> " not found" -loadJobSetForCommit :: MonadIO m => Commit -> m DeclaredJobSet -loadJobSetForCommit commit = toJobSet <$> loadConfigForCommit commit +loadJobSetForCommit :: (MonadIO m, MonadFail m) => Commit -> m DeclaredJobSet +loadJobSetForCommit commit = return . toJobSet =<< loadConfigForCommit =<< getCommitTree commit where toJobSet configEither = JobSet { jobsetCommit = Just commit -- cgit v1.2.3