User:BPirkle (WMF)/Code Mobs 2023

From Meta, a Wikimedia project coordination wiki

At the beginning of fiscal year 2023, the API Platform team (which had previously had a very wide and sometimes unclear mandate) refocused specifically on APIs within MediaWiki. This meant that we needed a higher level of technical familiarity with MediaWiki core code and development practices than we had previously required.

We decided to address this, at least in part, by a series of recorded "Code Mob" meetings, where we would discuss relevant topics. Some sessions would be API-focused, but because general competency in MediaWiki development is needed, other sessions would be wide-ranging, covering other areas of core and even topics external to MediaWiki itself but important for MediaWiki developers to understand (for example, our caching infrastructure, or how our volunteer language translators work). Sessions were generally twice per week, but there are some gaps due to holidays, occurrences which we chose not to record, etc.

Here is a list of sessions, along with the main topics discussed in each. Most sessions also touch on other topics. If you think something discussed in a session is significant enough to mention on this list but I omitted it, please let me know!

  • 2023-07-11: setting up a local MediaWiki development environment using mwcli.
  • 2023-07-13: MediaWiki overview (what it is and isn't, how it compares to other frameworks, how it fits into WMF's infrastructure, and a brief look at the major code directories in MW).
  • 2023-07-18: dependency injection, global state, service wiring, using T320559 as a real-world example.
  • 2023-07-20: continue T320559, plus discussion on our code review culture, conventions surrounding risky changes, and when to use -2/-1/+1/+2. Also explored T329925, and when it is appropriate to introduce a new hook to MW.
  • 2023-07-25: continue T320559, testing, and a demo of the translation system.
  • 2023-07-27: continue T320559, CI, and testing entry points. Also discussion on our edge caching infrastructure.
  • 2023-08-01: REST API normalization issue (T339293/T340185), Action API vs REST API, lots of code walkthrough.
  • 2023-08-03: continue REST API (T339293/T340185), Action API code walkthrough, factory classes, codesearch, Action API task open task discussion.
  • 2023-08-08: Timo on Security (character encoding, subtle PHP type issues with array keys, and some tricky phan/OOUI interactions).
  • 2023-08-22: Deep dive on T236517. Discussion of serialization, API responses, and data modeling considerations as applied to partial blocks and restrictions. Finished with a 10 minute discussion on debugging in production).
  • 2023-08-24: Conceptual overview of wikifarms and MediaWiki config.
  • 2023-08-29: Practical example of creating a wikifarm in mwcli. Quick look at the page/revision/slots/content database tables. Discussion of MultiHttpClient, RESTBagOStuff, and Kask.
  • 2023-08-31: Deep dive on T344926. MediaWiki architecture layers, http clients, key/value stores, PSR standards, and even a bit on how Depends-On works in gerrit.
  • 2023-09-05: Deep dive on T318272. Object cache configuration, particularly with regard to database connections in SqlBagOStuff. Debugging tips and techniques.
  • 2023-09-12: Wrap-up on T344926 code review. Naming conventions, especially as they apply to PHP interfaces. Abstract classes vs interfaces, and considerations related to deprecation.
  • 2023-09-14: Discussion on proposed ObjectCacheFactory change. Description of Service Wiring, BagOStuff configuration and instantiation, and speculation possible BagOStuff compliance to PSR-16 standard.
  • 2023-09-19: T345190 (Resource Loader alerts) presentation. XDebug step through of MediaWiki bootstrap starting with various entry points (index.php, load.php, api.php, rest.php).
  • 2023-09-26: T265204 (MediaLinksHandler testability changes) and T336693 (make Reading Lists not depend on RESTBase).
  • 2023-09-28: T196059 (Return autoconfirmed information for site via API). XTools, Quarry/replica DBs, user rights, autoconfirmation system
  • 2023-10-03: Timo on Grafana dashboards (logging in, MySQL, legends, units, finding the source of a Prometheus metric, upgrading panels, variables, repeating panels, SessionStore, Multi-DC, split up an existing panel, AuthManager, exploring a new metric from MediaWiki, creating a new panel to plot a metric, validating the metric, use search-grafana-dashboards.js from operations/software.git:/misc/, Graphite#Extended properties, CentralAuth, unit of PHP microtime, correlating related metrics, Kask-SessionStore latency was misrepresented based on what we found in the new MW metric).
  • 2023-10-10: REST API discoverability, including HATEOAS concepts.
  • 2023-10-12: Action API Sandbox, including usage, a proposed change to POST vs GET behavior, and multi-dc debugging of notifications for T223413.
  • 2023-10-17: Changes to Reading List APIs, implementation plan, how to approach related tasks T348489 and T348490
  • 2023-10-19: extension development discussion by Cindy Cicalese, using Display Title as an example, but also touching on Reading Lists and Growth Experiments.
  • 2023-10-24: Deep dive on revision history page performance. General tips on how to do performance analysis and how our profiling system works, Wikimedia Debug browser extension, performance.wikimedia.org flame graphs, MediaWiki gender cache and its effects on internalization.
  • 2023-11-01: sitewide customizations, common.css and common.js, live cleanup of production wikis.
  • 2023-11-14: using mariadb with the built-in docker-compose-based local MediaWiki instance via docker-compose-override.yml. Includes adding phpmyadmin and mailhog. Great for folks that want a quick, easy local dev but also want to use something other than sqlite as their database, or for anyone that wants an example of how to add additional tooling to their local dev via docker.
  • 2023-11-21: MediaWiki REST API infrastructure and csrf_token handling. Discussion of possible improvements. Coding, review, and merge of one improvement during the meeting. Implementation alternatives for the non-standard token handling required by the Reading Lists REST API contract as part of moving it from RESTBase to MediaWiki REST. Some ChangeProp discussion.
  • 2023-12-07: MediaWiki initialization sequence, part 1: From index.php to the middle of Setup.php, where extensions get loaded and the service container becomes available. There is also a diagram for orientation. Contains some discussion of adjacent topics, such as migrating configuration away from global variables.

In case I do not keep this list updated, here is a Google Drive folder with all sessions (including transcripts).

Here are some notes I wrote when trying to plan all this (some of which we followed, some of which we went different ways with).

Here are links to various resources that might be helpful:

Timo’s diagrams from wikitech:Wikimedia infrastructure#Current infographics:

Various things Daniel has written (or been heavily involved with):

Cindy’s “What is MediaWiki” doc: