fix(rq): Support rq 2.7.0+ where SimpleWorker inherits from BaseWorker#5505
Merged
sentrivana merged 2 commits intotoxgen/updatefrom Feb 23, 2026
Merged
fix(rq): Support rq 2.7.0+ where SimpleWorker inherits from BaseWorker#5505sentrivana merged 2 commits intotoxgen/updatefrom
sentrivana merged 2 commits intotoxgen/updatefrom
Conversation
Contributor
Codecov Results 📊✅ 118 passed | Total: 118 | Pass Rate: 100% | Execution Time: 17.62s 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 0.00%. Project has 13305 uncovered lines. Files with missing lines (179)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 28.18% 32.71% +4.53%
==========================================
Files 189 189 —
Lines 19767 19774 +7
Branches 6408 6410 +2
==========================================
+ Hits 5571 6469 +898
- Misses 14196 13305 -891
- Partials 525 605 +80Generated by Codecov Action |
In rq 2.7.0, SimpleWorker was changed to inherit directly from BaseWorker instead of Worker. This meant our monkey-patches on Worker.perform_job and Worker.handle_exception were bypassed for SimpleWorker, causing no Sentry events to be captured. Patch BaseWorker when available (rq >= 1.7.0) to cover both Worker and SimpleWorker. Fall back to patching Worker for older versions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4e4c413 to
227a8b4
Compare
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
Documentation 📚
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
alexander-alderman-webb
approved these changes
Feb 23, 2026
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.
Summary
SimpleWorkerwas refactored to inherit directly fromBaseWorkerinstead ofWorker(rq#2336). This broke our integration because we only monkey-patchedWorker.perform_jobandWorker.handle_exception, whichSimpleWorkerno longer inherits.BaseWorkerwhen available (rq >= 1.7.0), falling back toWorkerfor older versions. Since bothWorkerandSimpleWorkerinherit fromBaseWorker, this covers both worker types.Test plan
py3.14-rq-v2.6.1: 10 passed (backward compat)py3.14-rq-v2.7.0: 10 passed (new version)🤖 Generated with Claude Code