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

Update RemoveSpamAccount admin script for MBS-9357 (part 1) #526

Merged
merged 1 commit into from
Sep 7, 2017

Conversation

yvanzo
Copy link
Contributor

@yvanzo yvanzo commented Jun 26, 2017

First part of MBS-9357:

  • Allow filtering on email, website, and bio (additionally to name)
  • Support POSIX regular expression (in place of prefix)
  • Use case-sensitive operator by default (instead of insensitive)
  • Preserve accounts with edits/votes/OAuth tokens by default
  • Add options for operator case-sensitivity and verbosity level
  • Show help message (documentation) in case of incorrect usage

@yvanzo yvanzo requested a review from mwiencek June 26, 2017 18:37
Copy link
Member

@mwiencek mwiencek left a comment

Choose a reason for hiding this comment

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

I only have some style suggestions. You can merge if you're happy with it.

"dryrun|d" => \$dry_run,
"force|f" => \$force,
) or return 2;
"caseinsensitive|i" => \$case_insensitive,
Copy link
Member

Choose a reason for hiding this comment

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

ignore-case|i for matching is?

foreach my $ed (@{$editors}) {
my $details = "'" . $ed->{name} . "'";
if ($verbose && $column ne 'name') {
$details .= " [${column}='" . $ed->{$column} . "']";
Copy link
Member

Choose a reason for hiding this comment

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

Since you're intentionally adding surrounding '', I assume you want that to be a valid SQL literal, so I might suggest $dbh->quote($ed->{$column}) instead. I suppose it doesn't matter if this is just for logging, but outputting unescaped quotes could potentially be irritating in either case. :P

@yvanzo yvanzo force-pushed the mbs-9357-part-1-admin-script branch from 851bba1 to 3ce91a4 Compare September 7, 2017 16:23
- Allow filtering on email, website, and bio (additionally to name)
- Support POSIX regular expression (in place of prefix)
- Use case-sensitive operator by default (instead of insensitive)
- Preserve accounts with edits/votes/OAuth tokens by default
- Add options for operator case-sensitivity and verbosity level
- Show help message (documentation) in case of incorrect usage
@yvanzo yvanzo force-pushed the mbs-9357-part-1-admin-script branch from 3ce91a4 to 0842e29 Compare September 7, 2017 16:26
@yvanzo yvanzo merged commit 103d0f5 into metabrainz:master Sep 7, 2017
@yvanzo yvanzo deleted the mbs-9357-part-1-admin-script branch July 26, 2018 16:10
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