vendredi 15 octobre 2021

A post I have send to Wikimedia Foundation internal communication system. I have lightly edited it for public publishing.

When I was around ten years old (the age of my oldest kid today) I have stepped upon the front page of a scientific magazine: "the highways of information". I was supposed to intend a class at the music school but time has flown as I was busy reading the lengthy article describing what will become the world wide web and the internet. It was roughly in 1988.

I have been lucky to have an internet connection as early as of 1995 and internet became my second home. Sometime in 1999, someone introduced me to the concept of wikis. The internet bubble had not busted yet, blogs were barely a thing and neither Wikipedia nor MySpace existed. The conversation went more or less like: 

Anonymous: "it is a revolution, a site that anyone can edit" 

 "A site that anyone can edit?" I repeated. 

And I quickly continued: "That is dumb, it will never stand the script kiddies defacing website for the lulz".

I just have turned 21 and I was definitely a fool but did not know about it at the time nor I could expect the so called web 2.0 that will be put the world in the digital era. 

A few years later I was browsing Usenet (more or less the equivalent of Quora/Wikipedia/Facebook/Twitter at that time). People used their post signature as a little advertisement place. Often for their personal website or for little projects they wanted to show case to the world. You expect it: that landed me on an article of the french Wikipedia. 

:wikipedia: 

One never knows where a link can lead you too. It could be the best, the worse or simply a life changing experience. Previous exposure to the term wiki kicked memory as it was showing in the Wikipedia domain name. It has struck my curiosity and I obviously had to hit the site. Page loaded and I promptly clicked `[edit]` in order to deface it and prove my point. Instead I felt I could contribute fr a change and improve the text following the path of Diderot and d'Alembert (french encyclopedists). It was in October 2002, a few days after I have turned 24 years old and the start of my wiki adventure.

For almost twenty years Wikipedia has been part of my life, if not my life. When I have joined the foundation (thank you Sam Reed, Chad Horohoe, Rob Lanphier and others), my family, friends and acquaintances had a relief: Antoine will finally stop talking about Wikipedia from the time I wake up to bed time. Little they knew it would make things even worse. On top of being a hobby .... It became my job. 

:facepalm: 

Wikipedia has been half of my life. It is the closest thing I can think of when it comes to my personal values, my view of the world or the kindness I try to push when I act. One might see it as bragging, but Wikipedia is definitely the most important thing that ever happened to me and the world. It is a guidance to me. I am sure it will be my companion for the rest of my life and I have great hope it will outpass me. Much like a good book can be passed from a generation to another one. 

The world had turmoils in the last couple years, but we have a cap that is above and beyond those: collect the sum of all knowledge. If you like Wikipedia, please take some minutes this week-end to do a few edits on our favorite website and feel free.I am turning 43 years old today (Oct 15th), and this week-end I will celebrate my ten years tenure at the foundation and an edit on Wikipedia will be a great gift to me.

WikiLove
:wikilove:

lundi 7 janvier 2019

Gerrit mail header X-Gerrit-MessageType

Values for the field X-Gerrit-MessageType based on my email inbox and Gerrit source code (gerrit-server/src/main/java/com/google/gerrit/server/mail/send/* classes):
  • abandon
  • addkey
  • comment
  • deleteReviewer
  • deleteVote
  • merged
  • newchange
  • newpatchset
  • registernewemail
  • restore
  • revert
  • setassignee

jeudi 30 novembre 2017

Watching an Xvfb frame buffer

Start Xvfb with a memory mapped file:

/usr/bin/Xvfb :94 -screen 0 1280x1024x24 -fbdir "$HOME"

Watch it:

xwud -in Xvfb_screen0

Profit.

vendredi 13 juin 2014

Editor war haiku

all code editors
albeit so much nicer
can act such as vi

mercredi 25 septembre 2013

displaying Gerrit review history in git log

Over the last few weeks, several people complained I should share my tip'n tricks with more people. They are apparently worth a post.  I am giving it a try there to show you how to make available in your git cli the Gerrit review informations. I will start with some context then spurt magical commands to let you make it happen on your own computer.

In the beginning of 2012, the Wikimedia Foundation switched from Subversion to Git. The main reason for the switch was to prevent committers from inserting bad code in the central repository. Thus lowering the stress when deploying said code on the production site.  The only way to do it is to elect a gatekeeper between patch authors and the reference repository used for deployment. In Linux, that is more or less the role of Linus Torvalds. At Wikimedia we selected Gerrit which is used at Google to accept patches for their Android platform.

The Gerrit workflow is pretty simple: authors send their patches to Gerrit, he and others comment or amend the patch, rinse and repeat until there is no more to say. After a few iterations, the community ends up with a robust patch which is worth entering the reference repository. A few people are allowed to approve the change and have it actually merged.

The history that led to the final commit is available (example for a patch I wrote: https://gerrit.wikimedia.org/r/75569) and is very valuable whenever a bug appear: the comments can give you an idea of the design choices and list out every single person that get involved in the patch. If the original author is not available, you can most probably reach out to the person that review the code. When you are facing an issue in production, the more people to ask the merrier.

It is too cumbersome to have to open the browser in the Gerrit web interface. Aging, I rely more and more on terminals and command lines. How would I get the commit history from the command line without having to parse some Gerrit json? Luckily, there is a way to get all the reviewing history saved locally and thus available offline.

Internally, Gerrit relies a lot upon git, its internal configuration for a given repository is even available (under refs/meta/config). The review history for a repository is thus stored in Git as well and it lives under refs/notes.

You can thus fetch all the review history:
git fetch -v origin refs/notes/*:refs/notes/*
Then configure your repository to always show the notes in git log:
git config --local notes.displayRef refs/notes/review
End result:

$ git log -n1 1dad0218
commit 1dad021840bf936b0e130ddda3459d11f0ad8421
Author: Antoine Musso 
Date:   Wed Jul 24 12:08:52 2013 +0200

    SpecialPrefixindex formatting methods are now protected
    
    namespacePrefixForm() and showPrefixChunk() accepted additional
    arguments to slightly alter the form such as hiding redirects.  The
    argument has been removed in favor of class property just like
    stripprefix introduced earlier and the method have been made protected
    since there is no point in calling them out of the special page scope.
    
    Change-Id: I55728fd2634f8a935a033052dcce3c7247cb1aa3

Notes (review):
    Verified+2: jenkins-bot
    Code-Review+2: Matmarex 
    Submitted-by: jenkins-bot
    Submitted-at: Fri, 30 Aug 2013 19:41:21 +0000
    Reviewed-on: https://gerrit.wikimedia.org/r/75569
    Project: mediawiki/core
    Branch: refs/heads/master


On this patchset, we can see that Matmarex has accepted the change :-) You can prevent notes from displaying whenever you like by passing --no-notes to the git log command. Note: you will have to fetch the notes from time to time since they are not fetched by default. An alias would be useful:
git config --global alias.fetchreviews \ 'fetch -v gerrit refs/notes/review:refs/notes/review'
You can then refresh notes by nvoking git fetchreviews.

Summary:

* Get notes: git fetch -v origin refs/notes/review:refs/notes/review
* Configure git to always show them: git config --local notes.displayRef refs/notes/review