Skip to content

Technical guide · Overview

Page status: Active

Production Readiness Dashboard

NutsNews has an admin-only production readiness scorecard at /admin/readiness.

Visual overview

Primary diagram

System map

NutsNews has an admin-only production readiness scorecard at /admin/readiness.

Render the repository-owned system map when you need it.

Diagram is not rendered yet.

View as text
Production Readiness Dashboard

NutsNews has an admin-only production readiness scorecard at /admin/readiness.

flowchart TB
  accTitle: Production Readiness Dashboard
  accDescr {
    NutsNews has an admin-only production readiness scorecard at /admin/readiness.
  }
  A["Production Readiness Dashboard"] --> B["PRODUCTION_READINESS_DASHBOARD.md"]
  B --> C["Auto-generated placeholder diagram"]

Production Readiness Dashboard

Fullscreen diagram view.

NutsNews has an admin-only production readiness scorecard at /admin/readiness.

The admin now has one page that says whether NutsNews looks ready to ship, using green, yellow, and red cards.

The production readiness dashboard helps an admin decide whether NutsNews is healthy enough to promote in under 30 seconds. It checks SLO/error-budget posture, public feed/API readiness, the latest Worker/controller run, database growth, translation coverage, image coverage, backup restore verification, and CI status. Backup and CI status are live when a read-only GitHub token is configured; otherwise those cards stay yellow and link admins to GitHub Actions for manual verification.

Issue #86 adds a protected Next.js admin route at /admin/readiness, backed by web/lib/adminProductionReadiness.ts. Issue #89 adds a derived SLO and error budgets signal that rolls up existing readiness signals against the SLO policy. Issue #110 extends the backup card so it can read the latest Supabase Backup workflow run when ACTIONS_READ_TOKEN is configured. The loader uses server-side Supabase service-role reads for articles, public_feed_snapshot, worker_runs, and article_summaries; it does not expose credentials to the browser. The GitHub-backed signals use a server-only GitHub REST API call to /repos/ramideltoro/nutsnews/actions/runs?branch=main&per_page=50. The call sends the required GitHub API headers, is cached/revalidated for 300 seconds, matches workflows by explicit workflow file/name mappings, and returns only sanitized workflow names, status, conclusion, branch, commit SHA, updated time, and links to the admin UI. Backup freshness is green only when the latest Supabase Backup run completed successfully within 30 hours, which means the workflow exported backup artifacts, restored them into disposable local Supabase, and ran supabase/restore_validation.sql.

  • Added an admin-facing /admin/readiness scorecard.
  • Added an SLO/error-budget card that links red/yellow readiness findings to the SLO runbook.
  • Added the Production Readiness card to the admin landing page.
  • Added a focused regression script for the readiness dashboard contract.
  • Added yellow verification states for backup freshness and unconfigured CI status rather than faking live success.
  • Added live GitHub Actions CI status when a server-side read-only token is configured, while preserving the yellow manual verification fallback when it is not.
  • Added live GitHub Actions backup restore-fire-drill status when the same server-side token is configured.

NutsNews has production dependencies across Vercel, Cloudflare, Workers, Supabase, translations, images, backups, and CI. The scorecard gives admins a single operational view before shipping or promoting.

  • Admins use /admin/readiness before promotion decisions.
  • Developers use the regression script to protect the dashboard contract.
  • Readers are not directly affected; the change is admin-only.

The admin landing page now links to Production Readiness. The new page groups signals by severity and includes next-step remediation copy on every card.

SignalSourceGreen meansYellow meansRed means
SLO and error budgetsDerived from reader/API, degradation, Worker, DB growth, translation, backup, CI, and configuration signalsCore live indicators are inside the defined SLO budgetOne or more SLO signals needs High/Medium classificationOne or more critical readiness signals is burning error budget
Public API healthpublic_feed_snapshot and recent articles rowsSnapshot has enough rows for a first pageArticles exist but snapshot is shortNeither source has enough rows
Latest Worker/controller successLatest worker_runs rowLatest success is freshLatest success is aging or missingLatest run failed or is stale
DB growth signalRecent published articles rowsPublished rows arrived in 24 hoursGrowth exists in 7 days but not 24 hoursNo recent published growth
Translation coverageRecent article_summaries rowsRecent multilingual coverage is highCoverage is partial or unmeasurableCoverage is low
Image coverageRecent published article thumbnailsThumbnail coverage is highThumbnail coverage is thinThumbnail coverage is too low
Backup freshnessSupabase Backup GitHub Actions workflowLatest workflow completed successfully within 30 hours and uploaded the restore fire drill reportToken missing, workflow missing, run pending, run skipped/neutral, GitHub unavailable, or manual verification requiredLatest workflow failed/cancelled/timed out/requires action, or latest completed restore check is stale
CI statusGitHub Actions REST API when ACTIONS_READ_TOKEN is configuredEvery required workflow has a latest completed successful run on main within the freshness windowToken is missing, a workflow is missing/pending/stale/skipped/neutral, GitHub is rate-limited, or the API is unavailableA required workflow failed, was cancelled, timed out, or requires action

The backup card checks the latest main-branch run for:

Dashboard rowWorkflow fileExpected workflow name
Backup restore fire drill.github/workflows/supabase-backup.ymlSupabase Backup

Status mapping:

  • Green: the latest run completed with conclusion=success and is not older than 30 hours.
  • Yellow: ACTIONS_READ_TOKEN is missing, the workflow is missing, the latest run is queued or in progress, GitHub is rate-limited, or the API is unavailable.
  • Red: the latest run failed, was cancelled, timed out, requires action, or the latest completed check is stale.

The linked workflow run is the visible latest restore-check record. Its artifacts include supabase-rest-backup and supabase-restore-fire-drill-report; the report artifact contains latest.md and latest.json.

The CI card checks these required workflows on the main branch:

Dashboard rowWorkflow fileExpected workflow name
Web CI.github/workflows/web-ci.ymlWeb CI
Public smoke.github/workflows/public-reader-smoke.ymlPublic Reader Smoke Tests
Preview smoke.github/workflows/vercel-preview-smoke.ymlVercel Preview Smoke Test
Lighthouse.github/workflows/lighthouse-ci.ymlLighthouse CI
Axe accessibility.github/workflows/accessibility-ci.ymlAccessibility CI
CodeQL.github/workflows/codeql.ymlCodeQL Security Scan
Gitleaks secrets.github/workflows/gitleaks.ymlGitleaks Secret Scan
OSV Scanner.github/workflows/osv-scanner.ymlOSV Scanner
Dependency Review.github/workflows/dependency-review.ymlDependency Review
OpenSSF Scorecard.github/workflows/openssf-scorecard.ymlOpenSSF Scorecard
Snyk Security Scan.github/workflows/snyk.ymlSnyk Security Scan

Status mapping:

  • Green: every required workflow has a latest completed run with conclusion=success and the run is not stale.
  • Yellow: the token is missing, the workflow is missing, the latest run is queued or in progress, the latest run is stale, the conclusion is skipped or neutral, GitHub returns an API error, or GitHub rate-limits the request.
  • Red: the latest completed required workflow failed, was cancelled, timed out, or requires action.

The admin UI shows each workflow name, dashboard status, GitHub status, conclusion, branch, commit SHA, updated time, and link to the run when GitHub data is available. If live status is unavailable, the card keeps the manual next step: open GitHub Actions and confirm Web CI, public smoke, preview smoke, Lighthouse, axe, CodeQL, and security scans are green.

  1. Open /admin/readiness.
  2. Read the overall status.
  3. Fix red cards before promotion.
  4. Verify yellow cards by following their links.
  5. Use the linked admin pages, workflows, or runbooks for remediation.

The dashboard uses existing server-side admin Supabase configuration:

  • SUPABASE_URL or NEXT_PUBLIC_SUPABASE_URL
  • SUPABASE_SERVICE_ROLE_KEY

Optional server-only CI status configuration:

  • ACTIONS_READ_TOKEN

Use a read-only GitHub token with access to read repository Actions metadata for ramideltoro/nutsnews. The token MUST be configured only as a server/runtime secret and MUST NOT be exposed as a NEXT_PUBLIC_* variable. Do not create GITHUB_ACTIONS_READ_TOKEN; GitHub blocks custom secrets that start with GITHUB_. No GitHub Actions workflow needs this token for CI because the dashboard builds and renders the yellow missing-token fallback without it; configure ACTIONS_READ_TOKEN in the deployed server/runtime environment where admins load /admin/readiness. No browser-visible GitHub secret is required. No backup metrics token is introduced by this change.

flowchart TD
A[Admin opens /admin/readiness] --> B[Protected admin layout checks auth]
B --> C[Server loader reads Supabase with service role]
C --> D[articles and public_feed_snapshot]
C --> E[worker_runs]
C --> F[article_summaries]
C --> N{GitHub token configured?}
N -->|Yes| O[Fetch Actions runs for main with 300s revalidation]
O --> P[Map required CI workflow status]
O --> R[Map Supabase Backup restore-fire-drill status]
N -->|No| Q[Yellow manual GitHub verification fallback]
D --> G[Readiness signal cards]
E --> G
F --> G
P --> G
R --> G
Q --> G
G --> S[SLO and error budgets signal]
S --> T[SLO runbook and incident class]
G --> H{Any red?}
H -->|Yes| I[Overall red: do not promote]
H -->|No| J{Any yellow?}
J -->|Yes| K[Overall yellow: verify linked systems]
J -->|No| L[Overall green: ready to ship]
K --> M[GitHub Actions, restore report artifact, and backup runbook links]
RiskMitigation
Backup workflow succeeds without a usable restoreThe Supabase Backup workflow now runs the restore fire drill before a green backup card is possible.
Backup card cannot query GitHubIt stays yellow and links directly to the workflow for manual verification.
GitHub token is missing or under-scopedThe CI card stays yellow and keeps the manual GitHub Actions verification link.
GitHub API is rate-limited or unavailableThe CI card stays yellow and tells admins to verify Actions directly.
A blocked GITHUB_* custom secret name is usedUse only ACTIONS_READ_TOKEN; GitHub reserves the GITHUB_ prefix for built-in variables/secrets.
Workflow names changeThe code matches by explicit workflow file path first and by known workflow name second; update the CI and backup mappings when workflow files are renamed.
Supabase schema drift breaks the dashboardThe focused regression script protects required dashboard strings and route linkage; TypeScript/build checks catch loader type issues.
Thresholds need tuningThreshold constants live in web/lib/adminProductionReadiness.ts and can be adjusted without changing the UI contract.

Revert the app PR that adds or changes /admin/readiness, web/lib/adminProductionReadiness.ts, the admin landing card, package scripts, and regression scripts. If only the live backup restore status must be rolled back, remove the Supabase Backup workflow mapping from web/lib/adminProductionReadiness.ts; the backup card will return to the manual yellow workflow fallback. Then revert this documentation page and any related backup/restore docs updates.