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

ref(typing): Typing for the low priority symbolication queue #29017

Merged
merged 3 commits into from
Oct 2, 2021

Conversation

flub
Copy link
Contributor

@flub flub commented Oct 1, 2021

The most important change is the src/sentry/processing/init.py
which makes mypy recognise this package correctly. From that more
type checking was working and types needed to be fixed up.

@flub flub requested review from relaxolotl and loewenheim October 1, 2021 17:32
@flub flub requested a review from a team as a code owner October 1, 2021 17:32
@@ -106,6 +110,7 @@ def add_project_to_lpq(self, project_id: int) -> bool:
"""
raise NotImplementedError

# TODO(flub): See if this can be removed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

arguably i shouldn't have left this comment here. but it seems you should just be able to use the remove_projects_from_lpq() call instead, I don't think there's anything that this signature gives you that you can't do from the other one.

Comment on lines +49 to +51
for project_id in deleted_projects:
# TODO: add metrics!
logger.warning("Moved project out of symbolicator's low priority queue: %s", project_id)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the biggest logical change: we no longer try to figure out which projects may or may not have been removed (because the API doesn't allow us). Instead we rely on the fact the API will succeed or will raise an exception. So if we didn't die with an exception then this succeeded and all these projects were removed from the LPQ.

In theory a project could already have been removed before so it wasn't actually removed just now, but this really doesn't matter. And in any case if that happens our tasks are not keeping up with real time.

Copy link
Contributor

@relaxolotl relaxolotl left a comment

Choose a reason for hiding this comment

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

rebased off of #28714 as a shared parent branch just got merged into master.

also added in a commit to remove remove_project_from_lpq as after a discussion with @flub it turns out that this method just causes confusion because there's only a 1 character difference between that and its plural/set-equivalent operation. API symmetry isn't really doing us any favours in that situation; maybe if python was more properly strongly-typed then we could wave something like this off, but i don't think it makes sense in this situation.

Base automatically changed from feat/lpq/membership to master October 2, 2021 00:31
@relaxolotl
Copy link
Contributor

merging this in after #28714 so the commit tied to this isn't squashed in together with #28714's changes.

this is mostly for personal/future reference in case somebody like myself decides to look back at an existing commit that adds in typing as opposed to having to find all of the different spots that need to be updated from scratch.

Floris Bruynooghe and others added 3 commits October 1, 2021 20:33
The most important change is the src/sentry/processing/__init__.py
which makes mypy recognise this package correctly.  From that more
type checking was working and types needed to be fixed up.
@relaxolotl relaxolotl merged commit c39c504 into master Oct 2, 2021
@relaxolotl relaxolotl deleted the feat/lpq/typing branch October 2, 2021 02:22
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants