feature-flags
GitHub提供 FlagPole 功能标志的全生命周期管理指南,涵盖注册、Python/前端检查、测试及上线流程。
Trigger Scenarios
Install
npx skills add getsentry/sentry --skill feature-flags -g -y
SKILL.md
Frontmatter
{
"name": "feature-flags",
"description": "Gate a Sentry feature behind a FlagPole feature flag. Use when adding a feature flag, registering a flag in temporary.py, checking a flag from Python or the frontend, enabling a flag in tests, or asking where FlagPole rollout config lives. Trigger on \"add a feature flag\", \"gate this behind a flag\", \"register a flag\", \"features.has\", \"api_expose\", \"OrganizationFeature\", \"ProjectFeature\", \"FlagPole\"."
}
Feature Flags (FlagPole)
New features should be gated behind a feature flag.
-
Register the flag in
src/sentry/features/temporary.py:manager.add("organizations:my-feature", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)Use
api_expose=Trueif the frontend needs to check the flag. UseProjectFeatureand aprojects:prefix for project-scoped flags. -
Python check:
if features.has("organizations:my-feature", organization, actor=user): -
Frontend check (requires
api_expose=True):organization.features.includes('my-feature'); -
Tests:
with self.feature("organizations:my-feature"): ... -
Rollout: FlagPole YAML config lives in the
sentry-options-automatorrepo, not here. -
Removal: once the rollout is finished, the flag comes out in a fixed three-PR order — see the
remove-option-or-flagskill.
See https://develop.sentry.dev/feature-flags/ for full docs.
Version History
- 946f25b Current 2026-08-29 07:36
- d3c9056 2026-08-20 20:32


