Add optional operations/sidekiq async execution integration - #60
Merged
Conversation
Extract the Sidekiq machinery for running operations asynchronously into
the gem itself: Operations::Sidekiq::Convenience/Command/Job/Serializer/
Deserializer plus the operation_container helper. The integration is an
opt-in require ("operations/sidekiq"), the Job is Sentry-free with an
overridable #instrument hook, and sidekiq/globalid/money are dev-only
dependencies. Adds self-contained specs and README/CHANGELOG docs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The optional operations/sidekiq integration pulls a modern Sidekiq that needs Ruby 3.2+, so specs were red on the sub-3.2 CI rows. Bump required_ruby_version to >= 3.2, drop the Ruby < 3.2 / Rails < 7.1 rows from the CI matrix and Appraisals (keep 3.2/7.1, 3.3/7.2, 3.4/8.0), run the rubocop job on Ruby 3.2, and remove the now-unused appraisal gemfiles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
@Azdaroth great idea. Can you please fix Rubo? |
The gem now requires Ruby >= 3.2, but .rubocop.yml still targeted 2.7, tripping Gemspec/RequiredRubyVersion. Bumping TargetRubyVersion to 3.2 enables the Ruby 3 idiom cops and, together with rubocop/bookingsync-rubocop version drift since the todo was last generated, surfaced pre-existing offenses across the existing lib/spec files (main was already red). Regenerate .rubocop_todo.yml (the repo's own --auto-gen-config mechanism) to re-absorb that pre-existing debt. The new operations/sidekiq code is clean and appears nowhere in the todo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
@pyromaniac done |
Follow-up to the previous commit, which absorbed the offenses surfaced by
the TargetRubyVersion 3.2 bump into .rubocop_todo.yml. Fix them for real
instead:
- Style/ArgumentsForwarding + Naming/BlockForwarding: adopt anonymous
forwarding (..., *, **, &) across command/convenience/form/etc.
- Style/HashAsLastArrayItem, Layout/EmptyLinesAfterModuleInclusion in specs.
- Style/RedundantFreeze on the frozen regexp literal; Style/ArrayIntersect
-> Array#intersect? in Result#errors_with_code?.
- Naming/PredicatePrefix: update the stale inline-disable cop name
(Naming/PredicateName was renamed) for the intentional has_attribute?.
- Lint/DuplicateMethods: scoped inline-disable for two distinct anonymous
Class.new blocks in preconditions_spec (rubocop can't tell them apart).
- Gemspec/AttributeAssignment: consolidate spec.metadata into a single hash.
This also fixes a latent bug: the trailing `spec.metadata = {...}` was
reassigning the whole hash and clobbering homepage_uri/source_code_uri/
changelog_uri set just above.
Remaining .rubocop_todo.yml entries are pre-existing Metrics thresholds and
the gemspec dev-dependency convention — the same debt already deferred on
main (now a strict subset; RSpec/VerifiedDoubles is gone). Refactoring the
gem's core methods for those metrics is out of scope here. 334 specs green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
@pyromaniac too much copy & paste from Core into other apps when adapting operations, let's put it all into the gem
Extract the Sidekiq machinery for running operations asynchronously into the gem itself:
Operations::Sidekiq::Convenience/Command/Job/Serializer/ Deserializer plus the operation_container helper. The integration is an opt-in require ("operations/sidekiq"), the Job is Sentry-free with an overridable #instrument hook, and sidekiq/globalid/money are dev-only dependencies. Adds self-contained specs and README/CHANGELOG docs.