Skip to content

Commit 58da998

Browse files
author
Stephen Cefali
authored
ref(ecosystem): use new base class for integration client (#17784)
1 parent 335eb09 commit 58da998

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+76
-425
lines changed

src/sentry/api/endpoints/group_integration_details.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from sentry.api.serializers import serialize
1010
from sentry.api.serializers.models.integration import IntegrationIssueConfigSerializer
1111
from sentry.integrations import IntegrationFeatures
12-
from sentry.integrations.exceptions import IntegrationError, IntegrationFormError
12+
from sentry.shared_integrations.exceptions import IntegrationError, IntegrationFormError
1313
from sentry.models import Activity, ExternalIssue, GroupLink, Integration
1414
from sentry.signals import integration_issue_created, integration_issue_linked
1515

src/sentry/api/endpoints/organization_integration_details.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from sentry.api.bases.organization import OrganizationEndpoint, OrganizationIntegrationsPermission
99
from sentry.api.serializers import serialize
10-
from sentry.integrations.exceptions import IntegrationError
10+
from sentry.shared_integrations.exceptions import IntegrationError
1111
from sentry.models import Integration, ObjectStatus, OrganizationIntegration
1212
from sentry.tasks.deletion import delete_organization_integration
1313

src/sentry/api/endpoints/organization_integration_repos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from sentry.constants import ObjectStatus
77
from sentry.api.bases.organization import OrganizationEndpoint, OrganizationIntegrationsPermission
8-
from sentry.integrations.exceptions import IntegrationError
8+
from sentry.shared_integrations.exceptions import IntegrationError
99
from sentry.integrations.repositories import RepositoryMixin
1010
from sentry.models import Integration
1111

src/sentry/identity/oauth2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from sentry.auth.exceptions import IdentityNotValid
1414
from sentry.http import safe_urlopen, safe_urlread
15-
from sentry.integrations.exceptions import ApiError
15+
from sentry.shared_integrations.exceptions import ApiError
1616
from sentry.utils import json
1717
from sentry.utils.http import absolute_uri
1818
from sentry.pipeline import PipelineView

src/sentry/integrations/base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,19 @@
1818
from sentry.exceptions import InvalidIdentity
1919
from sentry.pipeline import PipelineProvider
2020

21-
from .exceptions import (
21+
from sentry.shared_integrations.exceptions import (
2222
ApiHostError,
2323
ApiError,
2424
ApiUnauthorized,
2525
IntegrationError,
2626
IntegrationFormError,
2727
UnsupportedResponseType,
2828
)
29-
from .constants import ERR_UNAUTHORIZED, ERR_INTERNAL, ERR_UNSUPPORTED_RESPONSE_TYPE
29+
from sentry.shared_integrations.constants import (
30+
ERR_UNAUTHORIZED,
31+
ERR_INTERNAL,
32+
ERR_UNSUPPORTED_RESPONSE_TYPE,
33+
)
3034
from sentry.models import Identity, OrganizationIntegration
3135

3236

src/sentry/integrations/bitbucket/integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from sentry.identity.pipeline import IdentityProviderPipeline
1717
from django.utils.translation import ugettext_lazy as _
1818

19-
from sentry.integrations.exceptions import ApiError
19+
from sentry.shared_integrations.exceptions import ApiError
2020
from sentry.models import Repository
2121
from sentry.tasks.integrations import migrate_repo
2222
from sentry.utils.http import absolute_uri

src/sentry/integrations/bitbucket/issues.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import
22
from django.core.urlresolvers import reverse
33
from sentry.integrations.issues import IssueBasicMixin
4-
from sentry.integrations.exceptions import ApiError, IntegrationFormError
4+
from sentry.shared_integrations.exceptions import ApiError, IntegrationFormError
55

66

77
ISSUE_TYPES = (

src/sentry/integrations/bitbucket/repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from sentry.models import Integration
88
from sentry.utils.http import absolute_uri
99

10-
from sentry.integrations.exceptions import ApiError, IntegrationError
10+
from sentry.shared_integrations.exceptions import ApiError, IntegrationError
1111
from sentry.models.apitoken import generate_token
1212

1313
from .webhook import parse_raw_user_email, parse_raw_user_name

src/sentry/integrations/bitbucket/search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from rest_framework.response import Response
77

88
from sentry.api.bases.integration import IntegrationEndpoint
9-
from sentry.integrations.exceptions import ApiError
9+
from sentry.shared_integrations.exceptions import ApiError
1010
from sentry.models import Integration
1111

1212
logger = logging.getLogger("sentry.integrations.bitbucket")

src/sentry/integrations/bitbucket_server/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
from oauthlib.oauth1 import SIGNATURE_RSA
44
from requests_oauthlib import OAuth1
55
from six.moves.urllib.parse import parse_qsl
6-
from sentry.integrations.client import ApiClient, ApiError
6+
from sentry.integrations.client import ApiClient
7+
from sentry.shared_integrations.exceptions import ApiError
78

89

910
class BitbucketServerAPIPath(object):

src/sentry/integrations/bitbucket_server/integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from sentry.pipeline import PipelineView
2121
from sentry.utils.compat import filter
2222
from django.utils.translation import ugettext_lazy as _
23-
from sentry.integrations.exceptions import ApiError
23+
from sentry.shared_integrations.exceptions import ApiError
2424
from sentry.models.repository import Repository
2525
from sentry.tasks.integrations import migrate_repo
2626
from sentry.web.helpers import render_to_response

src/sentry/integrations/bitbucket_server/repository.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from sentry.models.integration import Integration
1010
from sentry.plugins.providers.integration_repository import IntegrationRepositoryProvider
1111
from sentry.utils.http import absolute_uri
12-
from sentry.integrations.exceptions import ApiError, IntegrationError
12+
from sentry.shared_integrations.exceptions import ApiError, IntegrationError
1313
from sentry.utils.hashlib import md5_text
1414

1515

@@ -104,7 +104,9 @@ def _format_commits(self, client, repo, commit_list):
104104
"author_name": c["author"].get("displayName", c["author"]["name"]),
105105
"message": c["message"],
106106
"timestamp": datetime.fromtimestamp(c["authorTimestamp"] / 1000, timezone.utc),
107-
"patch_set": self._get_patchset(client, repo.config["project"], repo.config["repo"], c["id"]),
107+
"patch_set": self._get_patchset(
108+
client, repo.config["project"], repo.config["repo"], c["id"]
109+
),
108110
}
109111
for c in commit_list["values"]
110112
]

0 commit comments

Comments
 (0)