Coder Social home page Coder Social logo

flagsmith / flagsmith-ruby-client Goto Github PK

View Code? Open in Web Editor NEW
11.0 14.0 5.0 227 KB

Ruby Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/

Home Page: https://www.flagsmith.com/

License: BSD 3-Clause "New" or "Revised" License

Ruby 99.86% Shell 0.14%
feature-flags feature-flag feature-flagging feature-flaggers feature-toggles feature-toggle ci cd continuous-integration continous-integration

flagsmith-ruby-client's Introduction

Flagsmith Ruby Client

The SDK clients for Ruby https://www.flagsmith.com/. Flagsmith allows you to manage feature flags and remote config across multiple projects, environments and organizations.

Adding to your project

For full documentation visit https://docs.flagsmith.com/clients/server-side.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests

Getting Help

If you encounter a bug or feature request we would like to hear about it. Before you submit an issue please search existing issues in order to prevent duplicates.

Get in touch

If you have any questions about our projects you can email [email protected].

Useful links

Website

Documentation

flagsmith-ruby-client's People

Contributors

benrometsch avatar bmoelk avatar byreham avatar dabeeeenster avatar dependabot[bot] avatar khvn26 avatar kyle-ssg avatar matthewelwell avatar zachaysan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flagsmith-ruby-client's Issues

v4 Dependency Issues

Hello! I'm struggling to use version 4 of this gem.
I'm somewhat newish to ruby so please excuse me if I missed something.

I've added the gem to my application using bundle add flagsmith.
Afterwards the application fails to launch because the gem pry can't be found.

Looking the gemspec it seems that pry and pry-byebug are only defined as a dev dependency and thus should not be required.
However both gems are required in a way that seems like they are not optional by lib/flagsmith.rb

Multivariate evaluations not working in local evaluation

Given an environment with a flag titled test_mv which has a control value and a variation which has a weighting of 100% running the following script should return the variation value each time, but seemingly returns the control value.

require "flagsmith"

flagsmith = Flagsmith::Client.new(
  environment_key: "<key>",
  enable_local_evaluation: true,
)

identifier = "{Random.rand}"
flags = flagsmith.get_identity_flags(identifier)

puts flags.get_feature_value("test_mv")

Rename

Are there plans to publish a version of the gem with the new name?

Identity overrides in local evaluation mode

  1. Extend the Environment model with the identity_overrides: List[IdentityModel] field.
  2. On environment update in local evaluation mode, store overrides so they're efficiently accessed by identifier.
  3. For build_indentity_model interface (it's now more appropriate to call it get_identity_model so please rename it to that to match the other changes in the other sdks), use the storage above to retrieve the identity overrides. Fall back to a new IdentityModel instance if not found. If found, update traits with user-provided traits.

Refer to the following existing implementations:

Flagsmith/flagsmith-python-client#72
Flagsmith/flagsmith-java-client#142
Flagsmith/flagsmith-nodejs-client#143

Calls to environment_data_polling_manager cause unintended network requests

We wanted to call client.environment_data_polling_manager.stop manually in our code to prevent networking requests during tests. Doing this though causes networking requests do to the line at https://github.com/Flagsmith/flagsmith-ruby-client/blob/main/lib/flagsmith.rb#L106. This seems to make sense for initial calls to environment_data_polling_manager but I would expect subsequent calls to environment_data_polling_manager to return the initialized manager.

TypeError (superclass mismatch for class RetriableResponse)

Hi, I'm trying to use flagsmith but when I call Flagsmith::Client.new(....) throws me the next error

Traceback (most recent call last):
16: from (irb):8
15: from /bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in require' 14: from /bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:299:in load_dependency'
13: from /bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in block in require' 12: from /bundle/ruby/2.7.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in require'
11: from /bundle/ruby/2.7.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in require' 10: from /bundle/ruby/2.7.0/gems/flagsmith-3.1.1/lib/flagsmith.rb:4:in <top (required)>'
9: from /bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in require' 8: from /bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:299:in load_dependency'
7: from /bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in block in require' 6: from /bundle/ruby/2.7.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in require'
5: from /bundle/ruby/2.7.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in require' 4: from /bundle/ruby/2.7.0/gems/faraday-retry-1.0.3/lib/faraday/retry.rb:3:in <top (required)>'
3: from /bundle/ruby/2.7.0/gems/faraday-retry-1.0.3/lib/faraday/retry.rb:3:in require_relative' 2: from /bundle/ruby/2.7.0/gems/faraday-retry-1.0.3/lib/faraday/retriable_response.rb:4:in <top (required)>'
1: from /bundle/ruby/2.7.0/gems/faraday-retry-1.0.3/lib/faraday/retriable_response.rb:6:in `module:Faraday'
TypeError (superclass mismatch for class RetriableResponse)

Any thoughts? Thank you in advance for your help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.