[15:00:28] Technical Advice IRC meeting starting in 60 minutes in channel #wikimedia-tech, hosts: @nuria - all questions welcome, more infos: https://www.mediawiki.org/wiki/Technical_Advice_IRC_Meeting [15:28:14] heh, another meeting and I just happen to have a question :-D see folks in half an hour! [15:50:12] Technical Advice IRC meeting starting in 10 minutes in channel #wikimedia-tech, hosts: - all questions welcome, more infos: https://www.mediawiki.org/wiki/Technical_Advice_IRC_Meeting [16:03:58] apergos: apparently we ended up with no hosts for TAIM this week, but !ask and maybe I or someone else who is lurking can help [16:04:05] heh [16:05:04] oh I was going to keep slugging away at it; I want formatversion 2 for mediawiki api login so I don't have to dig 'failed' out of the json but that doesn't seem to be happening [16:08:05] interesting. So action=login&formatversion=2 is not returning in the expected format? [16:08:48] Hi, I've created https://gerrit.wikimedia.org/r/c/mediawiki/core/+/544296 to make link batches use injected services through a factory, but there's one test (from CirrusSearch) failing. This is because the LinkBatch constructor now call the service locator, something it previously did not. The CirrusSearch tests however are Unit tests, so there is [16:08:49] no service locator available. I also can't just turn them into Integration tests, as there's a test inheritance structure I'd have to break. [16:09:29] So, my question is: what should I fix? CirrusSearch? That can't be changed to use the introduced service until the patch is merged, and the patch doesn't merge until CirrusSearch is fixed [16:09:59] I can help out with TAIM too. [16:10:11] I can't make the tests inject a dummy service because the LinkBatch construction is buried somewhere in CirrusSearch [16:10:30] mainframe98: that sounds like a "fun" dependency loop to break and I was going to suggest you see what James_F has to say so ... :) [16:10:41] * James_F laughs. [16:11:28] {"login":{"result":"Failed","reason":{"code":"wrongpassword","text":"Incorrect username or password entered. Please try again."}}} [16:11:44] mainframe98: As the breakage shows, you're making a breaking change. Normally that has to go through a forwards-/backwards-compatibility cycle. [16:11:57] that' what I get, rather than a nice 'errors' : and a list [16:12:21] and that's with formatversion=2 and errorformat=plaintext and all the rest [16:12:41] (sorry, I was off in another window trying and fialing to get anything different/better) [16:12:47] In this case that's probably not feasible. For these edge cases, make the CirrusSearch patch to fix how it works with a "Depends-On:" line on both the MW and CirrusSearch repos (and make a patch for every other important repo), and then someone like me will have to force-merge one of them to cut the Gordian knot. [16:14:52] James_F: That would work. Should both patches depend on each other? [16:15:36] apergos: just playing around with Special:ApiSandbox, it looks to me like the login.result response is the same for both formatversion=1 and formatversion=2. Maybe this is a bug in the implementation of the response format for that action? [16:15:51] Yes. Normally that makes it impossible for CI to land (tree, not a cyclic graph), but in this case we're force-merging so it works. [16:15:56] or a poorly documented 'feature' [16:16:05] yeah i went to the sandbox and didn't get anything better there either [16:16:10] The two-way dependency makes CI actually test both together in both repos and so prove that post-merge the test will pass. [16:16:18] Oh, that's devious. Thanks! [16:16:24] maybe we should ask anomie [16:16:35] who did a lot of the error return cleanup for the api [16:18:05] * anomie looks at backscroll [16:19:14] ah sorry [16:19:38] yeah I can't get format version 2 (a nice errors list) from mw api 'login' action [16:19:46] I get {"login":{"result":"Failed","reason":{"code":"wrongpassword","text":"Incorrect username or password entered. Please try again."}}} [16:19:49] which is suboptimal [16:20:22] apergos: formatversion=2 doesn't change the format of the response from action=login, you'd still have to dig out the "Failed". Changing the semantics of the response rather than just the way they're converted to JSON is beyond what formatversion is for. [16:21:02] is there any hope for it to return its errors as 'errors' someday, or is that an outlier? [16:25:01] If someone were to write a patch adding a parameter to ApiLogin to have it report failures as errors rather than in the legacy format it uses, I'd review it. [16:25:10] heh [16:25:33] I'm too full up to be nerd-sniped into it but that is a good outlook for the future, thanks! [16:26:04] I've never really cared about this before in other scripts, just was trying to make everything look and behave nice... [16:26:43] To make the nerd-snipe easier, MatmaRex just did some patches converting API errors to real errors for saving hooks via TitleBlacklist and others. [16:28:56] anybody tempted?? ^^ [16:29:30] * apergos goes to start a new small batch of generate/upload/add caption/add item/add depicts to beta commons and wikidata [16:29:42] after testing the cleaned up script one more time [21:11:07] hm, any MW API person here who knows what this means? [21:11:08] https://www.mediawiki.org/wiki/API:Data_formats#JSON_parameters [21:11:16] callback: The function in which the result will be wrapped. [21:11:23] is that refering to a php callback function name? [21:11:50] ottomata: no, its referring to JSONP mode [21:11:58] basically, don't use it, CORS is much better [21:12:22] but if specified, it wraps the entire thing in a json function, so that people can include it as a