Summer is gone: wrapping up GSoC 2017

Summer is nothing without the tilt of the Earth. Thank you, planetary collisions in the early days of the Solar System.

Google Summer of Code 2017 has wrapped up. Again, my project was to implement support for Thanks in Pywikibot. I am happy to say that I achieved that goal. Now, Pywikibot bots can thank users for normal (wikitext) revisions and for Flow posts. Also merged was code to model Thanks log entries in Pywikibot. An old patch for adding Flow revisions to Pywikibot was almost finished, but it wasn’t a requirement for this project.

While there wasn’t any merged server-side code, I did post a patch that can serve as a basis for publicly logging changes to a user’s thankability status. I wish I could have done more work on the extension, but Pywikibot was the priority, and wisely so.

Also written as part of this project was a script to implement Faebot’s reporting of frequent thankers and thankees. That script available on a personal GitHub repository, along with some unit tests that pass on Travis CI.

I’ll admit this experience was more stressful than my other GSoC project in 2015. There were more community and social expectations than last time, which I eventually disregarded at the advice of my mentor. I also took two college courses over the summer, limiting the time I had to spend coding. Owing to my previous experience with Pywikibot, I had lofty expectations. While I failed to meet all of them, overall I got the job done.

I would like to thank my mentor, John Vandenberg, the Wikimedia Foundation and their organizers, Google, and the countless coders on whose work I built. Barring rule changes, I won’t be eligible for Summer of Code again, but I would love to continue contributing to Wikimedia and FOSS in general.

A midsummer night’s code

Blogs are not my thing. Coding is.

I know I’m way behind on this, so I’ll skip detailed details. I’m through the first midterm, which I passed. (Yay!) I thought it was on to phase 2, thanking Flow posts. But there’s been a digression. My new job is to write a replacement to Faebot’s thanker/thankee reports, using the phase 1 code (log entries, in particular). I’ll try to post more details on the implementation in my next post.

As for what I did in phase 1, Pywikibot can now thank users for normal revisions and work with the Thanks log entries. Here’s a video of a demo which thanks users for revisions on random testwiki pages.

The phase 1 code has already been merged, so try it now!

Finally, I would like to make people aware of a task to allow users to opt out of Thanks. As an attempt to get the ball rolling again, I’ll be posting a change soon related to this task. Stay tuned!

Slow days behind

Am I ahead, or am I behind? It depends on who you ask.

Over the past couple of weeks, I have been busy with summer courses, so my activity has been lower than some others’. I did finish fixing up the code submitted by last year’s intern, and that was merged this past Thursday. Since then, I have been writing tests for the new code, and that seems to be going well. I ran into a stumbling block Tuesday. I tried to add a test to check that the API returns an error when thanking someone while not logged in. However, Pywikibot wouldn’t allow that API call to even be made. I also discovered that passing a tuple with a first value of 19 didn’t cause an “invalid revision” error server-side, so I had to change the values to be below 2.

We do have an interesting design question to deal with. Thanks does not allow a user to thank their own edit, so the user who is logged in should be noted as unthankable. The dilemma is whether to just return False from that property or to raise an exception. I prefer the boolean, but the debate continues.

Once that’s done, we can merge the new normal revision code and move on to thanking Flow posts. This will probably use a more intuitive design, which will be based on my 2015 GSoC work on adding Flow objects to Pywikibot. I’ll start work on that over the next weekend.

Now, we code!

It is called Google Summer of Code for a reason, right?

My project is “Implement Thanks support in Pywikibot”. It’s just that, implementing Pywikibot support for the Thanks extension. This was the subject of a GSoC project last year, which unfortunately was not completed. There is code from that project still in Gerrit, which we have to sift through and pull out salvageable parts.

The base idea for the Pywikibot side of my project is adding methods to the Site class for the two Thanks API calls, thanks and flow-thanks, and adding methods to serve as the “external” API in classes representing MW objects. I’m pretty sure I’ll add a Post.thank() method, but my mentor and I will have to further discuss where the normal revision thanking method will go. My original plan was to put it in the Revision class, but that class doesn’t currently support such an interface because it’s basically a glorified¬†dict.

On the server-side front, my mentor and I decided to have me, as my first server-side task, write a proof-of-concept implementation of logging when a user enables and disables Thanks notifications, as a way to get that discussion moving.

We’re actually in the middle of a full review of the 2016 patches. I’ll write about those discussions next week.

Community bonding: more involved than before

This was so much easier in 2015.

I just found out I was supposed to post this on Thursday. But, really, what was there to post? I already know Pywikibot, Thanks is remarkably simple compared to Flow, and I was completely unaware that the community bonding requirements have changed so much in the past two years. I have no progress to report, but I work quickly when motivated.

I’ll post more later.

Here, I muse.

But what do I muse about? The fact that I ended the preceding sentence with a preposition? No, and that aspect of English grammar isn’t really a big deal to me.

This blog is about me as a programmer, a Wikipedia and Wikidata editor, and much on top of those, and my thoughts (musings, really) on stuff I deal with while I contribute to the world’s bytes.

I wonder how many bytes this post will take up. And, so, I muse.