1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00
Commit graph

8 commits

Author SHA1 Message Date
Rahul Agrawal
10598b5206
Surface exact job class name in complex argument error message (#5235)
* Surface exact job class name in complex argument error message

* Update job_util.rb

* Update param for ActiveJob arg serialization failure

Co-authored-by: Mike Perham <mperham@gmail.com>
2022-03-09 11:36:32 -08:00
Mike Perham
e7d154eeb5 Remove "worker" from codebase where possible 2022-03-03 12:37:25 -08:00
Adam Niedzielski
7cd97b4253
Remove parallel code paths caused by "push" and "push_bulk" (#5182)
* Remove parallel code paths caused by "push" and "push_bulk"

Fixes #5158

* Refactor where jid is generated

* Hardcode client class

* Make generate_jid private

* Build client outside the loop
2022-02-15 17:14:45 -08:00
Mike Perham
63f6e68777 standard formatting 2022-01-05 21:01:32 -08:00
Mike Perham
cea266a72f Better method naming, #5071 2022-01-05 19:54:12 -08:00
Mike Perham
b0fd83f5fc Rejigger complex argument handling, #5071
Add job class name to arg message
2021-12-07 13:58:04 -08:00
Kelly Sutton
fde53a5fc1
Implement strict argument checking (#5071)
* Add the outline of failing tests

* Implement argument checking

* Move argument checking into Sidekiq::JobUtil#validate

* Refactor acceptable class definition into a constant to cut down on array allocations

* Improve error message, match raise call formatting to other errors in the class

* Address feedback in the Pull Request to use the JSON round-trip method
of confirming the safety of job argument payloads.

Cleanup commented-out code from a few years back.

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Swap out JSON.load for JSON.parse per the security CI check

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Add a few more tests cases to build up confidence around our JSON.parse/dump approach and deep structures

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Improve test case description

* Warn when job arguments do not serialize safely and point folks toward how to enable strict_mode and the best practice

* Reconfigure the options-hash based approach to a global Sidekiq.strict_mode! method

* Add a note in the raised error on how to disable the error

* Let the error message breathe a little bit

* Toggle strict_mode! off to suss out a test flake

* Capitalize the start of a sentence

* Rename job_is_json_safe to json_safe?

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Refactor a few tests to test a single argument at a time

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Break out test cases to exercise each individual intersting case instead of all at once

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Change formatting to be more consistent, tighter when arguments are simple

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

* Add a flag to disable the warning message for development warning messages

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>

Co-authored-by: Eda Zhou <eda.zhou@gusto.com>
2021-12-07 13:20:20 -08:00
Mike Perham
6ae5b02236 Extract client's job utility methods, use them for perform_inline.
Sidekiq::Client is Redis-only, no inline support.
2021-11-16 10:15:14 -08:00