From 75f57ad0287c8aa1a217ec90cbc8533cc3b8d799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 9 Apr 2025 22:37:59 +0200 Subject: Run: default jobs without containing repo --- src/Command/Run.hs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/Command') diff --git a/src/Command/Run.hs b/src/Command/Run.hs index e117c57..61a4620 100644 --- a/src/Command/Run.hs +++ b/src/Command/Run.hs @@ -253,11 +253,18 @@ cmdRun (RunCommand RunOptions {..} args) = do argumentJobs <- argumentJobSource jobOptions - let rangeOptions' - | null rangeOptions, null roNewCommitsOn, null roNewTags, null jobOptions = [ ( Nothing, "HEAD" ) ] - | otherwise = rangeOptions + defaultSource <- getJobRoot >>= \case + _ | not (null rangeOptions && null roNewCommitsOn && null roNewTags && null jobOptions) -> do + emptyJobSource - ranges <- forM rangeOptions' $ \( mbBase, paramTip ) -> do + JobRootRepo repo -> do + Just base <- findUpstreamRef repo "HEAD" + rangeSource base "HEAD" + + JobRootConfig config -> do + argumentJobSource (jobName <$> configJobs config) + + ranges <- forM rangeOptions $ \( mbBase, paramTip ) -> do ( base, tip ) <- case mbBase of Just base -> return ( base, paramTip ) Nothing -> do @@ -271,7 +278,7 @@ cmdRun (RunCommand RunOptions {..} args) = do liftIO $ do mngr <- newJobManager storageDir optJobs - source <- mergeSources $ concat [ [ argumentJobs ], ranges, branches, tags ] + source <- mergeSources $ concat [ [ defaultSource, argumentJobs ], ranges, branches, tags ] headerLine <- newLine tout "" threadCount <- newTVarIO (0 :: Int) -- cgit v1.2.3