Wikimedia Hackathon 2023 recap

, .

Two weeks ago, I participated in the Wikimedia Hackathon 2023. I had a wonderful time, and in this blog post I’m trying to capture some of the experience.

As is usual for me, the hackathon went fairly haphazardly: I had come with some vague ideas for topics I could potentially work on, which I didn’t end up touching in the slightest, and instead interacted with lots of people and did various larger and smaller things along the way. I like it this way, but it means you’ll just have to live with this blog post not having a lot of structure :)

One of my first achievements was to get a Gerrit change merged: I had uploaded Add Authorization to default $wgAllowedCorsHeaders the previous week, and found some people at the hackathon to review it: Reedy and Legoktm. The intention here was to make it possible to have purely client-side (in-browser) web apps that interact with Wikimedia wikis using OAuth 2.0 (e.g. making edits), which requires making CORS-enabled authenticated requests. Unfortunately, this still doesn’t work; in addition to the Gerrit change mentioned above, we probably need to tweak the way the API processes the origin parameter a little bit – I’ll keep looking into this issue. (You can find the example web app I’m trying to make work on GitHub already.)

This interaction also had an unexpected additional outcome. Both Reedy and Legoktm were reviewing the change in person, not from their own laptops, so Legoktm wanted to +2 it from my account – but my volunteer account didn’t have +2 rights yet. He suggested / asked that I make a request to get those rights, which I did, and +2 in mediawiki/ for Lucas Werkmeister [volunteer] quickly started to rack up support tokens. A week and a half later, Taavi made the change, so I can now merge MediaWiki changes as volunteer \o/

Another thing I did was play with the new Toolforge build service, or build packs beta (T337040). This is a promising new way to deploy Toolforge tools, in a way that doesn’t rely on the shared NFS file system, and with more flexibility for developers. (The main reason I’m interested in it is that it should let me finally move the Wikidata Shape Expressions Inference tool away from the Grid Engine, but that will require support for multiple languages in the same image first, which the build service doesn’t have yet.) I made a simple Python/Flask tool and then experimented with how to move it to the build service without losing the configuration file; I also filed some related bugs and updated the documentation along the way. The build service session later at the hackathon was also very interesting. (At that session, I realized that some of my earlier documentation edits might have been a bit misguided: I was working under the assumption that you’d still have the tool’s source code cloned in ~/www/python/src/, only realizing at the session on Sunday that a tool that’s fully migrated to build packs doesn’t really need this at all – the source code is cloned from version control at image build time, it doesn’t need to exist on NFS at runtime – so the config file should maybe be somewhere else, e.g. directly in the tool’s home directory.)

I also unexpectedly worked on two issues where Wikibase was broken: the mobile version of Wikidata was unintentionally loading desktop-only modules, and interlanguage links couldn’t be added from client wikis.

I contributed some very minor fixes to tools where I noticed tiny issues as they were mentioned in sessions: Toolhub had some HTTP links, and Versions was linking to its source code in the wrong place.

I held two presentations: Cool new things in MediaWiki code and Cool new things in PHP. In both cases, the idea is basically that, as a developer working on MediaWiki code, you might have missed some of the cool things that happened recently, so here’s a summary to catch you up. I designed the slides (MediaWiki, PHP) so that they’re useful on their own (with additional slides to summarize what I was saying on the day), so feel free to take a look :)

(Side note on the presentations: I had thought about doing a practice run before the first presentation, but decided against it. It turned out that it probably would’ve helped a lot – I talked way too fast and was done in half the time I had been given, which was quite unfortunate. I did a few practice runs for the second presentation and that one went much better.)

(Second side note: given that we recently raised the JS syntax requirement from ES5 to ES6, I’d really love to have a similar presentation or overview of all the new things we can now use in JS: I know a lot of the features, but I don’t know which can be used now (e.g. class syntax) and which still can’t be used (e.g. async/await). But as far as I know, nobody’s put anything like this together yet.)

Of course, a huge part of the hackathon is meeting and getting to know people (whether it’s people I’ve met before, people I’ve only interacted with online but never met in person, or people I didn’t know at all), but I don’t know how to put that into this blog post: if I started to list them, I’d worry about forgetting anyone. One thing I can mention, because it was closer to a planned session than just a random hallway meetup, is that I sat together with Novem Linguae and Gopa Vasanth to play with some Rubik’s cubes and juggling equipment. Otherwise, please know that if we talked at the hackathon, I was very happy to meet you!

Towards the end of the hackathon, because the topic of Kubernetes probes on Toolforge had been mentioned in a session, I started to work again on a project I’d tried to do a few years ago already: make webservice restart do a graceful restart. My previous patch for this had been rejected due to excessive complexity, and the underlying code had also changed in the meantime, so I tried to find a new approach to implement the same overall behavior. Happily, my new implementation let us remove a lot more code than was added, and was merged soon afterwards; once it’s deployed on Toolforge, I can finally go back from running kubectl rollout restart deployment lexeme-forms to just webservice restart.

I’ve also posted extensively on Mastodon about my travel surrounding the hackathon, if you’re interested in that. (You can click the little “eye” icon in the upper right corner to expand all the content warnings. Note that Mastodon is apparently not always loading the full thread, so you might have to click on the “last” post a few times to load more. The thread isn’t over until you reach the recap posts.) Otherwise, I think that’s it!