You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 14, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: src/docs/feature-flags/flagpole.mdx
+23-13Lines changed: 23 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
# Flagpole
2
+
2
3
Flagpole is Sentry's internal, options-backed feature flagging library.
3
4
4
5
Features are defined in the [`sentry-options-automator`](https://github.com/getsentry/sentry-options-automator) repository as yaml objects within the [`options/defaults/flagpole.yml`](https://github.com/getsentry/sentry-options-automator/blob/main/options/default/flagpole.yml) file.
@@ -96,9 +97,11 @@ Flagpole currently supports the following `operator` types:
96
97
: The inverse of `equals`, evaluates to `True` if the context property value does not match the provided value.
97
98
98
99
## Evaluation Contexts
100
+
99
101
When a feature flag is checked, the caller must provide one or more entity objects for the feature handler to match against. These objects are used to construct an `EvaluationContext`, which is essentially a flat dictionary of keys and primitive values. This context is passed to each feature, which provides this context to each segment and condition to enforce whether the feature should be enabled.
100
102
101
103
### Context Builders
104
+
102
105
Each evaluation context is built up in stages via a [`ContextBuilder`](https://github.com/getsentry/sentry/blob/3cbf73a389a4ea006cbad9d8c4b8073effe09393/src/flagpole/evaluation_context.py#L54) object.
103
106
104
107
Each context builder consists of a list of context transformers, which are responsible for creating individual slices of the larger evaluation context.
@@ -178,27 +181,38 @@ features.add(
178
181
feature.<feature_scope>:<feature_name>
179
182
```
180
183
181
-
3. Add the feature name to the `flagpole.flagpole_only_features` list in sentry-options-automator's default [`app.yaml`](https://github.com/getsentry/sentry-options-automator/blob/483737d45dbc68253e926c3f860b5ae33111697b/options/default/app.yaml#L219) file, omitting the `feature.` prefix.
184
+
<Alert level="info">
185
+
The feature config should not be merged until the registration commit in step 1 has been fully deployed to all target environments. This is because Options Automator will fail to push options to any environments missing the option registration.
186
+
If this happens, make sure to rerun the options deployment once all environments have been updated to ensure your feature is active.
187
+
</Alert>
182
188
183
189
Once the option change is deployed, the feature checks will immediately be active in all environments and regions.
184
190
185
-
_Note:_ The feature config should not be merged until the registration commit in step 1 has been fully deployed to all target environments. This is because Options Automator will fail to push options to any environments missing the option registration.
191
+
## Using flagpole in single-tenants
192
+
193
+
To allow your flagpole feature configuration to be used in single-tenant
194
+
environments, you'll need to add your feature name to the
195
+
`flagpole.allowed_features`list for each tenant. For example, in
0 commit comments