Repository navigation
Cleanup merge templates in target article v3 - #157
NovemLinguae wants to merge 12 commits into
Conversation
|
cc @FaviFake in case you aren't subscribed yet. Sorry for the delay on this. It's a pretty hard patch, and I've been pretty busy. Will keep trying to plug away at this every few days. The code that does the wikicode transformation is complete. Now I need to wire it into code that generates a list of pages to do the transformation on. I may end up doing this as two patches. It's good to split up complex patches into bite size chunks. Patch 1 would be just running the wikicode transformation on one type of page (source page? target page?), then patch 2 would generate a complete listOfPages according to the specification given and loop through it. |
|
No! Don't be sorry! It's unfortunate that the wiki half-unknowingly forced the sole active maintainer of a volunteer project to do such a hard task all on his own. Thanks for all the effort you've put into this huge project! I know precisely nothing about coding, but it sounds like you already did the hardest and most important part! For Patch 1, even if you check just one page it would be a big improvement. In the interim, you should run the the transformation on the I guess you can add the check for whether it's a redirect or it exists in patch 2, together with the rest of the list of pages to check. This is great, I'm starting to see the finish line! Thanks so much! |
|
@FaviFake Sorry this one is taking so long. It is quite complex, and XFDcloser is not fun to work on. I took a fresh look at this one tonight, and I think I'd like to add the intermediate step of making this a user script and asking you to test it out a bit. Would you mind? Phase 1 - Please install https://en.wikipedia.org/wiki/User:Novem_Linguae/Scripts/RemoveMergeTemplates.js , then please visit a page you'd like to process. Go into the More menu on Vector 2010 (or it may be in a different spot on other skins), click "Run RemoveMergeTemplates", type in the sourcePage and nominationName, then double check the diff and make sure there's no bugs. You can report any bugs in this ticket. A good way to report bugs might be to submit the buggy diff, then fix it in the next diff, then link the diff here. Phase 2 - Once I am confident the wikitext algorithm works well, then I can work on an algorithm that generates the list of pages to check. I can add that to the user script, along with links next to each page you can click that would load these diffs, and then we can double check that algorithm. Phase 3 - Finally, we'll eventually integrate all this into XFDcloser, once we're confident the algorithms work well. As an added bonus, making this a user script gives you a tool to fix these faster until we finally get everything integrated into XFDcloser. That all sound OK? |
|
@FaviFake How's testing going? |
|
I'm so sorry to respond 3 days later but unfortunately I've been swamped with work on another non-WMF wiki and have almost entirely ignored enwiki. I've installed the script and as soon as I open my watchlist I'll test it out, thank you so much! |
|
Oh wow we both independently commented at the same exact time! But yeah, it's been a surprisingly busy week for me. Unless my workload increases rather than diminish, I will have finished testing next week! I can't wait for the XFDcloser updates to be over! |
|
After this patch, I'm going to bail on XFDcloser patch writing and switch back to reviewing I think. Finishing that entire ticket may never happen or may take a very long time since someone will need to write the patches and I'll need to review them. You told me that this piece of the ticket is the most important though, so I am trying to get this one to the finish line for you. |
|
Yes this sounds perfect. The other items in my huge ticket are all really minor issues that pale in comparison to this one. If the folks at MFD will ever decide to allow merge proposals, they are free to figure out a simpler system. This transition has been incredibly hard on everyone involved with the BTS stuff and I can't imagine what it's like to be the only one willing to write the code, not because you enjoy doing it but for the benefit of the project. Thanks for always being so helpful Novem!! |
|
BTS? |
|
Behind The Scenes |
|
Sorry, Wikipedia has made me addicted to WP:3LA (three-letter acronyms) |
|
@NovemLinguae Alright, I tested it a bit and it works great! Most of these pages were modified by me beforehand to test some edge cases, otherwise they would've all looked the same because they're placed by Twinkle and nobody adds them by hand anymore. Successful tests where the script worked and the templates were removed correctly:
Unsuccessful tests where the script said "No changes needed!":
Unless they are extremely easy to fix, I do not think fixing the two cases where the template was unable to remove the template is worth your time. I don't think I've ever seen a merge template call that contained spaces between "{{" and the name of the template. Sometimes editors add content in the line containing the last hidden comment, but this is extremely rare and it's really not worth the time it takes to fix it. You should go ahead! In the meantime I'll continue to use your cute little script and I'll let you know here if I see something go wrong. |
|
@NovemLinguae I've used your script to remove a couple dozen more templates, and it works perfectly every time! I'm not entirely sure how you want Phase 2 to be tested, but all we would need to check is whether the list of pages generated by the script is the same as the mainspace and draftspace pages listed in the WhatLinksHere of the AfD subpage + the Unfortunately, I'm realising that, due to the way ticket #135 was organised, I forgot to mention that this item should also be part of this patch (I've now removed it from #135 and moved it at the bottom of this message for simplicity):
To sum up and clarify, this is the full plan for this patch:
So: remove all old tags and, if the discussion was closed as "merge", put just 1 tag on the For example, if Wikipedia:Articles for deletion/PAGE1 is closed with consensus to merge into TARGET, XFDcloser should do these two things:
However, if Wikipedia:Articles for deletion/PAGE2 is NOT closed as "merge" (let's say it's closed as "no consensus"), XFDcloser only needs to do 1 thing:
I admit I should've realised that this step was missing sooner, sorry about that. To help clarify everything, I've moved everything that this patch needs to do below. For the purposes of this patch, XFDcloser only needs to be modified to do the things below and nothing else. i. Build the list of pages to check.
ii. Once you have that list of pages, run RemoveMergeTemplates on each page on the list. (Look at every instance of {{Merge}}, {{merge from}}, {{Merge to}}, {{Article for deletion/dated}}, {{being merged to}}, {{being merged}}, {{being merged from}}, {{Merge portions from}}, or one of their redirects, and remove every one where the iii. If and only if the discussion was closed as merge (or "merge selectively" or "soft merge"), place |
Can you please edit #135 so that it includes what you removed in the same bullet as the rest of this patch, then take a screenshot and underline/circle whatever you changed/added, then post the screenshot here? |
|
@NovemLinguae Done! Here's the explanation of the screenshot below:
You can follow both instructions, but if you follow the ones at the bottom of my previous message in this conversation, they are simpler.
|
|
Sigh. That's a bunch of changes. This patch will be done around 2031 I think. lol |
|
No, it's basically the same! I only made it simpler and included the last step that I forgot to mention! That's the only real change: instead of (1) building the list and (2) running RemoveMergeTemplates on it, we (1) build the list, (2) run RemoveMergeTemplates on it, and (3) add |
|
I see a bunch of algorithm changes to roman numeral 1, which I had already pseudocoded. And I see the addition of a roman numeral 3, which will change the wikitext algorithm that we already tested. So will need to do some more testing after I change the code. Placing stuff below the hatnotes means I'll need to add an MOSOrderPositionFinder class, which luckily I have from working on other repos, but adds complexity. If I recall correctly, this is like the 3rd or 4th revision to the spec after people had started writing patches for it. I hope this is the last change to the spec. |
|
@NovemLinguae No no that's perfect, you can continue from the pseudocode you've already written! Don't start over! As I said, both specs are valid and correct. If you've already started working on the original roman numeral 1 or 2, continue from there and ignore my new spec! If you have not started on them, you can choose to follow the new spec, which is basically same but slightly easier to code. The two original roman numerals are simply more robust versions of the new first two bullet points. If you follow the original roman numerals, the script will work on even more edge cases. The last thing I would want is for you to start over, please continue from the first spec if you've already started working on it!!! Yes, the new "third" roman numeral is the only real addition. I hadn't realised it was missing until now, but it needs to be part of this patch unfortunately. Sorry! Yes, that's exactly why I removed it! As I said, all of the text I highlighted in in my screenshot (including the light blue text) is stuff I've removed from the spec, not added. The only thing I've added is roman numeral 3. I specifically removed the part that says "below hatnotes" so that you wouldn't need to worry about that! Of course, it would be nice if the templates were added below hatnotes, but it's absolutely not necessary and I wouldn't want you to waste more time on this patch just to code that, so i removed it. Yes, it is, sorry! As I said, you can discard this new spec completely except the numeral 3. You can follow the original numerals 1 and 2 exactly as they were written, but unfortunately the 3rd one needs to be added. I think you misread my screenshot. Everything I highlighted was already present in the previous spec and I removed it for simplicity. The colours are not "blue was added and red was removed", both colours mean "removed". I had explained this above the screenshot itself. |
|
Yes, exactly! The only change needed is the addition of numeral 3. You can choose to keep or ignore the text you highlighted in red. If you haven't started to work on an item on the list, it's best to ignore it so you have less work to do. If you've already started working on it, you can keep following the red spec. |
|
Would it be helpful if I asked on a technical noticeboard if anyone wants to help write the code for this patch? I imagine you haven't started working on roman numeral 3, so I guess someone could develop that part in parallel, while you finish. Or they could do the entire rest of the patch themselves, and we could jump to testing it! A few months before voorts proposed merging PAM into AfD, I remember DVRTed was developing a script to automatically add the {{merge}} templates when creating a new PAM proposal. Maybe they'd be willing to help out with this one too! What do you think? |
|
I'm busy for a couple weeks with IRL stuff. Feel free to have others take a look at and help with this patch. If some discussion occurs onwiki, maybe drop a link in this ticket so I can follow along. |


Related #135
Related #151