Replace stage-level statuses (pending/transcribed/extracted/published) with user-meaningful lifecycle states (not_started/queued/processing/error/complete). Backend: - ProcessingStatus enum: not_started, queued, processing, error, complete - run_pipeline sets 'processing' before dispatching Celery chain - stage5 sets 'complete' (was 'published') - stage3 no longer sets intermediate status (stays 'processing') - New mark_pipeline_error task wired as link_error on chain - _set_error_status helper marks video on permanent failure - Ingest sets 'queued' (was 'transcribed') - Migration 008 renames all existing values Frontend: - StatusFilter shows fixed-order lifecycle tabs: Not Started | Queued | In Progress | Errored | Complete - Per-video badges show friendly labels instead of raw enum values - Badge colors mapped to new statuses
35 lines
1.8 KiB
Python
35 lines
1.8 KiB
Python
"""Rename processing_status values to user-meaningful lifecycle states.
|
|
|
|
Old: pending, transcribed, extracted, published
|
|
New: not_started, queued, processing, error, complete
|
|
|
|
Revision ID: 008_rename_processing_status
|
|
Revises: 007_drop_review_columns
|
|
"""
|
|
from alembic import op
|
|
|
|
revision = "008_rename_processing_status"
|
|
down_revision = "007_drop_review_columns"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# Add new enum values first
|
|
op.execute("ALTER TYPE processingstatus ADD VALUE IF NOT EXISTS 'not_started'")
|
|
op.execute("ALTER TYPE processingstatus ADD VALUE IF NOT EXISTS 'queued'")
|
|
op.execute("ALTER TYPE processingstatus ADD VALUE IF NOT EXISTS 'processing'")
|
|
op.execute("ALTER TYPE processingstatus ADD VALUE IF NOT EXISTS 'error'")
|
|
op.execute("ALTER TYPE processingstatus ADD VALUE IF NOT EXISTS 'complete'")
|
|
# Migrate existing rows
|
|
op.execute("UPDATE source_videos SET processing_status = 'not_started' WHERE processing_status = 'pending'")
|
|
op.execute("UPDATE source_videos SET processing_status = 'queued' WHERE processing_status = 'transcribed'")
|
|
op.execute("UPDATE source_videos SET processing_status = 'processing' WHERE processing_status = 'extracted'")
|
|
op.execute("UPDATE source_videos SET processing_status = 'complete' WHERE processing_status = 'published'")
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.execute("UPDATE source_videos SET processing_status = 'pending' WHERE processing_status = 'not_started'")
|
|
op.execute("UPDATE source_videos SET processing_status = 'transcribed' WHERE processing_status = 'queued'")
|
|
op.execute("UPDATE source_videos SET processing_status = 'extracted' WHERE processing_status = 'processing'")
|
|
op.execute("UPDATE source_videos SET processing_status = 'published' WHERE processing_status = 'complete'")
|