Browse Source

ref(codeowners): Use integrations- prefix in flag (#25963)

NisanthanNanthakumar 3 years ago
parent
commit
810bd5ec6f

+ 1 - 1
src/sentry/api/bases/external_actor.py

@@ -116,7 +116,7 @@ class ExternalActorEndpointMixin:
     @staticmethod
     def has_feature(request: Request, organization: Organization) -> bool:
         return bool(
-            features.has("organizations:import-codeowners", organization, actor=request.user)
+            features.has("organizations:integrations-codeowners", organization, actor=request.user)
         )
 
     def assert_has_feature(self, request: Request, organization: Organization) -> None:

+ 1 - 1
src/sentry/api/endpoints/project_codeowners.py

@@ -165,7 +165,7 @@ class ProjectCodeOwnersMixin:
     def has_feature(self, request: Request, project: Project) -> bool:
         return bool(
             features.has(
-                "organizations:import-codeowners", project.organization, actor=request.user
+                "organizations:integrations-codeowners", project.organization, actor=request.user
             )
         )
 

+ 1 - 1
src/sentry/conf/server.py

@@ -932,7 +932,7 @@ SENTRY_FEATURES = {
     # Enable experimental performance improvements.
     "organizations:enterprise-perf": False,
     # Enable the API to importing CODEOWNERS for a project
-    "organizations:import-codeowners": False,
+    "organizations:integrations-codeowners": False,
     # Special feature flag primarily used on the sentry.io SAAS product for
     # easily enabling features while in early development.
     "organizations:internal-catchall": False,

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

@@ -75,7 +75,7 @@ default_manager.add("organizations:filters-and-sampling", OrganizationFeature, T
 default_manager.add("organizations:global-views", OrganizationFeature)  # NOQA
 default_manager.add("organizations:grouping-tree-ui", OrganizationFeature, True)  # NOQA
 default_manager.add("organizations:images-loaded-v2", OrganizationFeature)  # NOQA
-default_manager.add("organizations:import-codeowners", OrganizationFeature, True)  # NOQA
+default_manager.add("organizations:integrations-codeowners", OrganizationFeature, True)  # NOQA
 default_manager.add("organizations:inbox", OrganizationFeature, True)  # NOQA
 default_manager.add("organizations:incidents", OrganizationFeature)  # NOQA
 default_manager.add("organizations:integrations-alert-rule", OrganizationFeature)  # NOQA

+ 1 - 1
static/app/views/settings/organizationIntegrations/configureIntegration.tsx

@@ -92,7 +92,7 @@ class ConfigureIntegration extends AsyncView<Props, State> {
   }
 
   hasCodeOwners() {
-    return this.props.organization.features.includes('import-codeowners');
+    return this.props.organization.features.includes('integrations-codeowners');
   }
 
   onTabChange = (value: Tab) => {

+ 3 - 3
static/app/views/settings/project/projectOwnership/index.tsx

@@ -58,7 +58,7 @@ class ProjectOwnership extends AsyncView<Props, State> {
         {query: {features: ['codeowners']}},
       ],
     ];
-    if (organization.features.includes('import-codeowners')) {
+    if (organization.features.includes('integrations-codeowners')) {
       endpoints.push([
         'codeowners',
         `/projects/${organization.slug}/${project.slug}/codeowners/`,
@@ -142,7 +142,7 @@ tags.sku_class:enterprise #enterprise`;
               >
                 {t('View Issues')}
               </Button>
-              <Feature features={['import-codeowners']}>
+              <Feature features={['integrations-codeowners']}>
                 <CodeOwnerButton
                   onClick={this.handleAddCodeOwner}
                   size="small"
@@ -181,7 +181,7 @@ tags.sku_class:enterprise #enterprise`;
             </Button>,
           ]}
         />
-        <Feature features={['import-codeowners']}>
+        <Feature features={['integrations-codeowners']}>
           <CodeOwnersPanel
             codeowners={codeowners}
             onDelete={this.handleCodeownerDeleted}

+ 2 - 2
tests/acceptance/test_organization_integration_external_mappings.py

@@ -37,7 +37,7 @@ class OrganizationExternalMappings(AcceptanceTestCase):
     def test_external_user_mappings(self):
         with self.feature(
             {
-                "organizations:import-codeowners": True,
+                "organizations:integrations-codeowners": True,
                 "organizations:integrations-stacktrace-link": True,
             }
         ):
@@ -71,7 +71,7 @@ class OrganizationExternalMappings(AcceptanceTestCase):
     def test_external_team_mappings(self):
         with self.feature(
             {
-                "organizations:import-codeowners": True,
+                "organizations:integrations-codeowners": True,
                 "organizations:integrations-stacktrace-link": True,
             }
         ):

+ 1 - 1
tests/js/spec/views/addCodeOwnerModal.spec.jsx

@@ -12,7 +12,7 @@ describe('AddCodeOwnerModal', function () {
     closeModal: jest.fn(() => null),
   };
 
-  const org = TestStubs.Organization({features: ['import-codeowners']});
+  const org = TestStubs.Organization({features: ['integrations-codeowners']});
   const project = TestStubs.ProjectDetails();
   const integration = TestStubs.GitHubIntegration();
   const repo = TestStubs.Repository({

+ 2 - 2
tests/js/spec/views/projectOwnership.spec.jsx

@@ -51,14 +51,14 @@ describe('Project Ownership', function () {
         TestStubs.routerContext()
       );
       expect(wrapper).toSnapshot();
-      // only rendered when `import-codeowners` feature flag enabled
+      // only rendered when `integrations-codeowners` feature flag enabled
       expect(wrapper.find('CodeOwnerButton').exists()).toBe(false);
     });
   });
 
   describe('codeowner action button', function () {
     it('renders button', function () {
-      org = TestStubs.Organization({features: ['import-codeowners']});
+      org = TestStubs.Organization({features: ['integrations-codeowners']});
 
       const wrapper = mountWithTheme(
         <ProjectOwnership

+ 9 - 9
tests/sentry/api/endpoints/test_external_team.py

@@ -28,7 +28,7 @@ class ExternalTeamTest(APITestCase):
             "provider": "github",
             "integrationId": self.integration.id,
         }
-        with self.feature({"organizations:import-codeowners": True}):
+        with self.feature({"organizations:integrations-codeowners": True}):
             response = self.get_success_response(
                 self.organization.slug, self.team.slug, status_code=201, **data
             )
@@ -55,7 +55,7 @@ class ExternalTeamTest(APITestCase):
             "externalName": "@getsentry/ecosystem",
             "integrationId": self.integration.id,
         }
-        with self.feature({"organizations:import-codeowners": True}):
+        with self.feature({"organizations:integrations-codeowners": True}):
             response = self.get_error_response(
                 self.organization.slug, self.team.slug, status_code=400, **data
             )
@@ -66,7 +66,7 @@ class ExternalTeamTest(APITestCase):
             "provider": "github",
             "integrationId": self.integration.id,
         }
-        with self.feature({"organizations:import-codeowners": True}):
+        with self.feature({"organizations:integrations-codeowners": True}):
             response = self.get_error_response(
                 self.organization.slug, self.team.slug, status_code=400, **data
             )
@@ -77,7 +77,7 @@ class ExternalTeamTest(APITestCase):
             "externalName": "@getsentry/ecosystem",
             "provider": "github",
         }
-        with self.feature({"organizations:import-codeowners": True}):
+        with self.feature({"organizations:integrations-codeowners": True}):
             response = self.get_error_response(
                 self.organization.slug, self.team.slug, status_code=400, **data
             )
@@ -89,7 +89,7 @@ class ExternalTeamTest(APITestCase):
             "provider": "git",
             "integrationId": self.integration.id,
         }
-        with self.feature({"organizations:import-codeowners": True}):
+        with self.feature({"organizations:integrations-codeowners": True}):
             response = self.get_error_response(
                 self.organization.slug, self.team.slug, status_code=400, **data
             )
@@ -105,7 +105,7 @@ class ExternalTeamTest(APITestCase):
             "provider": get_provider_string(self.external_team.provider),
             "integrationId": self.integration.id,
         }
-        with self.feature({"organizations:import-codeowners": True}):
+        with self.feature({"organizations:integrations-codeowners": True}):
             response = self.get_success_response(
                 self.organization.slug, self.team.slug, status_code=200, **data
             )
@@ -129,7 +129,7 @@ class ExternalTeamTest(APITestCase):
             "provider": "github",
             "integrationId": self.integration.id,
         }
-        with self.feature({"organizations:import-codeowners": True}):
+        with self.feature({"organizations:integrations-codeowners": True}):
             response = self.get_error_response(
                 self.organization.slug, self.team.slug, status_code=400, **data
             )
@@ -144,7 +144,7 @@ class ExternalTeamTest(APITestCase):
             "provider": "slack",
             "integrationId": self.slack_integration.id,
         }
-        with self.feature({"organizations:import-codeowners": True}):
+        with self.feature({"organizations:integrations-codeowners": True}):
             response = self.get_success_response(self.organization.slug, self.team.slug, **data)
         assert response.data == {
             **data,
@@ -161,5 +161,5 @@ class ExternalTeamTest(APITestCase):
             "provider": "slack",
             "integrationId": self.slack_integration.id,
         }
-        with self.feature({"organizations:import-codeowners": True}):
+        with self.feature({"organizations:integrations-codeowners": True}):
             self.get_error_response(self.organization.slug, self.team.slug, **data)

Some files were not shown because too many files changed in this diff