Conversation
Batches surface in the UI the way recurring tasks do: an adapter capability (supports_batches?) with batches/find_batch returning attribute hashes, a Server concern wrapping them in MissionControl::Jobs::Batch models, an index of recent batches and a show page with status, progress, counters, metadata and the batch's jobs, gated by a navigation tab that only appears when the adapter supports batches. Jobs can be filtered by batch: JobsRelation gains a batch_id property, filtered through the job association on the executions path and directly on the finished-jobs path. Built against solid_queue's batch-poc branch (via path: ../solid_queue for development): symbol statuses, total/completed/failed/pending counters and progress_percentage come straight from SolidQueue::Batch. Note: the workers controller tests fail with solid_queue 1.4 independently of this change (process registration changed since the 1.0.1 pin); to be addressed separately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P39PSB74nP3a8B2F7Z5xvz
No credentials are configured for the dummy app, so every dev-server request 401s otherwise. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P39PSB74nP3a8B2F7Z5xvz
The batch page's job list is now status-aware, reusing the per-status job partials: failed batches default to their failed jobs with error details and retry/discard actions, finished batches to their finished jobs, running batches to pending. The progress counters link to each list via the jobs_status param, following the jobs index convention. Exercised end to end with real workers and a dispatcher against solid_queue's batch-review-fixes branch: batches completed, failed and fired callbacks through the genuine claim/perform flow, including correct failure accounting when a worker process died mid-batch. Adds BatchCallbackJob to the dummy app for exercising callbacks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P39PSB74nP3a8B2F7Z5xvz
Git-sourced so the branch bundles anywhere; switch to a path source when co-developing against a local solid_queue checkout. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P39PSB74nP3a8B2F7Z5xvz
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Now based on batch-poc with rails/solid_queue main merged forward, picking up the Rails-main stopping? compatibility fix among 19 upstream commits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P39PSB74nP3a8B2F7Z5xvz
bundle update pulled minitest 6, whose Runnable#run arity breaks railties 7.2's line filtering before any test executes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P39PSB74nP3a8B2F7Z5xvz
supports_batches? now verifies the Solid Queue batch models, API, and schema instead of always advertising support. Batch pages expose pending, in-progress, blocked, and scheduled jobs separately so unfinished work is visible, with an unfinished batch defaulting to its first non-empty status. Pagination preserves the selected jobs_status, find_by_id honors the batch filter, and the batches index loads each batch's counters in a single statement snapshot instead of five queries per batch. The batches index itself is now paginated like the jobs index, backed by a BatchesRelation the Page understands (the adapter takes offset and limit and exposes batches_count), and shows an empty-state notice instead of a bare table when there are no batches. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Tabs on the batches index narrow the list to finished or unfinished batches, threaded through the adapter as a status argument on batches and batches_count so the database does the filtering, and preserved across pagination. A filtered page with no matches gets its own empty notice so the tabs remain reachable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Failed batches have also finished, so they appear under both tabs; the failed tab answers the operator question directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cap batches_count like job counts, skip live job-count subqueries for finished/failed listings, short-circuit those subqueries for finished rows on mixed listings, and default the index to unfinished batches. Co-authored-by: Cursor <cursoragent@cursor.com>
Sibling-file comparison pass: constants before the private section, helper_method beside its helpers, relation locals as private methods, a modifier_for_batch_status helper mirroring modifier_for_status, plain markup instead of content_tag, batch cleanup consolidated into delete_solid_queue_data, and the adapter batches section moved after workers to match the feature's ordering everywhere else. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P39PSB74nP3a8B2F7Z5xvz
Rework BatchesRelation to the workers_relation shape (clone_with, ALL_BATCHES_LIMIT, count clamped into the pagination window with the internal-limit Float::INFINITY cap preserved), validate jobs_status via supported_job_statuses like the discards controller, drop the unused dummy batch_callback_job, and restore the dummy development config to match upstream. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P39PSB74nP3a8B2F7Z5xvz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Batch support for Solid Queue in Mission Control, built fresh against current main and solid_queue's
batch-review-fixesbranch (rails/solid_queue#142 plus the review-fix series).What's here
Batches follow the recurring-tasks architecture end to end:
supports_batches?(false by default) withbatches/find_batchreturning attribute hashes;SolidQueueExt::Batchesimplements them straight offSolidQueue::Batch— symbol statuses,total/completed/failed/pendingcounters,progress_percentage, metadata, timestamps. Index lists the most recent 100.JobsRelationgainsbatch_id, filtered through the job association on the executions path and directly on the finished path, sobatch.jobsworks across statuses.jobs_status(same convention as the jobs index).ResourceNotFound→ batches index redirect, routes, dummy schema +BatchCallbackJobfor exercising callbacks.How it was tested
jobs_statusswitching, not-found redirect)batch-review-fixes(2459b29) and re-verified end to end from this branch.Known/out of scope
🤖 Generated with Claude Code