Wikipedia:Bots/Requests for approval/PrimeBOT 7


 * The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was Symbol keep vote.svg Approved

PrimeBOT 7
Operator:

Time filed: 18:54, Monday, December 26, 2016 (UTC)

Automatic, Supervised, or Manual: automatic

Programming language(s): AWB

Source code available: AWB

Function overview: Replace deprecated parameters post-TFD merger of video game release and video game release new

Links to relevant discussions (where appropriate): TFD and the ensuing discussion

Edit period(s): one time run

Estimated number of pages affected: 13,000 ± 500

Exclusion compliant (Yes/No): yes

Already has a bot flag (Yes/No): yes

Function details: Using regex, will replace  with   in the template call in order to remove named parameters (which are being phased out thanks to better coding post-merge).

Discussion
We might want to account for when the parameter has no value. For instance would get converted to EU: NA

January 1, 2018:. This makes a link to EU but with NA as the link text, which I don't think is what we want &mdash; MusikAnimal  talk  02:58, 28 December 2016 (UTC)
 * Good point.  going to   would cover that, and would leave a blank second parameter. Primefac (talk) 03:09, 28 December 2016 (UTC)
 * It seems the new regex wouldn't work when there is both a parameter and value, and also won't capture the last parameter/value of the template since it is not followed by a pipe (I know you're not using Ruby, but I assume this evaluates in the same way). I think the first approach is less prone to error. Maybe we could only target parameters that have word-like characters as the value . With this you'll end up with something like EU: January 1, 2018

AUS: 1 January, 2017 which still leaves the, but the rendered template is correct. How does that sound? &mdash; MusikAnimal  talk  03:53, 28 December 2016 (UTC)
 * I could set up two searches, one which does  as you've suggested, and one which does , the latter replacing to  . This would catch both sets of conditions. Primefac (talk) 04:03, 28 December 2016 (UTC)
 * The latter  would have to account for when the pipe or closing }} is on a new line. If we can take care of that, a two-step process might work. A programmatic approach, if possible, might be more well-rounded. For instance, which accounts for all the weird possibilities with newlines, and both sets of conditions. Here you could check if there was a second value in the match group, and if not (as with match 2), remove that parameter altogether. Note the   to make   match newlines. If you want to go the simpler approach that's perfectly fine :) Do however make sure \w is a positive lookahead, which I forgot, otherwise that single word character would get removed. In Ruby this is  . See  vs  &mdash;  MusikAnimal  talk  04:41, 28 December 2016 (UTC)
 * Example 3 works a charm. Did some manual testing on my account . I tried looking for examples with newlines, but after 200 skips I figured I'd just go with it. I did test it out in AWB's regex tester, and the test case given in example 3 works fine. So, I think we'll go with that option. Primefac (talk) 16:29, 28 December 2016 (UTC)

but do link either here, the TfD or the discussion in the edit summary. The edit rate you went with for other tasks seems reasonable too – 10 to 20 edits per minute. We can speed this up a tad if there are no issues with the trial &mdash; MusikAnimal  talk  18:28, 28 December 2016 (UTC)
 * Primefac (talk) 00:43, 29 December 2016 (UTC)

I spot checked all 100 edits and everything checks out. There was one edit where the bot removed whitespace from an unrelated template. Why that happened I'm not sure, but it doesn't seem to a problem. I realize there's a lot of pages to go through so we might want to bump up the edit rate. I'm going to recommend around 30 edits per minute. We're not concerned about performance, but should something go wrong it's best it doesn't happen at high speed :) 30 EPM would amount to around seven hours to process all ~11,000 pages, but being an automatic bot task I assume this is not an issue &mdash; MusikAnimal  talk  05:44, 29 December 2016 (UTC)
 * The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.