From 461880a3c6483acd2b8424ca740f9c95acacfc1c Mon Sep 17 00:00:00 2001 From: jaimergp Date: Wed, 10 Jun 2026 18:06:06 +0200 Subject: [PATCH] Add compatibility for structured status reports of errors --- src/components/ErrorMessageDetails/index.jsx | 30 +++++++++++++++++++ .../StatusDashboard/version_updates.jsx | 3 +- src/pages/status/migration/index.jsx | 7 +++-- 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 src/components/ErrorMessageDetails/index.jsx diff --git a/src/components/ErrorMessageDetails/index.jsx b/src/components/ErrorMessageDetails/index.jsx new file mode 100644 index 0000000000..c151245267 --- /dev/null +++ b/src/components/ErrorMessageDetails/index.jsx @@ -0,0 +1,30 @@ +export default function ErrorMessageDetails({ details }) { + console.log(details); + let children = []; + if (details.messages) { + if (details.kind) { + children.push( + {details.kind && details.kind || "error"} + {details.base_branch && ` @ ${details.base_branch}` || null} + {details.attempts && ` after ${details.attempts.toFixed(1)} attempts` || null} + ) + } + if (details.url) { + children.push( + + View CI job{" "} + + + + + ) + } + for (const message of details.messages) { + children.push(
{message}
) + } + /* Legacy: string only values */ + } else { + children.push(
{details.toString()}
) + } + return <>{children} +} diff --git a/src/components/StatusDashboard/version_updates.jsx b/src/components/StatusDashboard/version_updates.jsx index 4a861bedb7..90bf455df5 100644 --- a/src/components/StatusDashboard/version_updates.jsx +++ b/src/components/StatusDashboard/version_updates.jsx @@ -2,6 +2,7 @@ import Link from "@docusaurus/Link"; import { urls } from "@site/src/constants"; import React, { useEffect, useState } from "react"; import styles from "./styles.module.css"; +import ErrorMessageDetails from "@site/src/components/ErrorMessageDetails"; export default function VersionUpdates({ onLoad }) { const [{ collapsed, expanded, errors, queued }, setState] = @@ -97,7 +98,7 @@ export default function VersionUpdates({ onLoad }) {
-
{ message }
+
))} diff --git a/src/pages/status/migration/index.jsx b/src/pages/status/migration/index.jsx index 719f16ff97..31187e795b 100644 --- a/src/pages/status/migration/index.jsx +++ b/src/pages/status/migration/index.jsx @@ -14,6 +14,7 @@ import { compare } from '@site/src/components/StatusDashboard/current_migrations import { useSorting, SortableHeader } from '@site/src/components/SortableTable'; import * as d3 from "d3"; import DependencyGraph from "@site/src/components/DependencyGraph"; +import ErrorMessageDetails from "@site/src/components/ErrorMessageDetails"; // GitHub GraphQL MergeStateStatus documentation // Reference: https://docs.github.com/en/graphql/reference/enums#mergestatestatus @@ -593,9 +594,9 @@ function Row({ children }) { ))} - {details && !collapsed && ( -
{ details }
- )} + {details && !collapsed && ( + + )} ); }