Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(performance): Delete is-key-transaction endpoint #28656

Merged
merged 2 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/sentry/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from sentry.data_export.endpoints.data_export import DataExportEndpoint
from sentry.data_export.endpoints.data_export_details import DataExportDetailsEndpoint
from sentry.discover.endpoints.discover_key_transactions import (
IsKeyTransactionEndpoint,
KeyTransactionEndpoint,
KeyTransactionListEndpoint,
)
Expand Down Expand Up @@ -837,11 +836,6 @@
KeyTransactionListEndpoint.as_view(),
name="sentry-api-0-organization-key-transactions-list",
),
url(
r"^(?P<organization_slug>[^\/]+)/is-key-transactions/$",
IsKeyTransactionEndpoint.as_view(),
name="sentry-api-0-organization-is-key-transactions",
),
url(
r"^(?P<organization_slug>[^\/]+)/related-issues/$",
OrganizationEventsRelatedIssuesEndpoint.as_view(),
Expand Down
26 changes: 1 addition & 25 deletions src/sentry/discover/endpoints/discover_key_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from sentry.api.serializers import Serializer, register, serialize
from sentry.api.utils import InvalidParams
from sentry.discover.endpoints import serializers
from sentry.discover.models import KeyTransaction, TeamKeyTransaction
from sentry.discover.models import TeamKeyTransaction
from sentry.models import ProjectTeam, Team


Expand All @@ -24,30 +24,6 @@ class KeyTransactionPermission(OrganizationPermission):
}


class IsKeyTransactionEndpoint(KeyTransactionBase):
permission_classes = (KeyTransactionPermission,)

def get(self, request, organization):
"""Get the Key Transactions for a user"""
if not self.has_feature(request, organization):
return Response(status=404)

project = self.get_project(request, organization)

transaction = request.GET.get("transaction")

try:
KeyTransaction.objects.get(
organization=organization,
owner=request.user,
project=project,
transaction=transaction,
)
return Response({"isKey": True}, status=200)
except KeyTransaction.DoesNotExist:
return Response({"isKey": False}, status=200)


class KeyTransactionEndpoint(KeyTransactionBase):
permission_classes = (KeyTransactionPermission,)

Expand Down
5 changes: 0 additions & 5 deletions tests/js/spec/views/performance/transactionEvents.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ describe('Performance > TransactionSummary', function () {
body: [],
});
// @ts-expect-error
MockApiClient.addMockResponse({
url: '/organizations/org-slug/is-key-transactions/',
body: [],
});
// @ts-expect-error
MockApiClient.addMockResponse({
url: '/prompts-activity/',
body: {},
Expand Down
4 changes: 0 additions & 4 deletions tests/js/spec/views/performance/transactionSummary.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ describe('Performance > TransactionSummary', function () {
url: '/prompts-activity/',
body: {},
});
MockApiClient.addMockResponse({
url: '/organizations/org-slug/is-key-transactions/',
body: [],
});

// Mock totals for the sidebar and other summary data
MockApiClient.addMockResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ describe('Performance Transaction Events Content', function () {
body: [],
});
// @ts-expect-error
MockApiClient.addMockResponse({
url: '/organizations/org-slug/is-key-transactions/',
body: [],
});
// @ts-expect-error
MockApiClient.addMockResponse({
url: '/prompts-activity/',
body: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ describe('Performance GridEditable Table', function () {
body: [],
});
// @ts-expect-error
MockApiClient.addMockResponse({
url: '/organizations/org-slug/is-key-transactions/',
body: [],
});
// @ts-expect-error
MockApiClient.addMockResponse({
url: '/prompts-activity/',
body: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ describe('Performance > Transaction Tags', function () {
url: '/organizations/org-slug/tags/user.email/values/',
body: [],
});
MockApiClient.addMockResponse({
url: '/organizations/org-slug/is-key-transactions/',
body: [],
});
MockApiClient.addMockResponse({
url: '/organizations/org-slug/events-facets-performance/',
body: {
Expand Down
4 changes: 0 additions & 4 deletions tests/js/spec/views/performance/transactionVitals.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ describe('Performance > Web Vitals', function () {
url: '/organizations/org-slug/projects/',
body: [],
});
MockApiClient.addMockResponse({
url: '/organizations/org-slug/is-key-transactions/',
body: [],
});
MockApiClient.addMockResponse({
url: '/organizations/org-slug/project-transaction-threshold-override/',
method: 'GET',
Expand Down