[03:20:22] xSavitar: read this today and happens to connect with a patch we looked at a few weeks ago. https://morizbuesing.com/blog/greppability-code-metric/ [03:20:34] I read this today* [03:21:33] It also came up in the clean up work JustHannah and I are doing in RL. [03:23:51] found via https://ehret.me/news-from-last-month-202410-developer-edition [11:01:40] Krinkle: I totally agree with the greppability. idea. Long time ago I got hyped about writing a super concise code, you don't need a `registerWebComponent()`, `register()` is better because it's smaller and more concise. Then I ended up with a project that most of stuff were a single words, IDEs weren't that advanced, if you tried to grep for `register` or `update` -> hundreds of lines. [11:13:17] And for people that use variables to dynamically create a name for property/object and then use it - I think there is a special place in hell :D [11:58:06] we actually explicitly add comments for grepability in some places, e.g. https://codesearch.wmcloud.org/search/?q=Give+grep+a+chance+to+find+the+usages&files=&excludeFiles=&repos=Extension%3ACentralAuth [13:45:09] oh ^ that is really nice, thanks for sharing it [13:46:11] this is something that would be useful here - https://github.com/wikimedia/mediawiki-extensions-WikimediaEvents/blob/master/includes/AuthManagerStatsdHandler.php#L97 [13:47:20] as recently I struggled to find a place where we handle auth metrics like `authmanager.accountcreation.$entrypoint.success` [15:22:54] might be that the event type list is determined elsewhere and shouldn't be explicitly known in that method. needs some thought [15:38:33] pmiazga: apergos: Examples in docs about this practice, for interface message keys: https://www.mediawiki.org/wiki/Manual:Coding_conventions#System_messages [15:38:35] and css class names: https://www.mediawiki.org/wiki/Manual:Coding_conventions#Dynamic_identifiers [15:38:48] and file names, etc [15:41:25] MatmaRex: ok, landed. Thanks for keeping the change minimal and low risk. Let's try this and move on. [15:41:55] krin kle: nice but doesn't seem so helpful for pmia zga's example [15:42:29] Krinkle: thanks, I was wondering why I couldn’t find that advice on https://www.mediawiki.org/wiki/Manual:Messages_API earlier (looked in the wrong place) [15:44:04] oh, thanks [15:45:31] apergos: ah you mean pmiazga was looking to find the linked code (now found) based on seeing it plotted in grafana? Yeah, that was a mess in the old code. With the new code, we identify the metric clearly and separately as "authmanager_event_total" which should be greppable. The labels shouldn't matter since those will be added to the metric, the metric itself should only come from one place generally, and indeed that's the case here. [15:46:31] If you're in searching in the other directin (from insrumentation, to where it is used in grafana), we have a bit more flexibility/tolerance toward dynamic names since search-grafana-dashboards.js takes regexes. still messy though. https://gerrit.wikimedia.org/r/plugins/gitiles/operations/software/+/refs/heads/master/misc/search-grafana-dashboards.js [15:51:18] hm yeah one would have to be smart about using a regex in the first place I guess (for the search)