[20:58:54] I've finished a deep dive on why certain statistics from BagOStuff weren't making it into Grafana. It was a long journey, using lots of different debugging, logging, staging and sysadmin tools to get the answer ultimately. Written up at https://phabricator.wikimedia.org/T338189. Hope it's of some use! Feel free to ask anything here or in PM :) [21:10:32] :o [21:59:43] Krinkle: fun writeup. one of the things in the middle drew my attention: why do we have $wgCommandLineMode when we also have MW_ENTRY_POINT==='cli'? would it be good to remove it? [21:59:58] (also, you have a couple of typos in https://gerrit.wikimedia.org/r/c/operations/puppet/+/957797 : "a-f90-9", "a end", "no matched") [22:01:23] (fixed typos) [22:01:45] https://codesearch.wmcloud.org/core/?q=%28MW_ENTRY_POINT.*cli%7CCommandLineMode.*%3D%29&files=&excludeFiles=&repos= [22:01:51] (on the CLI things, on the list of things that annoy me, almost-but-not-quite-redundant configuration options are near the top, and services that take dynamic things as parameters are very close by) [22:02:07] MatmaRex: That's a good point. aside from the horrible error printing hack that runJobs uses it for - that might be viable [22:02:22] I do note that when it comes down to "pure" CLI detection, we don't even need MW constants for that. [22:02:51] https://codesearch.wmcloud.org/core/?q=PHP_SAPI.*cli&files=&excludeFiles=&repos= [22:03:02] There's a built-in that covers this as well. [22:03:44] with wfIsCLI for MW contexts if you don't want to hardcode the two modes we tend to check for [22:05:07] yeahhhh, hmm. i wonder if there's some meaningful difference between that [22:05:12] I think some use actually declined as part of DI-purism so instead of wfIsCLI() we now inject CommandLineMode in four places, but it's not exactly configuration. [22:05:30] Yeah, it's worth an audit for sure. but we could gradually phase it out for cases where we're confident it's safe [22:05:37] Want to file a task for that? [22:05:50] in a few places, we do this: if ( PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg' ) { exit(); } define( 'MW_ENTRY_POINT', 'cli' ); [22:06:04] so that would be the same thing. but maybe not in all places [22:06:57] i can file a task. or two [22:32:36] MatmaRex: source maps are live on mediawiki.org (try it out!, just inspect anything on any page, e.g. use search suggestions in vector and click on the initiator of the ajax request to see the source). I've got a small patch that might help gain familiarity with how it works, whilst also fixing a small pet peeve. https://gerrit.wikimedia.org/r/c/mediawiki/core/+/957830/ [22:36:00] i'll check it out tomorrow [22:36:35] btw i found an already existing task about $wgCommandLineMode: https://phabricator.wikimedia.org/T313841 so i'm trying to figure out the context and update it [22:37:47] about source maps, i remember that a few years ago, when i was working on OOUI, they never worked properly for me on chrome (setting breakpoints would put them in the wrong places), and i ended up disabling them entirely. i wonder if they work better these days (and in firefox) [22:50:44] I tested Tim's patches and was able to set breakpoints in both Chrome and FF [22:53:55] I suspect whatever source maps you were using previously had bad mappings of runtime code to original code locations [23:00:34] I was also a bit ambivalent (always managed without source maps before, so meh?) but after playing around with it a bit I think it's a nice feature [23:20:05] It's easy to mess up. If the spec had just made it so that the source column number resets to zero when you go to a new source line, it would have been more robust [23:21:21] more compact too since lines do typically start from near the LHS not the last column of the previous line [23:22:34] it's possibly the worst spec I've ever seen -- a combination of weird technical details and poor writing