ReleaseDraft: upload diagnostics panel#81
Conversation
…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.
|
So, this pulls information (release draft state and logs, etc) from delivery-kid on page load? Does it like, get stored on pickipedia itself? What happens if delivery-kid is nuked and rebuilt? Will we lose history? |
|
Yep jswizzle, both right — fetched live from Which means yes, lil bubba — if delivery-kid gets nuked and rebuilt the diagnostics history goes with it. The ReleaseDraft YAML keeps If we want diagnostic history to survive a delivery-kid rebuild, cleanest path I'd suggest is mirroring on terminal state: when |
|
Yeah, that sounds reasonable. You say that it already writes to the wiki - writes as who? |
|
Writes as the currently logged-in wiki user, jswizzle — straight Which has an implication worth flagging before I spike anything, lil bubba — a browser-side snapshot inherits a gap: if the uploader closes the tab before the SSE reaches If we want it bulletproof against tab-close, the alternative is delivery-kid writing back as a bot account — the Blue Railroad bot pattern already exists (the LocalSettings has an So three flavors to pick from:
Which way do you want to push? |
|
I think 2. Is that easy? |
|
Honest read, jswizzle — moderate, not a one-liner but most of the muscle's in place. The Blue Railroad import tool already does exactly this dance (
The one design call I want to flag before I spike, lil bubba — where do the snapshotted logs land on the wiki page?
I lean sub-page on the conflict-avoidance argument — bots stomping in-progress user edits is the kind of thing that becomes a recurring papercut, and Total estimate: half a day for sub-page, a full day if we go same-page-with-conflict-handling. Want me to spike it as a follow-up PR after this one merges? |
|
Yeah sub-page sounds good. Make it so. |
|
Roger that jswizzle — sub-page it is. Spike list, in order:
Quick housekeeping question for you, lil bubba — good to merge this PR as-is (read-only viewer over delivery-kid's live state) and do the snapshot persistence as a clean follow-up PR? Or hold this open and bundle? |
|
I think let's see what you can do for the bot pattern/sub page first, then we'll merge. |
|
On it jswizzle. Couple of gates I'll need your hand on to land it end-to-end:
Solo work I can spike right now without waiting on those, lil bubba:
The maybelle-config side will land as a separate PR over there; the wiki-side JS merge gets added to this PR. I'll ping back here when both are up so you can eyeball before granting the bot account. Heading in now. |
|
No no, just use the existing Blue Railroad Imports. |
|
Heard jswizzle — calling off the bot recruitment drive. Blue Railroad bot is hereby promoted from "hauls Blue Railroad videos in" to "also writes the after-action report on every draft she touches." Same engine, second job, no raise. She'll figure it out — she's a workhorse. Cuts the spike from ~half a day to maybe two hours, lil bubba — skipping the bot provisioning + vault dance entirely, just porting the creds + Heading in. |
…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.
|
Spike's up jswizzle. Two PRs to look at:
Bot reuse landed exactly as you called it, lil bubba — Blue Railroad's Hooks fire Ready for review on both. Once they merge, redeploy delivery-kid with |
Summary
Surfaces the upload/finalize/preview logs delivery-kid already persists on each content draft, so a failed transcode or pin shows what actually broke instead of a static "Preview transcoding failed" one-liner.
The plumbing exists — Justin's recent maybelle-config commits (
f6ef786 persist upload + finalize logs,ada00c1 capture coconut progress events as preview_log) writeupload_log,finalize_log, andpreview_logtodraft.jsonand expose them viaGET /draft-content/{id}. The wiki side wasn't reading any of them. This PR closes that gap.What it does
<div id="rd-diagnostics">placeholder right after the status banner inReleaseDraftContentHandler::fillParserOutput()initDiagnostics()inreleaseDraft.jsfetches/draft-content/{draft_id}on page load, polls every 10s while in-flight, stops once the draft reaches a terminal statestatusisupload_failed/finalize_failed, orpreview_statusisfailed— banner shows the lasterrorfield, details list every log entry with timestamp/stage/message and a monospace<pre>for structured error text/draft-album/{id}(which doesn't expose these fields) and are skipped — only content-typed drafts (video, blue-railroad, other) get the panelPreview
Standalone HTML rendering all five states (clean / in-flight / upload_failed / finalize_failed / preview_status: failed) against synthetic fixture data, using the verbatim renderer + CSS that ships in this PR:
https://skyler2.hunter.cryptograss.live
Test plan
preview_status: ready.txtrenamed to.mp4) → red "Upload failed" banner with the ffprobe error fromupload_log, details auto-expandedfinalize_log/draft-albumdoesn't expose logs)Future polish (not in this PR)
Coconut: job.progressevents into the latest one