Skip to content

Commit

Permalink
chore(issues): Move OrganizationIssuesCount endpoint to issues endpoi…
Browse files Browse the repository at this point in the history
…nts (#83339)

Moves the `OrganizationIssuesCount` endpoint to issues endpoints

---------

Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
  • Loading branch information
MichaelSun48 and getsantry[bot] authored Jan 14, 2025
1 parent be3e5b9 commit d22b874
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ module = [
"sentry.api.endpoints.organization_events_meta",
"sentry.api.endpoints.organization_events_spans_performance",
"sentry.api.endpoints.organization_index",
"sentry.api.endpoints.organization_issues_count",
"sentry.api.endpoints.organization_member.details",
"sentry.api.endpoints.organization_member.index",
"sentry.api.endpoints.organization_member.requests.invite.details",
Expand Down
20 changes: 11 additions & 9 deletions src/sentry/api/helpers/group_index/index.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from collections.abc import Callable, Mapping, MutableMapping, Sequence
from datetime import datetime
from typing import Any
Expand Down Expand Up @@ -64,9 +66,9 @@ def parse_and_convert_issue_search_query(

def build_query_params_from_request(
request: Request,
organization: "Organization",
projects: Sequence["Project"],
environments: Sequence["Environment"] | None,
organization: Organization,
projects: Sequence[Project],
environments: Sequence[Environment] | None,
) -> MutableMapping[str, Any]:
query_kwargs = {"projects": projects, "sort_by": request.GET.get("sort", DEFAULT_SORT_OPTION)}

Expand Down Expand Up @@ -152,9 +154,9 @@ def build_query_params_from_request(


def validate_search_filter_permissions(
organization: "Organization",
organization: Organization,
search_filters: Sequence[SearchFilter],
user: "User",
user: User | AnonymousUser,
) -> None:
"""
Verifies that an organization is allowed to perform the query that they
Expand Down Expand Up @@ -256,7 +258,7 @@ def calculate_stats_period(
def prep_search(
cls: Any,
request: Request,
project: "Project",
project: Project,
extra_query_kwargs: Mapping[str, Any] | None = None,
) -> tuple[CursorResult[Group], Mapping[str, Any]]:
try:
Expand All @@ -283,7 +285,7 @@ def prep_search(

def get_first_last_release(
request: Request,
group: "Group",
group: Group,
) -> tuple[Mapping[str, Any] | None, Mapping[str, Any] | None]:
first_release = group.get_first_release()
if first_release is not None:
Expand All @@ -303,7 +305,7 @@ def get_first_last_release(
return first_release, last_release


def get_release_info(request: Request, group: "Group", version: str) -> Mapping[str, Any]:
def get_release_info(request: Request, group: Group, version: str) -> Mapping[str, Any]:
try:
release = Release.objects.get(
projects=group.project,
Expand All @@ -318,7 +320,7 @@ def get_release_info(request: Request, group: "Group", version: str) -> Mapping[

def get_first_last_release_info(
request: Request,
group: "Group",
group: Group,
versions: Sequence[str],
) -> Sequence[Mapping[str, Any]]:
releases = {
Expand Down
4 changes: 3 additions & 1 deletion src/sentry/api/issue_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from functools import partial
from typing import Optional, Union

from django.contrib.auth.models import AnonymousUser

from sentry.api.event_search import (
AggregateFilter,
ParenExpression,
Expand Down Expand Up @@ -260,7 +262,7 @@ def convert_device_class_value(
def convert_query_values(
search_filters: ParsedTerms,
projects: Sequence[Project],
user: User | RpcUser | None,
user: User | RpcUser | AnonymousUser | None,
environments: Sequence[Environment] | None,
value_converters=value_converters,
allow_aggregate_filters=False,
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
OrganizationGroupIndexEndpoint,
OrganizationGroupIndexStatsEndpoint,
OrganizationGroupSearchViewsEndpoint,
OrganizationIssuesCountEndpoint,
OrganizationReleasePreviousCommitsEndpoint,
OrganizationSearchesEndpoint,
ProjectEventDetailsEndpoint,
Expand Down Expand Up @@ -486,7 +487,6 @@
from .endpoints.organization_events_trends_v2 import OrganizationEventsNewTrendsStatsEndpoint
from .endpoints.organization_events_vitals import OrganizationEventsVitalsEndpoint
from .endpoints.organization_index import OrganizationIndexEndpoint
from .endpoints.organization_issues_count import OrganizationIssuesCountEndpoint
from .endpoints.organization_issues_resolved_in_release import (
OrganizationIssuesResolvedInReleaseEndpoint,
)
Expand Down
2 changes: 2 additions & 0 deletions src/sentry/issues/endpoints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .organization_group_index import OrganizationGroupIndexEndpoint
from .organization_group_index_stats import OrganizationGroupIndexStatsEndpoint
from .organization_group_search_views import OrganizationGroupSearchViewsEndpoint
from .organization_issues_count import OrganizationIssuesCountEndpoint
from .organization_release_previous_commits import OrganizationReleasePreviousCommitsEndpoint
from .organization_searches import OrganizationSearchesEndpoint
from .organization_shortid import ShortIdLookupEndpoint
Expand Down Expand Up @@ -45,6 +46,7 @@
"OrganizationGroupIndexEndpoint",
"OrganizationGroupIndexStatsEndpoint",
"OrganizationGroupSearchViewsEndpoint",
"OrganizationIssuesCountEndpoint",
"OrganizationReleasePreviousCommitsEndpoint",
"OrganizationSearchesEndpoint",
"ProjectEventDetailsEndpoint",
Expand Down

0 comments on commit d22b874

Please sign in to comment.