mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-15 04:14:24 +00:00
Merge with the other feature toggle page
@@ -1,13 +1,57 @@
|
||||
## What are Feature Toggles
|
||||
|
||||
Feature Toggles allows code paths can be enabled for certain users and/or environments such as staging, production, or development. It’s a technique in software development that attempts to provide an alternative to maintaining multiple branches in source code (known as feature branches), such that a software feature can be tested on production even before it is completed and ready for release. It also means that code can be merged faster on bigger features without impacting existing users.
|
||||
|
||||
## Feature Toggles are not a tool to customize features.
|
||||
Period
|
||||
Feature Toggles enable new and experimental features for only a few users or one server at a time. It’s a technique in software development that attempts to provide an alternative to maintaining multiple branches in source code (known as feature branches), such that a software feature can be tested on production even before it is completed and ready for release. It also means that code can be merged faster on bigger features without impacting existing users.
|
||||
|
||||
## How to use OFN Feature Toggles
|
||||
|
||||
[Wiki on using Feature Toggles in OFN](https://github.com/openfoodfoundation/openfoodnetwork/wiki/Feature-toggle-with-Flipper)
|
||||
|
||||
[Flipper](https://github.com/jnunemaker/flipper) is a small tool with its own UI that we use to manage feature toggling and that can be configured at instance level. The UI is enabled for admin users and can be seen at `/admin/feature-toggle`. Examples:
|
||||
|
||||
* https://staging.openfoodnetwork.org.au/admin/feature-toggle/features
|
||||
* https://staging.coopcircuits.fr/admin/feature-toggle/features
|
||||
* https://openfoodnetwork.org.uk/admin/feature-toggle/features
|
||||
|
||||
|
||||
### Definitions
|
||||
* **Feature**: A feature is a new behavior inside our application that is not totally released to all users. It is defined inside the OFN application. You can view all current features in the Flipper UI for admins (see above).
|
||||
|
||||
* **Group**: A group is defined inside the OFN application: it is strictly linked to our code base. This can be seen as certain set of users that can share same characteristics. You can activate a feature to a group inside the Flipper UI. View the list of groups [here](#list-of-groups-that-can-be-assigned-to-a-feature).
|
||||
|
||||
* **Actor**: An actor is a User from a Flipper point of view. Activate a feature to an actor inside the Flipper UI does activate this feature to the corresponding user inside the OFN application.
|
||||
|
||||
#### Configure toggling policies for a feature
|
||||
|
||||
A feature toggle can be enabled at three levels: actor, group and fully enabled.
|
||||
|
||||
_NB_: this document doesn't address the configuration by percentage, which is possible with Flipper.
|
||||
|
||||
##### Enable a feature for an actor
|
||||
|
||||
It is possible to enable a feature for one (or many) actor inside the Flipper UI.
|
||||
|
||||
An actor is linked to a user by its `flipper id`: knowing the `id` of the user inside the database, the `flipper id` is therefore `Spree::User;[ID]` (for example `Spree::User;1`). To activate a feature to a specific user, simply add an actor by entering in the field its `flipper id`.
|
||||
|
||||
You can add as many actors as you want to activate them the feature.
|
||||
<div>
|
||||
<img src="https://user-images.githubusercontent.com/296452/114878154-3ddcc800-9e00-11eb-86f9-900152025fbc.gif" />
|
||||
</div>
|
||||
|
||||
##### Enable a feature for a group
|
||||
You can now enable a feature to a group of users. Simply select the group and add it.
|
||||
<div>
|
||||
<img src="https://user-images.githubusercontent.com/296452/114878164-3fa68b80-9e00-11eb-8950-3fd26028f49d.gif" />
|
||||
<div>
|
||||
|
||||
##### Fully enable a feature
|
||||
You can fully enable a feature by simply clicking the "Fully Enable" green button. It resets the previous configurations (actor, group) you've made.
|
||||
|
||||
##### Fully disable a feature
|
||||
You can fully disable a feature by simply clicking the "Disable" green button. It resets the previous configurations (actor, group) you've made.
|
||||
|
||||
|
||||
### List of groups that can be assigned to a feature
|
||||
* `admins`: all the users that are admin (ie. have access to the admin backoffice)
|
||||
|
||||
|
||||
## Other useful bits
|
||||
|
||||
|
||||
Reference in New Issue
Block a user