Skip to content

Conversation

@armenzg
Copy link
Member

@armenzg armenzg commented Dec 1, 2025

No description provided.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 1, 2025
@armenzg armenzg changed the title typing: Type organization_releases API typing: Remove organization_releases API from soft list Dec 1, 2025
@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 59.52381% with 17 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/api/endpoints/organization_releases.py 55.26% 17 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           master   #104154       +/-   ##
============================================
+ Coverage   65.84%    80.60%   +14.76%     
============================================
  Files        9322      9325        +3     
  Lines      398047    398296      +249     
  Branches    25477     25453       -24     
============================================
+ Hits       262086    321060    +58974     
+ Misses     135508     76782    -58726     
- Partials      453       454        +1     


def get_projects(self, request: Request, organization, project_ids=None, project_slugs=None):
# Since we are not trying to override the top-levelget_projects function, we need to type ignore the override
def get_projects( # type: ignore[override]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mypy thinks we're trying to override this which we are not:

def get_projects(
self,
request: HttpRequest,
organization: Organization | RpcOrganization,
force_global_perms: bool = False,
include_all_accessible: bool = False,
project_ids: set[int] | None = None,
project_slugs: set[str] | None = None,
) -> list[Project]:

elif sort == "semver":
queryset = queryset.annotate_prerelease_column()

order_by = [F(col).desc(nulls_last=True) for col in Release.SEMVER_COLS]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this block, order_by is a list while it's not in the next block, thus, creating different variable names.

self,
limit: int = 100,
cursor: Cursor | None = None,
count_hits: bool = False,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three parameters are not used, however, it needs to match the signature from the base class:

def get_result(
self,
limit: int = 100,
cursor: Cursor | None = None,
count_hits: bool = False,
known_hits: int | None = None,
max_hits: int | None = None,
) -> CursorResult[Any]:

@armenzg armenzg marked this pull request as ready for review December 1, 2025 16:48
@armenzg armenzg requested review from a team as code owners December 1, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants