From 0331f4a41f5fe1f4e703908f00fffc670eeffccb Mon Sep 17 00:00:00 2001 From: frostebite Date: Sat, 28 Mar 2026 21:45:17 +0000 Subject: [PATCH] Add bulk 'Reset all failed builds' admin button to versions page Adds a header-level admin button next to the existing 'Clean up stuck builds' button. Calls the resetFailedBuilds endpoint with an empty payload to reset failure counts on all builds stuck at max retries (15+), allowing the Ingeminator to retry them automatically. Co-Authored-By: Claude Opus 4.6 --- .../docs/versions/image-versions.tsx | 2 + .../reset-all-failed-builds-button.tsx | 57 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 src/components/docs/versions/reset-all-failed-builds-button.tsx diff --git a/src/components/docs/versions/image-versions.tsx b/src/components/docs/versions/image-versions.tsx index f9adcec4..711f5bca 100644 --- a/src/components/docs/versions/image-versions.tsx +++ b/src/components/docs/versions/image-versions.tsx @@ -1,6 +1,7 @@ import React, { useState } from 'react'; import SignInSignOutButton from '@site/src/components/auth/sign-in-sign-out-button'; import CleanUpStuckBuildsButton from './clean-up-stuck-builds-button'; +import ResetAllFailedBuildsButton from './reset-all-failed-builds-button'; import UnityVersions from './unity-versions'; import styles from './unity-version.module.scss'; @@ -30,6 +31,7 @@ const ImageVersions = ({ versions }: Props) => { })} + diff --git a/src/components/docs/versions/reset-all-failed-builds-button.tsx b/src/components/docs/versions/reset-all-failed-builds-button.tsx new file mode 100644 index 00000000..f92068a2 --- /dev/null +++ b/src/components/docs/versions/reset-all-failed-builds-button.tsx @@ -0,0 +1,57 @@ +import React, { useState } from 'react'; +import { MdRestartAlt } from 'react-icons/md'; +import { SimpleAuthCheck } from '@site/src/components/auth/safe-auth-check'; +import { useAuthenticatedEndpoint } from '@site/src/core/hooks/use-authenticated-endpoint'; +import { useNotification } from '@site/src/core/hooks/use-notification'; +import Spinner from '@site/src/components/molecules/spinner'; +import Tooltip from '@site/src/components/molecules/tooltip/tooltip'; + +const ResetAllFailedBuildsButton = () => { + const [running, setRunning] = useState(false); + const notify = useNotification(); + const resetAll = useAuthenticatedEndpoint('resetFailedBuilds', {}); + + const onClick = async () => { + try { + setRunning(true); + await notify.promise(resetAll(), { + loading: , + success: (response) => { + const results = response.results || []; + return results.length > 0 ? results.join('\n') : response.message; + }, + error: (error) => error.message || 'Reset failed', + }); + } finally { + setRunning(false); + } + }; + + return ( + } requiredClaims={{ admin: true }}> + + + + + ); +}; + +export default ResetAllFailedBuildsButton;