* 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
* 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>