From 9aca4b6e99fa78971298a6cd1acc845fa8101cfe Mon Sep 17 00:00:00 2001 From: Athena Moghaddam <132939361+sentaur-athena@users.noreply.github.com> Date: Fri, 1 Nov 2024 09:34:00 -0700 Subject: [PATCH] feat(oauth): send feature flag to frontend (#80120) There's no org [where this feature flag is being checked](https://github.com/getsentry/getsentry/blob/master/static/getsentry/gsAdmin/views/instanceLevelOAuth/components/newInstanceLevelOAuthClient.tsx#L24) so enabling it through the config. This basically makes it available in the Config object on the frontend --- src/sentry/features/temporary.py | 8 ++++++++ src/sentry/web/client_config.py | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/sentry/features/temporary.py b/src/sentry/features/temporary.py index bb495d590cbd5..c3a1a94548928 100644 --- a/src/sentry/features/temporary.py +++ b/src/sentry/features/temporary.py @@ -584,3 +584,11 @@ def register_temporary_features(manager: FeatureManager): FeatureHandlerStrategy.FLAGPOLE, api_expose=True, ) + + # Partner oauth + manager.add( + "organizations:scoped-partner-oauth", + OrganizationFeature, + FeatureHandlerStrategy.FLAGPOLE, + api_expose=False, + ) diff --git a/src/sentry/web/client_config.py b/src/sentry/web/client_config.py index c8e6b6fec57e9..e2051c736ab72 100644 --- a/src/sentry/web/client_config.py +++ b/src/sentry/web/client_config.py @@ -224,6 +224,13 @@ def enabled_features(self) -> Iterable[str]: yield "relocation:enabled" if features.has("system:multi-region"): yield "system:multi-region" + # TODO @athena: remove this feature flag after development is done + # this is a temporary hack to be able to used flagpole in a case where there's no organization + # availble on the frontend + if self.last_org and features.has( + "organizations:scoped-partner-oauth", self.last_org, actor=self.user + ): + yield "system:scoped-partner-oauth" @property def needs_upgrade(self) -> bool: