Skip to content

Make redis an optional dependency - #643

Open
behnam-oneschema wants to merge 1 commit into
splitio:developmentfrom
oneschema:make-redis-optional
Open

behnam-oneschema wants to merge 1 commit into
splitio:developmentfrom
oneschema:make-redis-optional

Conversation

@behnam-oneschema

Copy link
Copy Markdown

Summary

Closes #642.

Moves redis from the gemspec's runtime dependencies to its development dependencies, so apps that use the default memory cache adapter (standalone mode) are no longer held to redis < 6.0 by Bundler.

  • splitclient-rb.gemspec: redis (>= 4.0.0, < 6.0) is now a development dependency (same range), so the SDK's own Redis specs and CI are unchanged.
  • README.md: consumer mode (cache_adapter: :redis) requires gem 'redis' in the application's Gemfile.
  • CHANGES.txt: unreleased entry.
  • spec/splitclient/split_config_spec.rb: the default config builds a memory adapter without requiring redis, and cache_adapter: :redis raises the existing "To use Redis as a cache adapter you must include it in your Gemfile" error when redis can't be loaded.

No library code changes were needed: lib/ only requires redis lazily, inside SplitConfig.init_cache_adapter and init_telemetry_adapter.

Compatibility

Consumer-mode apps that relied on splitclient-rb to pull in redis transitively will get the existing clear error at startup until they add gem 'redis'. You may prefer to ship this in a minor or major release and call it out in the release notes.

Testing

  • bundle exec rspec with Redis on localhost: 893 examples, 0 failures, 7 pending.
  • A fresh process with require 'redis' blocked loads the SDK and builds the default SplitConfig; redis is never loaded.
  • gem build splitclient-rb.gemspec succeeds; the built gem lists redis only under development dependencies.
  • RuboCop reports no new offenses on the changed files (the spec file's existing offenses are unchanged).

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant