Skip to content

Bulk retry and discard for failed jobs; Stimulus via importmap-rails (#11)#11

Merged
eclectic-coding merged 8 commits into
mainfrom
feat/bulk-retry-failed-jobs
May 25, 2026
Merged

Bulk retry and discard for failed jobs; Stimulus via importmap-rails (#11)#11
eclectic-coding merged 8 commits into
mainfrom
feat/bulk-retry-failed-jobs

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • Adds importmap-rails as an engine dependency and wires it into the engine initializer; a selection_controller.js (Stimulus) manages checkbox state, select-all toggling, and injects selected IDs into the appropriate form at submit time
  • Adds bulk retry and discard to the failed jobs list: checkbox column with a selection bar that reveals "Retry Selected" and "Discard Selected" buttons; backed by FailedJobs::SelectionsController (POST /failed_jobs/selection → retry, DELETE /failed_jobs/selection → discard)
  • Refactors the jobs index to use proper Stimulus data-target/data-action attributes instead of an inline onclick handler

Bug fixes

  • Action buttons were stacking because button_to wraps in block-level <form>; fixed with .sqw-actions form { display: inline }
  • Retry raised NoMethodError in dev because seeds stored arguments as a raw JSON string; fixed to use the Active Job hash format with executions and exception_executions keys

Test plan

  • bundle exec rspec — 91 examples, 0 failures
  • bin/rubocop — no offenses
  • Manual: select one or more failed jobs → "Retry Selected" moves them back to ready
  • Manual: select one or more failed jobs → "Discard Selected" removes them
  • Manual: "Select All" toggles all checkboxes; selection bar shows count
  • Manual: jobs index bulk discard still works with Stimulus targets

🤖 Generated with Claude Code

eclectic-coding and others added 7 commits May 25, 2026 16:57
…e selection controller

Add importmap-rails as a dependency and wire it into the engine initializer
so the host app's importmap picks up the engine's JS automatically. Add a
selection_controller.js (ported from solid_queue_dashboard) that manages
checkbox state, select-all toggling, and form injection at submit time.

Update the jobs index to use Stimulus data-targets instead of the inline
onclick select-all hack; the discard form is now external to the table and
the controller injects checked IDs at submit time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add FailedJobs::SelectionsController with create (bulk retry) and
destroy (bulk discard) actions, routed as DELETE/POST /failed_jobs/selection.
The failed jobs index now uses the Stimulus selection controller with two
separate forms — one for retry, one for discard — so the same checkbox
selection drives both actions from a single selection bar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Passing a plain string to FailedExecution error: caused SolidQueue to
serialize it as a JSON string. On read-back error.with_indifferent_access
raised NoMethodError since String doesn't respond to it. Restructured
ERRORS as hashes with exception_class, message, and backtrace keys.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
button_to wraps each button in a block-level form element, causing
stacked buttons. display: inline on forms inside .sqw-actions keeps
Retry and Discard side by side.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Passing arguments as a JSON string caused SolidQueue's retry
(reset_execution_counters) to fail — it expects a Hash with executions
and exception_executions keys. Seeds now match the format that Active Job
writes when enqueuing real jobs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 25, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

…prefix on line 13

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eclectic-coding eclectic-coding merged commit 03f911d into main May 25, 2026
4 checks passed
@eclectic-coding eclectic-coding deleted the feat/bulk-retry-failed-jobs branch May 25, 2026 21:13
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.

2 participants