Skip to content

ReleaseDraft: upload diagnostics panel#82

Merged
jMyles merged 3 commits into
cryptograss:productionfrom
magent-cryptograss:draft-upload-diagnostics
May 31, 2026
Merged

ReleaseDraft: upload diagnostics panel#82
jMyles merged 3 commits into
cryptograss:productionfrom
magent-cryptograss:draft-upload-diagnostics

Conversation

@magent-cryptograss

@magent-cryptograss magent-cryptograss commented May 30, 2026

Copy link
Copy Markdown
Contributor

Supersedes #81 — rebased onto current production and re-targeted from magent-cryptograss/pickipedia per the standing fork policy.

What's here

Three commits:

  • 14c0d7dReleaseDraft: surface upload/finalize/preview logs as a diagnostics panel (Sky's original)
  • e7d7e08ReleaseDraft: fall back to wiki snapshot when delivery-kid forgets a draft (Sky's original, paired with maybelle-config #87)
  • bc57560ReleaseDraft: remove stage-logs UI superseded by the diagnostics panel (added during rebase; see below)

Why the stage-logs removal

Production grew a parallel "stage logs" track while Sky's branch was in flight (bd9fb4d, ef4c001, 48acf92) — it polled /draft-content and rendered upload_log + finalize_log into #rd-upload-log and #rd-finalize-log divs.

The diagnostics panel from 14c0d7d is a strict superset of that work:

stage-logs (now removed) diagnostics panel
Polls /draft-content
Renders upload_log
Renders finalize_log
Renders preview_log
Failure banners, auto-expand on *_failed
Wiki-snapshot fallback when delivery-kid 404s

Keeping both meant rendering the same upload_log / finalize_log data twice on every content-draft page. bc57560 deletes the stage-logs divs from ReleaseDraftContentHandler.php, initStageLogs + renderStageLog from the JS, and the .rd-stage-log* CSS block. The diagnostics panel is the single home for these logs going forward.

Test plan

  • Open a ReleaseDraft page mid-upload — diagnostics panel renders upload/finalize/preview logs without the old stage-logs duplicates
  • Trigger a delivery-kid 404 (post storage rebuild) — diagnostics falls through to the ReleaseDraft:{id}/diagnostics sub-page snapshot
  • Successful finalize — diagnostics shows full upload/finalize/preview trail and stops polling
  • Upload failure — red error banner + auto-expanded details

…anel

Justin's pinning service already persists upload_log, finalize_log, and
preview_log on each content draft and exposes them via /draft-content/{id}.
The wiki side wasn't reading them — a failed transcode or pin showed up
on the draft page as a single static "Preview transcoding failed" line
with no detail.

Adds an Upload Diagnostics panel (placeholder rendered server-side,
populated by JS on load) that pulls all three logs from delivery-kid:
- Red banner with the last error when status is upload_failed,
  finalize_failed, or preview_status is failed
- Info banner while uploading / finalizing / preview transcoding
- Collapsible <details>, auto-expanded on any *_failed state and
  collapsed otherwise, listing each log entry with timestamp, stage,
  message, progress, and structured error text

Polls /draft-content every 10s while in-flight, then stops once the
draft reaches a terminal state. Album drafts use a different endpoint
without logs and are skipped.
…draft

When initDiagnostics' fetch of /draft-content/{id} returns 404, fall
back to reading ReleaseDraft:{id}/diagnostics via the MediaWiki API.
That sub-page is written by delivery-kid's pickipedia_client at every
terminal-state transition (cryptograss/maybelle-config branch
delivery-kid-snapshot-diagnostics) and survives a delivery-kid storage
rebuild.

The renderer marks snapshot-sourced data with "(snapshot)" in the
disclosure summary and surfaces snapshot_at + a "wiki snapshot —
delivery-kid no longer has live data" note in the meta block, so users
know they're looking at a frozen view rather than live state.
The earlier stage-logs work in this area (bd9fb4d, ef4c001, 48acf92)
rendered upload_log and finalize_log into a pair of plain #rd-upload-log
and #rd-finalize-log divs, polling /draft-content every 5s. The
diagnostics panel added in 14c0d7d is a strict superset:

  - renders upload_log + finalize_log + preview_log (stage-logs missed
    preview_log entirely)
  - falls back to the wiki snapshot when delivery-kid 404s (stage-logs
    just stopped)
  - has terminal-state error banners with auto-expand on *_failed
  - same poll target, same headers, same terminal-state stop logic

Keeping both meant rendering the same upload_log / finalize_log data
twice on every content-draft page. Drop the stage-logs divs from
ReleaseDraftContentHandler, drop initStageLogs + renderStageLog from
the JS, and drop the .rd-stage-log* CSS block. The diagnostics panel
is the single home for these logs going forward.
@jMyles jMyles merged commit 84f5a8d into cryptograss:production May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants