Skip to content

chore: consolidate action controllers for failed jobs and jobs#34

Merged
eclectic-coding merged 5 commits into
mainfrom
chore/refactor-failed-jobs-actions
May 20, 2026
Merged

chore: consolidate action controllers for failed jobs and jobs#34
eclectic-coding merged 5 commits into
mainfrom
chore/refactor-failed-jobs-actions

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • FailedJobsController#destroy and #discard_all merged into a single destroy action that branches on params[:id] — single execution when present, full filtered scope when absent; discard_all route maps to destroy via action: option
  • FailedJobsController#retry and #retry_all extracted into a new RetryFailedJobsController#create action with the same single/bulk branching pattern; both retry and retry_all routes point to the new controller
  • JobsController#destroy and #discard_all consolidated the same way, preserving the Turbo Stream response for the single-job path

Test plan

  • All 168 examples pass, 100% line coverage
  • POST /jobs/failed_jobs/:id/retry retries a single job
  • POST /jobs/failed_jobs/retry_all retries all (filtered) failed jobs
  • DELETE /jobs/failed_jobs/:id discards a single failed job
  • POST /jobs/failed_jobs/discard_all discards all (filtered) failed jobs
  • DELETE /jobs/list/:id discards a single job with Turbo Stream response
  • POST /jobs/list/discard_all discards all jobs with plain redirect

🤖 Generated with Claude Code

eclectic-coding and others added 5 commits May 20, 2026 10:11
destroy and retry now branch on params[:id] — single execution when
present, filtered scope when absent. discard_all and retry_all routes
map to the same actions via action: option, eliminating two duplicate
action methods.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Retry is a creation event — single job and bulk retry_all both route
to RetryFailedJobsController#create, branching on params[:id].
FailedJobsController now owns only index and destroy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
destroy now branches on params[:id] — single execution (with Turbo
Stream response) when present, filtered scope bulk discard when absent.
discard_all route maps to destroy via action: option.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eclectic-coding eclectic-coding merged commit fab72ea into main May 20, 2026
5 checks passed
@eclectic-coding eclectic-coding deleted the chore/refactor-failed-jobs-actions branch May 20, 2026 14:24
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.

1 participant