-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
Toggle customer balance to entire instance #6801
Toggle customer balance to entire instance #6801
Conversation
fdabd5b
to
089bfc1
Compare
I feel like we're getting closer and closer to fully reinventing the wheel and having to switch to https://github.com/jnunemaker/flipper. Let's see if can get going a bit more. |
This enables toggling features as best fits us in each case. With this new approach we can then toggle :customer_balance to an entire instance, which is what we want in France.
This became dead code now.
089bfc1
to
d6350c3
Compare
Kernel#require prevented this from happening thus, the file was only loaded once so tests were passing so far by pure luck.
This is a bit more thorough.
Those flaky specs are different in each build, and they're flaky elsewhere, so I think we can merge 👌 |
I tested it locally and it's working as expected. |
Ok, thank for testing this @sauloperez . I'll get familiar with this pull request after merge 👍 |
One question about this @sauloperez : |
what do you mean by guest users here? To me, guest user => no user record in our DB for the user that's checking the browser.
yes. We enabled |
I mean it as an un-logged user. For example, unit prices in #6905 - only appear in the shopfront after a user logs in. If the user logs out the feature is gone as well. Maybe I'm missing how to activate this on the environment level. |
Now I see. Toggles are based on the logged-in user; we choose what criteria should they meet in order for the feature to be enabled for them. Without a user (aka. contexts where you don't need to log in) that cannot happen. The environment is just one of the myriad of criteria we can choose, but again it's all about which environment the logged user is checking. |
Nice convo! I think this is interesting to remember for features we want to toggl for an entire hub (it would by default exclude guest shoppers), am I understanding correctly? |
so far, yes. I think we all see that a toggle's criteria can escalate pretty quickly and become too hard to reason about, right? 😂 something to keep in mind. |
What? Why?
Closes #6804
This refactors the feature toggles implementation to make it flexible enough to fit more complex toggling strategies such as enabling a feature for an entire OFN instance.
For reviewers, going commit by commit might be easier to understand.
What should we test?
spec/initializers/feature_toggles_spec.rb
covers this (yes, it's the first time I test an initializer but it's proven enough) but I'd like you @filipefurtad0 to give it a try so you get acquainted with it and can give me feedback. I guess this can ease testing toggled features.Release notes
Enabled toggling a feature to an entire instance.
Changelog Category: Technical changes