Wikipedia:Bots/Requests for approval/DeprecatedFixerBot 2
- 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 Approved.
Operator: TheSandDoctor (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 16:40, Wednesday, March 14, 2018 (UTC)
Automatic, Supervised, or Manual: automatic
Programming language(s): Python
Source code available: https://github.com/TheSandDoctor/DivCol-ColumnsList-Fix
Function overview: Remove deprecated parameters from both Template:Columns-list and Template:Div col transclusions, as found in Category:Pages using Columns-list with deprecated parameters and Category:Pages using div col with deprecated parameters
Links to relevant discussions (where appropriate): Template talk:Div col#Proposal for standardized changes (by bot or AWB)
Edit period(s): Routine runs until categories are cleared, possible maintenance runs in future
Estimated number of pages affected: 57,000+
Exclusion compliant (Yes/No): Yes
Already has a bot flag (Yes/No): Yes
Function details: The bot would run through one category at a run in a series of subsequent runs.
As described in the linked discussion,
#1 {{div col|2}} → {{div col}} #2 {{div col|cols=2}} → {{div col}} #3 {{colbegin|2}} → {{div col}} #4 {{colbegin|cols=2}} → {{div col}} (etc. for other redirects) #4 {{colbegin|3}} (or cols=3) → {{div col|colwidth=22em}} #4 {{colbegin|4}} (or cols=4) → {{div col|colwidth=18em}} #4 {{colbegin|5}} (or cols=5) → {{div col|colwidth=15em}} #4 {{colbegin|6}} (or cols=6) → {{div col|colwidth=13em}} #4 {{colbegin|7+}} (or cols=7+) → {{div col|colwidth=10em}} (any number of columns 7 or higher) #5 {{Columns-list|2| → {{Columns-list|colwidth=30em| (while we're here; also do for all redirects to this one) #5 {{Columns-list|3| → {{Columns-list|colwidth=22em| (and etc. as below) #6 {{div col||([0-9]em)}} → {{div col|colwidth=$1}} #7 {{div col|([0-9]em)}} → {{div col|colwidth=$1}} (as currently coded, this is an error, but fixable) #8 {{colend}} → {{div col end}} (replace all end template redirects with div col end)
If the bot finds the first unnamed parameter, it assesses its value. If the value is less than 2 (1), then it removes that parameter so the template is set to its default value. If the value is between 2 and 6, it changes as shown above. If the value is 7 or greater, then the bot changes the value to 10em.
In offline tests (printing both input and output to individual local files on a random few), it worked as expected.
Discussion
[edit]- If you would like a dry run with outputted files put in the GitHub repository, I would certainly be open to doing that. --TheSandDoctor (talk) 16:48, 14 March 2018 (UTC)[reply]
@TheSandDoctor: Per WP:BOTACC "The account's name should identify the bot function (e.g. <Task>Bot), or the operator's main account (e.g. <Username>Bot)." I would find it extremely confusing if a Twitter-related bot started to do div-related changes. We need either a new bot account, or a rename of the existing bot account (such as TheSandDoctor's Bot / TheSandDoctorBot or similar). This also applies to Wikipedia:Bots/Requests for approval/TweetCiteBot 2. Headbomb {t · c · p · b} 21:33, 17 March 2018 (UTC)[reply]
- Moved task from TweetCiteBot to DeprecatedFixerBot. --TheSandDoctor (talk) 21:59, 17 March 2018 (UTC)[reply]
I'm a bit concerned this could fall under WP:CONTEXTBOT. I can conceive of cases where exactly two or exactly three columns is what is meant, rather than a more lax "well on my screen, 3 columns looks nicer so let's go with that". You might argue that those should be done with different templates, but how would the bot deal with something like say
- Team A
- Alice
- Bob
- Charles
- Team B
- Denver
- Emily
- Fiona
- Team C
- Gilligan
- Hector
- Ines
Headbomb {t · c · p · b} 17:08, 21 March 2018 (UTC)[reply]
- @Headbomb: It would just remove "cols" and use the default, nothing would visibly change (aside from a slight shift left on my screen at least, but barely noticeable).
- Team A
- Alice
- Bob
- Charles
- Team B
- Denver
- Emily
- Fiona
- Team C
- Gilligan
- Hector
- Ines
- Like that. --TheSandDoctor Talk 17:23, 21 March 2018 (UTC)[reply]
- What about the 3 column output then (updated my example)? Also this seems to contradict the listed logic "{{div col|cols=2}} →
{{div col}}{{div col|colwidth=30em}}"Headbomb {t · c · p · b} 17:53, 21 March 2018 (UTC)[reply]- Headbomb, please read the linked discussion above. Specifying a number of columns is deprecated behavior, for the same reason that the behavior was deprecated (and removed) in {{reflist}}. This is just a continuation of that work. – Jonesey95 (talk) 18:16, 21 March 2018 (UTC)[reply]
- @Jonesey95: I agree it's deprecated, what IOwant to know is how the bot deals with when this is intended behaviour and either screws up with that intended behaviour, or how it avoids screwing up with that intended behaviour. The discussion offers no insight on this. Headbomb {t · c · p · b} 19:12, 21 March 2018 (UTC)[reply]
- @Headbomb: It would look like this
- Headbomb, please read the linked discussion above. Specifying a number of columns is deprecated behavior, for the same reason that the behavior was deprecated (and removed) in {{reflist}}. This is just a continuation of that work. – Jonesey95 (talk) 18:16, 21 March 2018 (UTC)[reply]
- What about the 3 column output then (updated my example)? Also this seems to contradict the listed logic "{{div col|cols=2}} →
- Team A
- Alice
- Bob
- Charles
- Team B
- Denver
- Emily
- Fiona
- Team C
- Gilligan
- Hector
- Ines
- I was hesitant in responding until I figured out the issue. For some reason, when I previously set colwidth to 22em, it just gave a vertical list, yet now it posts normally. Clearly I did something wrong. Either way, works now? (cc @Jonesey95: --TheSandDoctor Talk 18:20, 21 March 2018 (UTC)[reply]
- Also, sorry about the contradictions, they have now been resolved. --TheSandDoctor Talk 18:21, 21 March 2018 (UTC)[reply]
- I was hesitant in responding until I figured out the issue. For some reason, when I previously set colwidth to 22em, it just gave a vertical list, yet now it posts normally. Clearly I did something wrong. Either way, works now? (cc @Jonesey95: --TheSandDoctor Talk 18:20, 21 March 2018 (UTC)[reply]
- Can you please clarify what a "screwup" would look like? If you mean converting "cols=2" to "colwidth=30em", that is not a screwup, that is the consensus of the editors at the linked discussion. Specifying a fixed number of columns using the {{div col}} template is deprecated behavior (see the template's documentation) that is being removed. Since there are 40,000 articles that use deprecated parameters in the template, a bot is the least disruptive way to make that change. – Jonesey95 (talk) 20:20, 21 March 2018 (UTC)[reply]
- I've already clarified above with the 3 column example above. The 3 columns in that case would be intentional, and it is not something that converted to 22em because it screws up the intended layout (zoom in/out of the page to see that it's messed up). So the question is how does the bot plan on either a) avoiding those sort of edits or b) providing a way for editors to restore the fixed-column format when it was intended / is desired, without the bot edit-warring with them over and over. Headbomb {t · c · p · b} 20:39, 21 March 2018 (UTC)[reply]
- Thank you. The example was not clear to me, because the "after the bot" example used div col without any parameters, which is not how the bot will work. I have added colwidth=22em to the "after" example, and the columns look the same to me on my normal-sized screen.
-
- I see what you mean about zooming in and out, but that is the best compromise. The cols=3 format fails on mobile (it displays only one column), so it is already broken. It has been deprecated for four years for this and other reasons, so editors have had plenty of time to make other choices. Changing to use colwidth makes div col work better on a wider variety of devices. If people want fixed columns, they need to use one of the other templates listed in the See also section of the documentation. – Jonesey95 (talk) 20:52, 21 March 2018 (UTC)[reply]
- Then the bot should point to that documentation, either with instructions on the bot page on what to do when the bot touches something people don't want touched, similar to this, or with an edit summary link to the documentation which points to the templates people can use to create fixed columns. Or both. Headbomb {t · c · p · b} 21:02, 21 March 2018 (UTC)[reply]
- Good idea. I have updated the template documentation to clarify how to get a fixed number of columns. The bot's edit summary should contain a link to the template. – Jonesey95 (talk) 21:15, 21 March 2018 (UTC)[reply]
- Approved for trial (10 edits for each "type" of edits listed above.). Please provide a link to the relevant contributions and/or diffs when the trial is complete. That works for me. The edit summary should specifically point to Template:Div col#Usage of "cols" parameter as a resource link for editors. Headbomb {t · c · p · b} 21:21, 21 March 2018 (UTC)[reply]
- @Headbomb:
Could you please clarify "type"? Pages with 1-10 as the cols parameter or? --TheSandDoctor Talk 00:30, 22 March 2018 (UTC)[reply]
You mean 10 times the number of "types" specified in the original list in nomination, correct? --TheSandDoctor Talk 01:04, 22 March 2018 (UTC)[reply]
- @Headbomb:
- Approved for trial (10 edits for each "type" of edits listed above.). Please provide a link to the relevant contributions and/or diffs when the trial is complete. That works for me. The edit summary should specifically point to Template:Div col#Usage of "cols" parameter as a resource link for editors. Headbomb {t · c · p · b} 21:21, 21 March 2018 (UTC)[reply]
- Good idea. I have updated the template documentation to clarify how to get a fixed number of columns. The bot's edit summary should contain a link to the template. – Jonesey95 (talk) 21:15, 21 March 2018 (UTC)[reply]
- Then the bot should point to that documentation, either with instructions on the bot page on what to do when the bot touches something people don't want touched, similar to this, or with an edit summary link to the documentation which points to the templates people can use to create fixed columns. Or both. Headbomb {t · c · p · b} 21:02, 21 March 2018 (UTC)[reply]
- I see what you mean about zooming in and out, but that is the best compromise. The cols=3 format fails on mobile (it displays only one column), so it is already broken. It has been deprecated for four years for this and other reasons, so editors have had plenty of time to make other choices. Changing to use colwidth makes div col work better on a wider variety of devices. If people want fixed columns, they need to use one of the other templates listed in the See also section of the documentation. – Jonesey95 (talk) 20:52, 21 March 2018 (UTC)[reply]
- I've already clarified above with the 3 column example above. The 3 columns in that case would be intentional, and it is not something that converted to 22em because it screws up the intended layout (zoom in/out of the page to see that it's messed up). So the question is how does the bot plan on either a) avoiding those sort of edits or b) providing a way for editors to restore the fixed-column format when it was intended / is desired, without the bot edit-warring with them over and over. Headbomb {t · c · p · b} 20:39, 21 March 2018 (UTC)[reply]
Done. I've numbered the 'types' in the original description. Anything with the same # is the same 'type'. Headbomb {t · c · p · b} 01:06, 22 March 2018 (UTC)[reply]
- Thanks Headbomb. Would it be okay if I (or you or anyone else) set up these situations in a sandbox and just had the bot run over that? It would be simpler/easier and quicker to do. --TheSandDoctor Talk 02:08, 22 March 2018 (UTC)[reply]
- Sure. But after you've done sandbox testing, do 50 random edits in mainspace. What's in the wild is often not as we expect it to be. Headbomb {t · c · p · b} 02:26, 22 March 2018 (UTC)[reply]
- @Headbomb: Sandbox test done. I don't think I missed any. If you are happy with that, then I will do the 50 random articles. (If you aren't, bot can easily be tweaked and re-run on sandbox) --TheSandDoctor Talk 03:24, 22 March 2018 (UTC)[reply]
- @TheSandDoctor: sure, go to mainspace. 50 edits, as stated above. Headbomb {t · c · p · b} 03:25, 22 March 2018 (UTC)[reply]
- As a note, I'd use "or message" rather than "and message" in the summary, otherwise it makes it seems like people need to do both. Headbomb {t · c · p · b} 03:28, 22 March 2018 (UTC)[reply]
- Trial complete. @Headbomb: Didn't see that until after the run, but rest assured I just changed it in the code. All 50 edits done, no issues. --TheSandDoctor Talk 03:41, 22 March 2018 (UTC)[reply]
- Nice work. I inspected all of the edits and saw only one problem, templates being changed from their actual names to lower-case names, in some cases breaking the templates. I see that you reverted that change and it did not happen again. – Jonesey95 (talk) 04:08, 22 March 2018 (UTC)[reply]
- @Jonesey95: Ah, yes. That problem. TweetCiteBot's rewrite and the first task for this bot had that issue (as they all share some code in common). It was a line left over from testing in dry runs (just outputting text to in and out.txt locally) that was A: redundant and B: didn't work as intended. Because I have had issues like that in the past, I tend to run any live editing task with 1 or 2 edits tops at the beginning to check for errors like that (that way they are easily reverted and corrected). I reran the bot on that page shortly after (1 minute later) to confirm that the issue had been sorted (which it had). --TheSandDoctor Talk 04:18, 22 March 2018 (UTC)[reply]
- Nice work. I inspected all of the edits and saw only one problem, templates being changed from their actual names to lower-case names, in some cases breaking the templates. I see that you reverted that change and it did not happen again. – Jonesey95 (talk) 04:08, 22 March 2018 (UTC)[reply]
- Trial complete. @Headbomb: Didn't see that until after the run, but rest assured I just changed it in the code. All 50 edits done, no issues. --TheSandDoctor Talk 03:41, 22 March 2018 (UTC)[reply]
- As a note, I'd use "or message" rather than "and message" in the summary, otherwise it makes it seems like people need to do both. Headbomb {t · c · p · b} 03:28, 22 March 2018 (UTC)[reply]
- @TheSandDoctor: sure, go to mainspace. 50 edits, as stated above. Headbomb {t · c · p · b} 03:25, 22 March 2018 (UTC)[reply]
- @Headbomb: Sandbox test done. I don't think I missed any. If you are happy with that, then I will do the 50 random articles. (If you aren't, bot can easily be tweaked and re-run on sandbox) --TheSandDoctor Talk 03:24, 22 March 2018 (UTC)[reply]
- Sure. But after you've done sandbox testing, do 50 random edits in mainspace. What's in the wild is often not as we expect it to be. Headbomb {t · c · p · b} 02:26, 22 March 2018 (UTC)[reply]
@TheSandDoctor: got a link to trial diffs? Headbomb {t · c · p · b} 16:11, 23 March 2018 (UTC)[reply]
- @Headbomb: They kind of were buried, weren't they. Starting (and ending) here (about half way down or just to Ctrl + F for "div col" to find them). Some randomly selected diffs from that page : 1, 2, 3, 4) --TheSandDoctor Talk 16:31, 23 March 2018 (UTC)[reply]
- @Frietjes: That is unrelated to this bot request, but I accidentally substituted Infobox film as well. Thank you for reverting that as I had not noticed. I have since gone back and correctly substituted just Infobox Album (which cleans up its params and properly removes deprecated params per Category:Music infoboxes with deprecated parameters, Template:Infobox album#Code, Wikipedia:Substitution trick. --TheSandDoctor Talk 15:45, 24 March 2018 (UTC)[reply]
{{BAGAssistanceNeeded}} --TheSandDoctor Talk 23:15, 29 March 2018 (UTC)[reply]
- @TheSandDoctor: Sorry, with the end of the semester here, I forgot about this one. Approved for extended trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. to ensure the issues above have been resolved. Headbomb {t · c · p · b} 17:27, 4 May 2018 (UTC)[reply]
- 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.