A short Scribunto sprint

I recently did a short sprint on Scribunto, the MediaWiki extension that powers templates written in Lua. It's a very stable extension that doesn't see very many changes but given how useful it is to making most wikis work, I thought it could use some love.

Patches written:

Revived patches:

Reviewed patches:

Bug triage and review:

This was definitely fun and has given me some ideas of other improvements that can be made. But I'm most likely going to switch focus to something else that needs some love.


Introducing mwseaql, a crate for MediaWiki SQL query building

I've published a new crate, mwseaql, which provides typed definitions of MediaWiki's SQL tables for use with the sea_query query builder.

It's a pretty simple implementation, there's a small Python script that parses MediaWiki's JSON schema file and outputs Rust structs.

Here's an example of it in use from my new rfa-voting-history tool:

use mwseaql::{Actor, Page, Revision};
use sea_query::{Expr, MysqlQueryBuilder, Order, Query};

let query = Query::select()
    .distinct()
    .column(Page::Title)
    .from(Revision::Table)
    .inner_join(
        Page::Table,
        Expr::tbl(Revision::Table, Revision::Page)
            .equals(Page::Table, Page::Id),
    )
    .inner_join(
        Actor::Table,
        Expr::tbl(Revision::Table, Revision::Actor)
            .equals(Actor::Table, Actor::Id),
    )
    .and_where(Expr::col(Page::Namespace).eq(4))
    .and_where(Expr::col(Page::Title).like("Requests_for_adminship/%"))
    .and_where(Expr::col(Actor::Name).eq(name))
    .order_by(Revision::Timestamp, Order::Desc)
    .to_string(MysqlQueryBuilder);

In MySQL this translates to:

SELECT
    DISTINCT `page_title`
FROM
    `revision`
    INNER JOIN `page` ON `revision`.`rev_page` = `page`.`page_id`
    INNER JOIN `actor` ON `revision`.`rev_actor` = `actor`.`actor_id`
WHERE
    `page_namespace` = 4
    AND `page_title` LIKE 'Requests_for_adminship/%'
    AND `actor_name` = 'Legoktm'
ORDER BY
       `rev_timestamp` DESC

It's really nice having type definitions for all the tables and columns. My initial impression was that the function calls were harder to read than plain SQL, but it's very quickly growing on me.

I'm also interested in what it means to have SQL queries in a more easily parsable format. Recently there was a schema change to the templatelinks table that basically required everyone (see Magnus's toot) to adjust their queries (example). What if we could have a macro/function that wraps each query and applies these types of migrations at compile/run time? Some let query = fix_my_query(query) type function that automatically adds the correct join and updates columns based on whatever schema changes were made in MediaWiki (as much as is technically possible to automate).

Lots of possibilities to consider! And mwseaql is just one of the components that make up the bigger mwbot-rs project.

If this works interests you, we're always looking for more contributors, please reach out, either on-wiki or in the #wikimedia-rust:libera.chat room (Matrix or IRC).



Board Election results, next steps

Unfortunately, I didn't make it onto the Wikimedia Foundation board, you can see the full results. In the first round I was behind by ~280 votes, which is pretty close considering nearly 6,000 votes were cast!

I already said it, but I'm really thankful to everyone who supported me, whether you campaigned for me or just cast a vote. If there's anything I can do to help you out, you know how to find me :-)

What's next? First, it's time for me to get back to work, I only have a 4-month backlog of bugs and patches to get through. And then continuing to agitate for change to make the WMF and Wikimedia a better place.

P.S. I'm also planning to be much more involved with the awesome people in Wikimedia New York City in the coming year.



Debian firmware GR vote

Originally posted on mastodon.technology.

My #Debian firmware GR vote is 6437215.

In order of preference:

  1. Amend the Social Contract to allow for non-free firmware in installers.
  2. Have a installer w/ non-free firmware next to the fully free one.
  3. None of the above
  4. Have only a non-free installer OR status quo, the installer w/ non-free firmware is not part of Debian.