[17:12:45] Krinkle: Ooh, neat [19:19:10] xSavitar: About phpunit and testing - I think this one might be a good one to get started. [19:19:11] https://doc.wikimedia.org/cover/mediawiki-core/includes/resourceloader/ResourceLoaderFilePath.php.html [19:19:23] It is a relatively simple class, that you could create a test for! [19:21:10] Krinkle: most of RL tests can't be moved to unit just because of ResourceLoaderContext dependency on Skin::getSkinNames(); [19:21:45] Amir1: will get covered by https://phabricator.wikimedia.org/T32956 [19:22:07] but not this quarter [19:22:30] mid/long-term direction is for it to just be a value class. So it won't know what does and doesn't exist. For RL to validate upon construction instead. [19:23:08] that makes lots of sense [19:23:52] My preferred abstraction level for unit tests is slightly higher than yours I think. that is to say, I'd prefer not to stub it out now, would rather have it run with the real code as much as possible. [19:24:15] but to aim for there to be less real code involved and use that to decrease its scope [19:24:29] Mine is also a little bit higher than you think: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/522618 [19:24:37] True [19:24:38] :) [19:25:14] I think running those global funcs is fine if we're confident they won't be used in "unit" tests. [19:25:26] the ones that depend on state I mean [19:25:33] (and enforced etc.) [19:25:33] Krinkle: two things: 1- Regarding reducing number of wikibase modules, did you run an automated check to see what can be done? I might do that, it'll be fun [19:26:36] 2- I'm planning to have a "campaign" to reduce size of Common.css in most wikis in Wikimania (there we can find lots of interface admins) [19:26:59] Using TemplateStyles. [19:28:30] 1- https://phabricator.wikimedia.org/T203696 => e.g. https://gerrit.wikimedia.org/r/518753 => https://gist.github.com/Krinkle/80ee217849493fe7547769b6f378b69b [19:28:46] Wikibase$ php ~/Documents/Temp/module-refcount.php view/resources/resources.php [19:28:48] for example [19:29:04] I run that and over view/lib once a week and weed out one or two modules that have (0) or (1) [19:29:09] and then check mwgrep and codesearch [19:29:33] its' horrible beware [19:30:23] how so? :D [19:30:38] I dropped three today ^_^ [19:31:07] my script is horrible [19:31:10] also relevant: [19:31:13] diffs weekly at https://gist.github.com/Krinkle/f76229f512fead79fb4868824b5bee07#gistcomment-2968220 [19:31:16] nah that's fine [19:31:17] and https://docs.google.com/document/d/1SESOADAH9phJTeLo4lqipAjYUMaLpGsQTAUqdgyZb4U/edit [19:32:24] niice [19:33:13] Amir1: I've also left dozens of FIXME and TODO in Wikibase RL registry for non-trivial cases [19:33:18] So cool [19:33:31] which might be easier for you to handle knowing the code. [19:33:31] Which part of wikibase? repo or lib? [19:33:41] Amir1: I've started at view/ and not gotten further [19:33:45] mainly looking at impact on client wikis [19:33:50] No one knows Wikibase code even the development team [19:33:58] it's all magic [19:33:59] which unfortunateley includes all of view/ despite being almost entirely repo-specific modules that are never loaded [19:34:32] Sure, the client is going to get worse because of wikidata bridge [19:34:34] It seems to me like view/ should die in favour stuff moving to lib/ repo/ or client/ depending on whether it is clinet, repo or shared between both. [19:35:28] There are some plans to refactor the whole thing [19:35:43] also we have this thing https://phabricator.wikimedia.org/T85499 [19:36:13] Like in case of a medium item, more than 20% of HTML is just one big deprecated blob [19:36:21] right, actually loading fewer things is also good. [19:36:26] in case of big items it's around 90% [19:37:43] note that ResourceTest from core helps validate these resources.php fixes in Wikibase [19:37:51] to e.g. ensure all deps exist and no cycles etc [19:37:58] (actually not sure it prevents cycles right now) [19:38:31] it also checks all file paths are correct, which given all the indirection in Wikibase with submodules etc is quite valueable [19:39:18] yeah, I actually was deprecating a module and it found an issue with a submodule [19:41:09] It need to do this weeks' WikibaseClient reduction still [19:41:12] before Tuesday cut [19:41:28] maybe you wanna give it a go? [19:41:58] Krinkle: I already did [19:42:11] three of them are already cut [19:42:24] one left https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/522613 [19:42:36] * Krinkle looks for a tardis behind you [19:42:42] hm.. [19:42:45] nice [19:42:54] :))) [19:43:20] This one can be tricky because I'm deprecating a wb config module that is used by a gadget which weirdly is undefined most of the time [19:43:36] I have a feeling the gadget has been broken for a really long time [19:43:48] Krinkle: That was what I was talking about https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/522612/1 [19:44:56] An other front https://en.wikipedia.org/wiki/MediaWiki_talk:Common.css#Cleaning_up_message_box_CSS [19:46:40] CR-ing https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Wikibase/+/522613/ [19:49:51] Thanks [19:52:27] Krinkle: I think Wikibase view should be only loaded on repos, not on clients [19:52:44] maybe there will be one or two modules that are shared, those can go to lib [19:52:54] works for me :) [19:53:40] let me fix that [19:54:17] That would be HUGE. [19:55:42] Krinkle: do you have some numbers so I can convince our EMs/PM? [19:57:31] There's last years numbers at https://phabricator.wikimedia.org/T203696 [19:57:44] I'll re-run them on Monday [19:58:48] but I imagine it's still a significant percentage of the whole startup pipeline on every page view, blocking the time before we can start downloading normal interaction modules. [19:59:42] lol [19:59:48] > mw.loader.getModuleNames().length [19:59:48] 1234 [19:59:50] for real? [19:59:52] enwiki [20:00:58] * Amir1 hopes to reduce them to 666 [20:03:53] Krinkle: it would be great if this goes in before Tuesday, https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/ContentTranslation/+/522994 [20:03:58] Let's not break CX [20:04:27] Amir1: the wikibase part of the startup data will be relatively high compared to merely modules/total count, due to them having lots of dependency relationships as well, which adds to the data. [20:05:03] I see [20:17:16] Krinkle: 1196 on Wikidata.org, 1207 on Commons, and 1090 on MediaWiki.org. [20:18:09] We should probably revisit the idea of putting warnings in the gadgets definition interface about the cost of each entry. [20:23:02] James_F: I think this should be communicated to devs too, I didn't know about this cost until a month ago [20:29:19] James_F: ten more unit tests: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContentTranslation/+/522995 [20:33:46] wow, none of view modules are used in client [20:45:18] Krinkle: seriously, none of view modules are needed in client, I double grep'ed their names in lib and client, nothing showed up. I thought my script is broken [20:54:04] Amir1: test on mwdebug1002/php7 [20:54:07] > mw.loader.getModuleNames().length [20:54:07] 1066 [20:54:08] enwiki [20:55:38] Krinkle: one thing I don't understand is that the task says there's 247 modules registered in client/view/lib but I could only find 26 for view, around five to ten for others, is it correct? [20:57:39] source? [20:57:49] afaik the count is for with/wothout WikibaseClient installed [20:57:59] https://phabricator.wikimedia.org/T203696 [20:58:26] Yeah, that's 248 on a wikipedia for installing wikibaseclient [20:58:53] including WikibaseView, implicitly [20:58:58] (and Lib) [20:59:19] It seems that as of today WikibaseView registers 168 (1234-1066) on enwiki [20:59:22] per today's check [20:59:38] I see [20:59:59] Krinkle: I guess we can move forward with this: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/523002 [21:00:01] :D [21:00:05] Tests pass [21:00:11] works fine in my localhost [21:00:24] check prod, mwdebug1002 [21:00:28] I've added # on that line [21:01:24] Sure [21:02:20] interesting, the jquery ui local lang-link editor isn't anymore? [21:02:21] https://en.wikipedia.org/wiki/South_Pole_Telescope Uses the most of client features [21:02:26] the sidebar now points to wikidata for me always [21:02:41] * Krinkle is not complaining [21:03:23] without the patch, it also points to wikidata [21:03:51] It points to dialogue when it's not connected to wikidata [21:03:56] AFAIK [21:04:16] interesting [21:04:34] e.g. https://en.wikipedia.org/wiki/Ivie_(given_name) [21:05:14] your South Pole article got me to something else intresting in three of four clicks [21:05:15] https://en.wikipedia.org/wiki/Timocracy [21:05:16] TIL [21:05:46] LOL [21:06:11] also, someone tried to add a third reference by typing "3. … " at the bottom which is a nice UX failure [21:07:00] so it seems the link item fails with the patch, let me check what needs to be moved [21:07:11] https://en.wikipedia.org/wiki/List_of_colonial_governors_in_1885 [21:07:20] An unknown error corrued [21:07:22] when opening it [21:07:23] yeah [21:07:34] (that one has no wikidata item so it trigger the ui dialog) [21:08:15] no explicit dependency failure though, must be something dynamic/magical [21:09:30] yeah, it's hard to debug :/ [21:16:50] wbRepo is not set I think that's the root [21:22:52] strange, it works fine in my localhost [21:32:44] Krinkle: Copied! Thanks! [21:34:22] Krinkle: so this is my debug so far, mw.loader.using(['jquery.wikibase.linkitem', 'mediawiki.Title','mw.config.values.wbRepo','wikibase.client.getMwApiForRepo']) fail (promise goes to fail) on production on https://en.wikipedia.org/wiki/List_of_colonial_governors_in_1885 (mwdebug1002). I double checked all of them and all are in mw.loader.getModuleNames() [21:36:59] Unknown module: jquery.event.special.eachchange [21:37:06] \o/ [21:38:14] there is two resources page, one in root, the rest is in lib/resources.php [21:44:08] yes [21:44:23] ah, you didn't cross-check that file? [21:44:34] no, I'm about to run a way bigger check [21:44:39] k [21:45:36] Amir1: mwdebug1002 is clean again now fiy [21:45:39] fyi [21:45:42] okay [21:45:43] thanks [21:47:21] interseting, a heading in the wikitext: [21:47:25] ==Structure== [21:47:31] Structure renders as

[21:47:34] but no edit section link [21:50:51] Krinkle: these are the one that need to be moved to lib {'wikibase.api.RepoApiError', 'jquery.ui.ooMenu', 'jquery.ui.suggester', 'jquery.event.special.eachchange', 'wikibase.api.RepoApi', 'wikibase.api.getLocationAgnosticMwApi', 'util.inherit', 'util.highlightSubstring'} [21:54:04] that'll be much easier than moving everything else to repo