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

LB-354: Allow deletion of user accounts #406

Merged
merged 4 commits into from May 16, 2018

Conversation

paramsingh
Copy link
Collaborator

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

  • JIRA ticket (optional): LB-354

Solution

First part of the user deletion stuff. Haven't worked on deleting listens from bq yet, I think
that should be a job ala stats_calculator stuff.

User deletion should delete all referencing rows
in stats, api_compat.token and api_compat.session
tables.
Also, add relevant tests. Needed to upgrade
influxdb-python as the `drop_measurement`
method is new.
NotFound if user isn't present in the database
"""

#TODO(param): delete user's listens from Google BigQuery
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is a job we should push into stats_calculator (might have to rename that to something that indicates generic bigquery operation executor)?

Copy link
Member

Choose a reason for hiding this comment

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

I think that is a good idea!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

@mayhem mayhem left a comment

Choose a reason for hiding this comment

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

I think this looks good -- please take a look at my two comments. I think this is ready for merging, but LB-354 is not complete yet since it does not include the bits about the musicbrainz-server callling LB to remove an account. I suppose it might be good to make a separate PR for that. We also need to open a ticket to keep track of the BigQuery data removal.

@@ -24,7 +24,7 @@ redis == 2.10.3
yattag == 1.6.0
xmltodict == 0.10.2
unittest2 == 1.1.0
influxdb == 4.1.0
influxdb == 5.0.0
Copy link
Member

Choose a reason for hiding this comment

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

Does this upgrade affect any other code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope, all tests pass. This upgrade was needed because influxclient.drop_measurement was introduced in 5.0.0 (used here)

Copy link
Member

Choose a reason for hiding this comment

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

Famous last words! I just have a gut-punch feeling every time I see a version updated for anything as critical as a DB. I hope you're right. :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

well, this isn't a db update per se, just a client update.

Copy link
Member

Choose a reason for hiding this comment

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

Understood, but it still raises my hackles and makes be really pay attention. Some level of paranoia really is useful. :)

NotFound if user isn't present in the database
"""

#TODO(param): delete user's listens from Google BigQuery
Copy link
Member

Choose a reason for hiding this comment

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

I think that is a good idea!

@paramsingh
Copy link
Collaborator Author

I'm gonna do the musicbrainz api endpoint in another PR, so I think this might be ready to merge, if we're okay with trying out the influxdb-client update. If not, I can drop measurements using direct queries too, but I think using the function should be okay.

Copy link
Member

@mayhem mayhem left a comment

Choose a reason for hiding this comment

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

🐿 🐭 🐀 !!

@mayhem mayhem merged commit 1bd502f into metabrainz:production May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants