Pywikibot touch edit

edit
Swept in from the pub

We had several edits marked "Pywikibot touch edit", such as this one. No change is shown, so what's going on? Ikan Kekek (talk) 09:04, 7 March 2023 (UTC)Reply

User:AKosiaris (WMF), could you elucidate? Ikan Kekek (talk) 09:05, 7 March 2023 (UTC)Reply
I don't exactly know what's going on, but I think it's because the edit might have been made using wikitech:PAWS? SHB2000 (talk | contribs | meta) 09:29, 7 March 2023 (UTC)Reply
OK, but why do none of these edits show any difference? Ikan Kekek (talk) 14:58, 7 March 2023 (UTC)Reply
That's a dummy edit, which should result in the cache being purged. WhatamIdoing (talk) 17:06, 7 March 2023 (UTC)Reply
It doesn't seem like one: there is no difference shown, while a dummy edit is "a slight change in a page's wikitext that has no effect on the rendered page" according to that page. The paragraph were that slight change was made should be shown with a previous and resulting version. A null edit, on the other hand, should not result in a history entry. –LPfi (talk) 19:18, 7 March 2023 (UTC)Reply
Thanks for the ping, I can add some more information. First, my intent was to do a series of null edits, not a series of dummy edit. However, in what apparently is a rare case, I seemingly have stumbled across a bug, where https://www.mediawiki.org/wiki/Manual:Pywikibot/touch.py creates a 1 character difference edit. I did not expect that and I 'll have to dig a bit into why that is happening. My assumption that it is a rare case is based on the fact I have per https://en.wikivoyage.org/wiki/Special:Contributions/AKosiaris_(WMF) 13 contributions while I have scheduled ~16000. So a little bit less than 1 in 1000.
Now as for the context, the whole story is tracked in https://phabricator.wikimedia.org/T226931, the TL;DR is that following the identification and fix for a bug affecting some APIs we wanted to trigger re-renders for ~16000 pages in enwikivoyage that were not re-rendered by usual editor actions in order to invalidate caches. AKosiaris (WMF) (talk) 07:42, 8 March 2023 (UTC)Reply
I think I found the issue by the way. Per https://en.wikivoyage.org/w/api.php?action=query&titles=Saint-Sever&rvprop=content&formatversion=2&rvslots=*&prop=revisions&rvlimit=2 the 2 revisions differ by a single newline (\n) character at the end of the revision. I am guessing there is a function somewhere in pywikibot that strips page ending whitespace (newline is whitespace) from the content before submitting it. AKosiaris (WMF) (talk) 08:03, 8 March 2023 (UTC)Reply
Thank you. What are APIs? Ikan Kekek (talk) 15:22, 8 March 2023 (UTC)Reply
Sorry, jargon slipped in my answer. It stands for Application Programming Interfaces. Essentially things that are meant to be used by computer programs directly as opposed to humans (at least usually and directly). The link I pasted above on how to get the 2 last revisions is a typical API, another one is something like https://en.wikivoyage.org/api/rest_v1/page/summary/Wikivoyage:Travellers%27_pub. As you can see, the text returned in both cases isn't immediately and easily read by a human, but a computer program that knows what to expect can do so very quickly and efficiently.
It's a very generic and abstract term. If I am not doing the explanation due service, maybe https://en.wikipedia.org/wiki/API can help more. AKosiaris (WMF) (talk) 16:46, 8 March 2023 (UTC)Reply
Sorry Ikan Kekek, I missed this discussion. I had asked AKosiaris (WMF) to initiate this. I made a quick note above, here, after the bot started running. I should have probably created a new section. My apologies. Brycehughes (talk) 14:53, 13 March 2023 (UTC)Reply
No apologies needed! I still don't fully understand what edits are being made, but it's not important for me to understand that in detail. Ikan Kekek (talk) 15:32, 13 March 2023 (UTC)Reply
Essentially, I use the Wikivoyage API, which I think AKosiaris explained earlier. There was a long-standing bug that caused the information to be returned from the API to be way out of date (for example, Uzebekistan I'd get an article from 2019, pre-pandemic, which was rather useless). So we finally got the bug fixed, but the responses to the API were still cached, i.e. kept in some Wikimedia Foundation computer's memory (bit more complicated but essentially) and not updated until someone actually goes and edits the page, which would clear the cache and update it in that computer's memory so we'd get the up-to-date page. So, there were 16,000ish articles that had not been edited since the bug was fixed, so we decided to use a "null-edit" bot that would update the articles, purge the caches, and (hopefully) not show up on people's watchlists. Clearly there was a small bug in that process but it looks like it didn't affect too many pages out of the 16,000. Sorry for the confusion and the bother. On a side note, these "null edits" should also help in clearing the caches for the problems we had with, for example, the map coordinates showing up in every section we had a map due to that infamous Kartography team bug. In any case, we should be all good now. I'll only add that AKosiaris (WMF) has been fantastic to work with and really adds to my faith in this whole WM foundation project in general. Brycehughes (talk) 17:35, 13 March 2023 (UTC)Reply