scripts/haskell/hydra-report: use inline emoji

GitHub broke the rendering of colon emoji codes inside square brackets;
let's just use emoji.
This commit is contained in:
Naïm Favier
2023-12-03 13:06:38 +01:00
parent 4ed2fdd34b
commit 5f1da6e045
+18 -18
View File
@@ -382,22 +382,22 @@ data BuildState
icon :: BuildState -> Text icon :: BuildState -> Text
icon = \case icon = \case
Failed -> ":x:" Failed -> ""
DependencyFailed -> ":heavy_exclamation_mark:" DependencyFailed -> ""
OutputLimitExceeded -> ":warning:" OutputLimitExceeded -> "⚠️"
Unknown x -> "unknown code " <> showT x Unknown x -> "unknown code " <> showT x
TimedOut -> ":hourglass::no_entry_sign:" TimedOut -> "⌛🚫"
Canceled -> ":no_entry_sign:" Canceled -> "🚫"
Unfinished -> ":hourglass_flowing_sand:" Unfinished -> ""
HydraFailure -> ":construction:" HydraFailure -> "🚧"
Success -> ":heavy_check_mark:" Success -> ""
platformIcon :: Platform -> Text platformIcon :: Platform -> Text
platformIcon (Platform x) = case x of platformIcon (Platform x) = case x of
"x86_64-linux" -> ":penguin:" "x86_64-linux" -> "🐧"
"aarch64-linux" -> ":iphone:" "aarch64-linux" -> "📱"
"x86_64-darwin" -> ":apple:" "x86_64-darwin" -> "🍎"
"aarch64-darwin" -> ":green_apple:" "aarch64-darwin" -> "🍏"
_ -> x _ -> x
platformIsOS :: OS -> Platform -> Bool platformIsOS :: OS -> Platform -> Bool
@@ -626,7 +626,7 @@ printBuildSummary eval@Eval{id} fetchTime summary topBrokenRdeps =
<> optionalHideableList "#### Unmaintained packages with failed dependency" (unmaintainedList (failedDeps summary)) <> optionalHideableList "#### Unmaintained packages with failed dependency" (unmaintainedList (failedDeps summary))
<> optionalHideableList "#### Unmaintained packages with unknown error" (unmaintainedList (unknownErr summary)) <> optionalHideableList "#### Unmaintained packages with unknown error" (unmaintainedList (unknownErr summary))
<> optionalHideableList "#### Top 50 broken packages, sorted by number of reverse dependencies" (brokenLine <$> topBrokenRdeps) <> optionalHideableList "#### Top 50 broken packages, sorted by number of reverse dependencies" (brokenLine <$> topBrokenRdeps)
<> ["","*:arrow_heading_up:: The number of packages that depend (directly or indirectly) on this package (if any). If two numbers are shown the first (lower) number considers only packages which currently have enabled hydra jobs, i.e. are not marked broken. The second (higher) number considers all packages.*",""] <> ["","*⤴️: The number of packages that depend (directly or indirectly) on this package (if any). If two numbers are shown the first (lower) number considers only packages which currently have enabled hydra jobs, i.e. are not marked broken. The second (higher) number considers all packages.*",""]
<> footer <> footer
where where
footer = ["*Report generated with [maintainers/scripts/haskell/hydra-report.hs](https://github.com/NixOS/nixpkgs/blob/haskell-updates/maintainers/scripts/haskell/hydra-report.hs)*"] footer = ["*Report generated with [maintainers/scripts/haskell/hydra-report.hs](https://github.com/NixOS/nixpkgs/blob/haskell-updates/maintainers/scripts/haskell/hydra-report.hs)*"]
@@ -651,7 +651,7 @@ printBuildSummary eval@Eval{id} fetchTime summary topBrokenRdeps =
brokenLine :: (PkgName, Int) -> Text brokenLine :: (PkgName, Int) -> Text
brokenLine (PkgName name, rdeps) = brokenLine (PkgName name, rdeps) =
"[" <> name <> "](https://packdeps.haskellers.com/reverse/" <> name <> "[" <> name <> "](https://packdeps.haskellers.com/reverse/" <> name <>
") :arrow_heading_up: " <> Text.pack (show rdeps) <> " " ") ⤴️ " <> Text.pack (show rdeps) <> " "
numSummary = statusToNumSummary summary numSummary = statusToNumSummary summary
@@ -733,7 +733,7 @@ printBuildSummary eval@Eval{id} fetchTime summary topBrokenRdeps =
, Text.pack , Text.pack
( if summaryReverseDeps entry > 0 ( if summaryReverseDeps entry > 0
then then
" :arrow_heading_up: " <> show (summaryUnbrokenReverseDeps entry) <> " ⤴️ " <> show (summaryUnbrokenReverseDeps entry) <>
" | " <> show (summaryReverseDeps entry) " | " <> show (summaryReverseDeps entry)
else "" else ""
) )
@@ -750,9 +750,9 @@ printBuildSummary eval@Eval{id} fetchTime summary topBrokenRdeps =
) )
tldr = case (errors, warnings) of tldr = case (errors, warnings) of
([],[]) -> [":green_circle: **Ready to merge** (if there are no [evaluation errors](https://hydra.nixos.org/jobset/nixpkgs/haskell-updates))"] ([],[]) -> ["🟢 **Ready to merge** (if there are no [evaluation errors](https://hydra.nixos.org/jobset/nixpkgs/haskell-updates))"]
([],_) -> [":yellow_circle: **Potential issues** (and possibly [evaluation errors](https://hydra.nixos.org/jobset/nixpkgs/haskell-updates))"] ([],_) -> ["🟡 **Potential issues** (and possibly [evaluation errors](https://hydra.nixos.org/jobset/nixpkgs/haskell-updates))"]
_ -> [":red_circle: **Branch not mergeable**"] _ -> ["🔴 **Branch not mergeable**"]
warnings = warnings =
if' (Unfinished > maybe Success worstState maintainedJob) "`maintained` jobset failed." <> if' (Unfinished > maybe Success worstState maintainedJob) "`maintained` jobset failed." <>
if' (Unfinished == maybe Success worstState mergeableJob) "`mergeable` jobset is not finished." <> if' (Unfinished == maybe Success worstState mergeableJob) "`mergeable` jobset is not finished." <>