Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default result always override result when it set as true #22

Merged
merged 5 commits into from
Sep 6, 2019

Conversation

jamesyang124
Copy link
Contributor

@jamesyang124 jamesyang124 commented Sep 3, 2019

After test the result combinations with default result, it does not work as expected when default value is true. It will always override combined result as true regardless the combined result of toggle is enabled and strategy result.

https://github.com/Unleash/unleash-client-ruby/blob/master/lib/unleash/feature_toggle.rb#L74..L81

The modification will be - when strategy result already computed and toggle is enabled, it may respect that combined result instead of default result.

@coveralls
Copy link

coveralls commented Sep 3, 2019

Pull Request Test Coverage Report for Build 174

  • 46 of 46 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 99.008%

Totals Coverage Status
Change from base Build 165: 0.08%
Covered Lines: 499
Relevant Lines: 504

💛 - Coveralls

Copy link
Collaborator

@rarruda rarruda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR! This was a nice catch!

It looks very good, but I have some suggestions on what you can do so we can have it merged.

Appreciate that you took the time to write the tests covering the issue and all other use cases!

lib/unleash/feature_toggle.rb Show resolved Hide resolved
spec/unleash/feature_toggle_spec.rb Outdated Show resolved Hide resolved
spec/unleash/feature_toggle_spec.rb Show resolved Hide resolved
spec/unleash/feature_toggle_spec.rb Outdated Show resolved Hide resolved
spec/unleash/feature_toggle_spec.rb Show resolved Hide resolved
@rarruda rarruda added bug Something isn't working good first issue Good for newcomers and removed good first issue Good for newcomers labels Sep 5, 2019
Copy link
Collaborator

@rarruda rarruda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@rarruda rarruda merged commit af7cd88 into Unleash:master Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants