mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
127 stars 41 forks source link

Remove old ip address fields from our models #1902

Open diox opened 2 years ago

diox commented 2 years ago

Once we're sure we no longer need the legacy plain text ip address columns we have in various models for old manual queries, we should remove them. The binary field in IPLog made in mozilla/addons#8855 should be used for all our queries.

This includes:

All code that uses those fields need to be updated to use the IPLog binary field instead. The fields need to be set as nullable and then the columns removed in a subsequent push.

This should happen on December 1st at the earliest: 180 days after the push that introduced IPLog logging for Ratings, which we didn't backfill (the activity logs for ratings are not kept longer than that).

Note that FileUpload.ip_address needs to be kept. This is because we rely on it to keep the ip address used at upload time when we later log the IP in IPLog when the Version is created. We could consider adding a separate ActivityLog for FileUpload creation, find it when the Version is created to link it, but that's a bit cumbersome.

┆Issue is synchronized with this Jira Task

eviljeff commented 2 years ago

Note that FileUpload.ip_address needs to be kept. This is because we rely on it to keep the ip address used at upload time when we later log the IP in IPLog when the Version is created.

Should we update the field in FileUpload to be an IPAddressBinaryField too then? It's more "correct" but also arguably unnecessary as we don't search for ips over the FileUpload table (at least, that I'm aware of).

diox commented 2 years ago

We could, but I don't think that's necessary, for the reason you gave. It's really only there to keep the IP temporarily and pass it down at version creation time.

eviljeff commented 1 year ago

@wagnerand are any of these fields still used in queues queries, that you're aware of?

eviljeff commented 1 year ago

blocked. https://github.com/eviljeff/olympia/tree/19672-drop-old-ip-address-fields has progress so far.

KevinMind commented 6 months ago

Old Jira Ticket: https://mozilla-hub.atlassian.net/browse/ADDSRV-120