AO3-6015 Add script to provide user data for guests - #5998
Open
pmonfort wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
AO3-1234 Fix thing)Issue
https://otwarchive.atlassian.net/browse/AO3-6015
Purpose
Adds
script/get_email_data.rb, a console script that col a given email address (guest activity and account history), following the same output format asscript/get_user_data.rb.The report includes:
destroyactionPR #4997 was closed because it searched the audits table with
LIKE '%email%', which can't use an index and requires a full table scan. This PR takes a different approach:users.email,users.unconfirmed_email, anduser_past_emails(AO3-7249), and audits are then loaded byauditable_id, sive queries.LIKEquery, split into bounded primary-key chunks so no single query runs unbounded. Candidates are verified against the exact emailorguest@example.comcan't pull in data fromaguest@example.com.Notes:
Testing Instructions
bundle exec rails r script/get_email_data.rbnto the deep search promptyto the deep search promptReferences
Replaces the approach from #4997. Output format follows #3393 and #3403 (AO3-5486)
Credit
Pablo Monfort (he/him), based on previous work by brianjaustin in #4997 and sarken in #3393