Skip to content

Commit

Permalink
chore(scm): remove indirect imports for bitbucket and gitlab (#77609)
Browse files Browse the repository at this point in the history
  • Loading branch information
cathteng authored and harshithadurai committed Sep 19, 2024
1 parent 2b7a3b3 commit 98c2095
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 32 deletions.
6 changes: 3 additions & 3 deletions src/sentry/conf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2478,12 +2478,12 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
SENTRY_USE_X_FORWARDED_FOR = True

SENTRY_DEFAULT_INTEGRATIONS = (
"sentry.integrations.bitbucket.BitbucketIntegrationProvider",
"sentry.integrations.bitbucket_server.BitbucketServerIntegrationProvider",
"sentry.integrations.bitbucket.integration.BitbucketIntegrationProvider",
"sentry.integrations.bitbucket_server.integration.BitbucketServerIntegrationProvider",
"sentry.integrations.slack.SlackIntegrationProvider",
"sentry.integrations.github.integration.GitHubIntegrationProvider",
"sentry.integrations.github_enterprise.integration.GitHubEnterpriseIntegrationProvider",
"sentry.integrations.gitlab.GitlabIntegrationProvider",
"sentry.integrations.gitlab.integration.GitlabIntegrationProvider",
"sentry.integrations.jira.JiraIntegrationProvider",
"sentry.integrations.jira_server.JiraServerIntegrationProvider",
"sentry.integrations.vsts.VstsIntegrationProvider",
Expand Down
11 changes: 0 additions & 11 deletions src/sentry/integrations/bitbucket/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
from .client import * # noqa: F401,F403
from .constants import * # noqa: F401,F403
from .descriptor import * # noqa: F401,F403
from .installed import * # noqa: F401,F403
from .integration import * # noqa: F401,F403
from .issues import * # noqa: F401,F403
from .repository import * # noqa: F401,F403
from .search import * # noqa: F401,F403
from .uninstalled import * # noqa: F401,F403
from .urls import * # noqa: F401,F403
from .webhook import * # noqa: F401,F403
5 changes: 0 additions & 5 deletions src/sentry/integrations/bitbucket_server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
from .client import * # noqa: F401,F403
from .integration import * # noqa: F401,F403
from .repository import * # noqa: F401,F403
from .urls import * # noqa: F401,F403
from .webhook import * # noqa: F401,F403
7 changes: 0 additions & 7 deletions src/sentry/integrations/gitlab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
from .client import * # noqa: F401,F403
from .integration import * # noqa: F401,F403
from .issues import * # noqa: F401,F403
from .repository import * # noqa: F401,F403
from .search import * # noqa: F401,F403
from .urls import * # noqa: F401,F403
from .webhooks import * # noqa: F401,F403
2 changes: 1 addition & 1 deletion src/sentry/middleware/integrations/parsers/bitbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Any

from sentry.hybridcloud.outbox.category import WebhookProviderIdentifier
from sentry.integrations.bitbucket import BitbucketWebhookEndpoint
from sentry.integrations.bitbucket.webhook import BitbucketWebhookEndpoint
from sentry.integrations.middleware.hybrid_cloud.parser import BaseRequestParser
from sentry.models.organizationmapping import OrganizationMapping
from sentry.types.region import RegionResolutionError, get_region_by_name
Expand Down
2 changes: 1 addition & 1 deletion tests/sentry/integrations/bitbucket/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import responses
from django.urls import reverse

from sentry.integrations.bitbucket import BitbucketIntegrationProvider
from sentry.integrations.bitbucket.integration import BitbucketIntegrationProvider
from sentry.integrations.models.integration import Integration
from sentry.models.repository import Repository
from sentry.silo.base import SiloMode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from requests.exceptions import ReadTimeout

from fixtures.bitbucket_server import EXAMPLE_PRIVATE_KEY
from sentry.integrations.bitbucket_server import BitbucketServerIntegrationProvider
from sentry.integrations.bitbucket_server.integration import BitbucketServerIntegrationProvider
from sentry.integrations.models.integration import Integration
from sentry.integrations.models.organization_integration import OrganizationIntegration
from sentry.testutils.cases import IntegrationTestCase
Expand Down
3 changes: 1 addition & 2 deletions tests/sentry/integrations/gitlab/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
from django.test import override_settings

from fixtures.gitlab import GET_COMMIT_RESPONSE, GitLabTestCase
from sentry.integrations.gitlab import GitlabIntegrationProvider
from sentry.integrations.gitlab.blame import GitLabCommitResponse, GitLabFileBlameResponseItem
from sentry.integrations.gitlab.client import GitLabApiClient, GitLabSetupApiClient
from sentry.integrations.gitlab.integration import GitlabIntegration
from sentry.integrations.gitlab.integration import GitlabIntegration, GitlabIntegrationProvider
from sentry.integrations.models.integration import Integration
from sentry.integrations.models.organization_integration import OrganizationIntegration
from sentry.integrations.source_code_management.commit_context import (
Expand Down
2 changes: 1 addition & 1 deletion tests/sentry/integrations/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def test_disabled_plugin_when_fully_migrated(self, call, *args):

@control_silo_test
@patch(
"sentry.integrations.gitlab.GitlabIntegrationProvider.build_integration",
"sentry.integrations.gitlab.integration.GitlabIntegrationProvider.build_integration",
side_effect=naive_build_integration,
)
class GitlabFinishPipelineTest(IntegrationTestCase):
Expand Down

0 comments on commit 98c2095

Please sign in to comment.