feat(api): admin job-events feed with error messages for terminal log view #879
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/admin-job-events-api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds
GET /api/admin/job-events— a keyset-paginated, newest-first event feed of background job runs with failure messages, for the terminal-style admin log view. ComplementsGET /api/admin/job-runs.Contract
limit(1..200, default 100, clamped),jobType(exact),status(failed|completed|cancelled|running|queued),before(ISO-8601 Instant keyset cursor, occurredAt strictly < before){ events, hasMore, nextBefore }; events sortedoccurredAt DESC, id DESCworker_jobs(wj-*),album_suggestion_runs(asr-*),retrospective_runs(rr-*),export_jobs(exp-*) viaUNION ALL, each branch LIMIT-boundedprocessing_issues.message(guarded bystatus='failed') elseworker_job_resultsissue payloadmessage; run tables exposeerror_messagestatus=failedor an explicitjobTypefilter names themNotes
processing_issuesis read via a per-row correlated subquery on the small worker_jobs result set (no index on source_id; avoids a big join over 78k issue rows).->>).Migration
idx_worker_jobs_updated_at (updated_at DESC)andidx_worker_jobs_job_type_updated_at (job_type, updated_at DESC)(plain CREATE INDEX IF NOT EXISTS; Flyway runs in-txn).Verification
rtk ./gradlew :apps:api:compileJava— greenrtk ./gradlew :apps:api:test --tests '*JobEvent*' --tests '*JobRun*'— 19 tests green (JobEventsServiceTest 10, JobEventsControllerTest 3, JobRuns* 6)