Просмотр исходного кода

adds switch to kill sandbox (#31561)

Yesterday, we had an extended outage with the Sandbox. In order to mitigate the impact of the sandbox being down, I am adding a feature flag kill switch that will shut off traffic to the sandbox.
Stephen Cefali 3 лет назад
Родитель
Сommit
fb99e1f782
2 измененных файлов с 12 добавлено и 6 удалено
  1. 1 0
      src/sentry/features/__init__.py
  2. 11 6
      static/app/components/errorRobot.tsx

+ 1 - 0
src/sentry/features/__init__.py

@@ -69,6 +69,7 @@ default_manager.add("organizations:dashboards-basic", OrganizationFeature)
 default_manager.add("organizations:dashboards-edit", OrganizationFeature)
 default_manager.add("organizations:dashboards-template", OrganizationFeature, True)
 default_manager.add("organizations:data-forwarding", OrganizationFeature)
+default_manager.add("organizations:sandbox-kill-switch", OrganizationFeature, True)
 default_manager.add("organizations:discover", OrganizationFeature)
 default_manager.add("organizations:discover-basic", OrganizationFeature)
 default_manager.add("organizations:discover-query", OrganizationFeature)

+ 11 - 6
static/app/components/errorRobot.tsx

@@ -44,10 +44,12 @@ class ErrorRobot extends Component<Props, State> {
 
   componentDidMount() {
     this.fetchData();
-    logExperiment({
-      key: 'ViewSampleSandboxExperiment',
-      organization: this.props.org,
-    });
+    if (!this.props.org.features.includes('sandbox-kill-switch')) {
+      logExperiment({
+        key: 'ViewSampleSandboxExperiment',
+        organization: this.props.org,
+      });
+    }
   }
 
   async fetchData() {
@@ -84,8 +86,11 @@ class ErrorRobot extends Component<Props, State> {
     const {loading, error, sampleIssueId} = this.state;
     const {org, project, gradient} = this.props;
 
-    let sampleLink;
-    if (org.experiments.ViewSampleSandboxExperiment) {
+    let sampleLink: React.ReactNode;
+    if (
+      org.experiments.ViewSampleSandboxExperiment &&
+      !org.features.includes('sandbox-kill-switch')
+    ) {
       sampleLink = (
         <DemoSandboxButton
           scenario="oneIssue"