diff options
Diffstat (limited to 'Omni')
| -rw-r--r-- | Omni/Agent/Worker.hs | 23 | ||||
| -rw-r--r-- | Omni/Task/Core.hs | 4 |
2 files changed, 14 insertions, 13 deletions
diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs index 23dd759..59d576f 100644 --- a/Omni/Agent/Worker.hs +++ b/Omni/Agent/Worker.hs @@ -74,7 +74,7 @@ processTask worker task = do Log.info ["worker", "basing", taskBranch, "on", baseBranch] Git.checkout repo baseBranch else Log.info ["worker", "basing", taskBranch, "on live"] - + Git.createBranch repo taskBranch -- Run Amp @@ -173,17 +173,18 @@ findBaseBranch repo task = do let deps = TaskCore.taskDependencies task -- Filter for blocking dependencies let blockingDeps = filter (\d -> TaskCore.depType d == TaskCore.Blocks || TaskCore.depType d == TaskCore.ParentChild) deps - + -- Check if any have unmerged branches - candidates <- flip filterM blockingDeps <| \dep -> do - let branch = "task/" <> TaskCore.depId dep - exists <- Git.branchExists repo branch - if exists - then do - merged <- Git.isMerged repo branch "live" - pure (not merged) - else pure False - + candidates <- + flip filterM blockingDeps <| \dep -> do + let branch = "task/" <> TaskCore.depId dep + exists <- Git.branchExists repo branch + if exists + then do + merged <- Git.isMerged repo branch "live" + pure (not merged) + else pure False + case candidates of (candidate : _) -> pure ("task/" <> TaskCore.depId candidate) [] -> pure "live" diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index 24bb31c..bab1912 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -268,7 +268,7 @@ loadTasksInternal = do taskStatus' = KM.lookup "taskStatus" obj +> parseMaybe Aeson.parseJSON taskCreatedAt' = KM.lookup "taskCreatedAt" obj +> parseMaybe Aeson.parseJSON taskUpdatedAt' = KM.lookup "taskUpdatedAt" obj +> parseMaybe Aeson.parseJSON - + -- Extract taskDescription (new field) taskDescription' = KM.lookup "taskDescription" obj +> parseMaybe Aeson.parseJSON @@ -645,7 +645,7 @@ showTaskDetailed t = do putText "" putText "Dependencies:" traverse_ printDependency (taskDependencies t) - + -- Show description case taskDescription t of Nothing -> pure () |
