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(api): Publish ProjectFiltersEndpoint #78954

Closed
wants to merge 1 commit into from

Conversation

RyanSkonnord
Copy link
Contributor

No description provided.

@RyanSkonnord RyanSkonnord requested a review from a team October 10, 2024 18:07
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 10, 2024

class ProjectFiltersResponse(TypedDict):
id: int
active: bool
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure whether it's safe to document this as a bool. Per the comment on ProjectFiltersEndpoint.get:

                    # 'active' will be either a boolean or list for the legacy browser filters
                    # all other filters will be boolean

Looking at inbound_filters.get_filter_state, there's one path where it returns arbitrary ProjectOption.objects.get_value results in the _legacy_browsers_filter case. Is that worth documenting, and if so how should we capture what seems to be freeform data?

parameters=[GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG],
responses={
200: inline_sentry_response_serializer(
"ProjectFiltersResponse", ProjectFiltersResponse
Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAICT an ad-hoc TypedDict is appropriate here. Let me know if there's a better convention to follow for naming and/or where to define it.

@vgrozdanic
Copy link
Member

Should we also type hint resultsas results: ProjectFiltersResponse = ... inside the get method, so that mypy can catch changes in response that might not be updated in a typeddict used for API documentation?

@getsantry
Copy link
Contributor

getsantry bot commented Nov 1, 2024

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Nov 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants