This is used to switch features on production-like environments. Values are applied after the sync CLI script fetches them from the server. Server URL, Instance ID and Application Name can be set on `$CONFIG->set('unleash', ...)` entry in `settings.php`.
Flags can be switched on and off per-environment at https://gitlab.com/minds/infrastructure/feature-flags/-/feature_flags/.
All GitLab strategies are available. Groups can be referenced using the percent character on the User ID strategy and there can be multiple targets (example: `100000000123, 1000000000999, %canary, %pro`).
*Environment Spec* is matched with the provided `applicationName` value in `settings.php`, fallbacking to `*`.
> Important: If the **BIG** Status switch on GitLab's Feature Flags main page is set to OFF, the feature flag becomes invisible and it's NOT returned by the Unleash server when synchronizing. This makes the fallback to be: `False → $CONFIG → EnvVar`.
#### Environment variables
...
...
@@ -100,6 +108,17 @@ if ($this->features->has('my-cool-feature')) {
}
```
### Sync CLI
#### Development
On PHP-FPM container, run:
```sh
php cli.php features sync--environment=development,sandbox --ttl=120 --forever
```
The above command would synchronize `development` and `sandbox` environment specs every 2 minutes.