summary refs log tree commit diff
path: root/maintainers/scripts
diff options
context:
space:
mode:
authorDennis Gosnell <cdep.illabout@gmail.com>2023-03-25 17:44:26 +0900
committerDennis Gosnell <cdep.illabout@gmail.com>2023-03-25 17:44:26 +0900
commitc574a8c37ee12ddbbb4477544b57ca2c7a5e2536 (patch)
tree93be35dc89ff52a2412513796e3186910cac9cf4 /maintainers/scripts
parentbca997abb7d64babf42bf9502ec89f57579a6393 (diff)
haskellPackages: add a little documentation to hydra-report.hs
Diffstat (limited to 'maintainers/scripts')
-rwxr-xr-xmaintainers/scripts/haskell/hydra-report.hs29
1 files changed, 28 insertions, 1 deletions
diff --git a/maintainers/scripts/haskell/hydra-report.hs b/maintainers/scripts/haskell/hydra-report.hs
index bc00cd1290288..1370295b9f24e 100755
--- a/maintainers/scripts/haskell/hydra-report.hs
+++ b/maintainers/scripts/haskell/hydra-report.hs
@@ -51,6 +51,7 @@ import qualified Data.Set as Set
 import Data.Text (Text)
 import qualified Data.Text as Text
 import Data.Text.Encoding (encodeUtf8)
+import qualified Data.Text.IO as Text
 import Data.Time (defaultTimeLocale, formatTime, getCurrentTime)
 import Data.Time.Clock (UTCTime)
 import GHC.Generics (Generic)
@@ -104,13 +105,36 @@ data Eval = Eval
    }
    deriving (Generic, ToJSON, FromJSON, Show)
 
+-- | Datatype representing the result of querying the build evals of the
+-- haskell-updates Hydra jobset.
+--
+-- The URL <https://hydra.nixos.org/eval/EVAL_ID/builds> (where @EVAL_ID@ is a
+-- value like 1792418) returns a list of 'Build'.
 data Build = Build
    { job :: Text
+     -- ^ Hydra job name.
+     --
+     -- Examples:
+     -- - @"haskellPackages.lens.x86_64-linux"@
+     -- - @"haskell.packages.ghc925.cabal-install.aarch64-darwin"@
    , buildstatus :: Maybe Int
+     -- ^ Status of the build.  See 'getBuildState' for the meaning of each state.
    , finished :: Int
+     -- ^ Whether or not the build is finished.  @0@ if finished, non-zero otherwise.
    , id :: Int
    , nixname :: Text
+     -- ^ Nix name of the derivation.
+     --
+     -- Examples:
+     -- - @"lens-5.2.1"@
+     -- - @"cabal-install-3.8.0.1"@
+     -- - @"lens-static-x86_64-unknown-linux-musl-5.1.1"@
    , system :: Text
+     -- ^ System
+     --
+     -- Examples:
+     -- - @"x86_64-linux"@
+     -- - @"aarch64-darwin"@
    , jobsetevals :: Seq Int
    }
    deriving (Generic, ToJSON, FromJSON, Show)
@@ -540,7 +564,10 @@ printMaintainerPing = do
       let tops = take 50 . sortOn (negate . snd) . fmap (second fst) . filter (\x -> maybe False broken $ Map.lookup (fst x) depMap) . Map.toList $ rdepMap
       pure (rdepMap, tops)
    (eval, fetchTime, buildReport) <- readBuildReports
-   putStrLn (Text.unpack (printBuildSummary eval fetchTime (buildSummary maintainerMap reverseDependencyMap buildReport) topBrokenRdeps))
+   let buildSum :: StatusSummary
+       buildSum = buildSummary maintainerMap reverseDependencyMap buildReport
+       textBuildSummary = printBuildSummary eval fetchTime buildSum topBrokenRdeps
+   Text.putStrLn textBuildSummary
 
 printMarkBrokenList :: IO ()
 printMarkBrokenList = do