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

chore(flagpole): Updates documentation with commonly used context properties #1308

Merged
merged 4 commits into from
Jun 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion src/docs/feature-flags/flagpole.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,50 @@ Each evaluation context is built up in stages via a [`ContextBuilder`](https://g

Each context builder consists of a list of context transformers, which are responsible for creating individual slices of the larger evaluation context.

Here are some common properties we surface via our Sentry and GetSentry context builders that you can use in your conditions:

**Organization Context Properties**

`organization_id` [int]

: The organization's ID

`organization_slug` [str]

: The organization's slug

`organization_name` [str]

: The organization's name

`organization_is-early-adopter` [bool]

: Whether or not the organization has the `early_adopter` flag enabled

**Project Context Properties (If checking a project feature)**

`project_id` [int]

: The project's ID

`project_slug` [str]

: The project's slug

**User Context Properties (If checking a flag with an actor)**

`user_id` [int]

: The active user's ID
Comment on lines +137 to +139
Copy link
Member

Choose a reason for hiding this comment

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

Should we include user_email with the caveat of only using sentry.io email addresses?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I'll add this to the docs.



To see the latest context properties available, check out the repo-specific context builders:
- [Sentry Context Builder](https://github.com/getsentry/sentry/blob/master/src/sentry/features/flagpole_context.py)

- [GetSentry Context Builder](https://github.com/getsentry/getsentry/blob/master/getsentry/feature_handlers/getsentry_flagpole_context_builder.py)



## Rolling out a new Flagpole feature

Creating a new Flagpole Feature is currently a 3 step process:
Expand All @@ -116,12 +160,17 @@ features.add(

2. Add a new feature object entry to sentry-options-automator's `flagpole.yml` file. The feature's option name must follow the following format in order to be picked up by Flagpole:

`feature.<feature_scope>:<feature_name>`.
```
feature.<feature_scope>:<feature_name>
```

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.

Once the option change is deployed, the feature checks will immediately be active in all environments and regions.

_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.

If this happens, make sure to rerun the options deployment once all environments have been updated to ensure your feature is active.

## Testing a Flagpole feature locally
You can test a flagpole feature flag locally using the GetSentry devserver.
Expand Down
Loading