Repository navigation
Honor explicit priority overrides on decorated jobs - #2551
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Apply per-call queue positioning overrides rq/decorators.py, tests/test_decorator.py, docs/docs/index.md |
The decorator uses its configured at_front value only when the per-call value is None. Tests check queue ordering for omitted and explicit values. Documentation describes the override. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: selwin, jlucas91, karech
Merge Risk: 
Minimal · up to a4406
-
The change correctly honors explicit queue-position overrides without establishing a merge-blocking risk.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2551 +/- ##
==========================================
+ Coverage 93.61% 95.19% +1.57%
==========================================
Files 28 43 +15
Lines 3760 5615 +1855
==========================================
+ Hits 3520 5345 +1825
- Misses 240 270 +30 ☔ View full report in Codecov by Harness. |
|
Thanks! |
Decorated jobs configured with
at_front=Trueignore a per-callat_front=False: the job is prepended to the backlog anyway. Distinguish an omitted option fromFalse, retaining the decorator default when omitted. Add Redis-backed regression coverage for both defaults and all three call forms, plus a short documentation note.For example, with an empty queue and this importable task module:
The assertion fails on baseline
b6907c9578ffa3acfc978f10d9bfc17ede200065and passes witha44060e42b0641d55378d671548390be8e1cd693.Validation on Linux with Docker
--init, Python 3.12.14, Redis 7.4.10 and redis-py 6.4.0:default=True, override=False; candidate decorator tests: 16 passed, 6 subtests passed.RUN_SLOW_TESTS_TOO=1 RUN_SSL_TESTS=1 hatch run test:cov --durations=5: 792 passed, including real TLS/slow tests.rq worker --burst --url redis://127.0.0.1:6379/2 priority-proof-candidate: four jobs execute inurgent, default, backlog, appendorder; baseline instead executesappendbeforebacklog. All persisted statuses and return values were checked. Repeated successfully using the built, installed wheel.hatch run test:typing,hatch run test:ruff check rq tests, formatting and pre-commit on the three changed files, sdist/wheel build and wheel installation: passed.The optional full pre-commit run reformats two existing expressions in unchanged
tests/test_worker_pool.pyon both baseline and candidate; that unrelated formatting is left out. Hosted CI ona44060enow passes all 31 checks, including 14 Redis/Python combinations, 9 Valkey combinations and SSL (Test, Valkey).AI assistance: Codex was used for investigation, implementation, and local validation.
Summary by CodeRabbit
at_front=Falseoverride when enqueued, even if the decorator’s default isTrue. When no override is provided, the decorator’s configured setting applies.at_frontsetting is the default and can be overridden for individual jobs usingdelay()orenqueue().