A walk on the dark side
There has been an Awakening…
Introduction
This summer our tech lead told us that we were allowed to spend a percentage of our time at work doing or researching about something we weren’t used to (a kind of Google’s “20% time policy”… but in the good way). There was only one condition: we would have to give a tech talk to the rest of the team on the chosen topic.
Teaching is the best way to learn.
Motivation
Because I often make fun of the programming languages that my teammates use in their daily work (100% trolling just for fun I swear; I do not want to start any kind of nonsense programming language war) I thought it would be great to pay them back using a language I haven’t touched for ages: PHP.
Idea
I’m a real fan of automation (even when we spend more time coding the thing than the time it actually saves us afterwards), so based on a function we all use at work almost every day known as “automatic issue closing via commit messages” (I guess all web-based Git repository managers have a fancy name for that) I started to code a Bitbucket Webhook¹.
Webho… what?
A WebHook is a HTTP
callback: a web application implementing a webhook will POST
a message (payload) to an user-defined URL
(web service) when something happens. It’s that simple.
So, in my case, what I coded was a Githook but on the other side (basically it connects Bitbucket+Trello).
I don’t think it’s worth giving further details about my project itself but I can summarize everything in these points:
- Someone on the team pushes to a repo
- Bitbucket sends a payload to our webservice
- It parses that information and then: do whatever we can imagine.
Conclusions
It was very fun to get out of my comfort zone (I can’t tell how many years I’ve been coding exclusively for Android platform) and I can confirm that I’ve taken advantage of the great opportunity we have at work (I wish everyone had it): I have learned a lot (and now I am able to troll them even more 🤷).
PS: we’re hiring!
Disclaimer
There are neither slides (I splitted my tech talk into: a code review where my teammates got their revenge pointing up all my mistakes 😃 & a live demo) nor public repository (I don’t dare to make it public because I know it’s not as good as I’d like) but someone from my team (who’s a real Jedi in PHP) thought the idea could be improved (which I think is an amazing proposition because we can still learn about it) so maybe in the future we’ll release something based on this.
[1] Even though it could be a simple script I demanded of myself to meet some requirements: neither use frameworks nor libraries of any kind, follow good practices, patterns and SOLID, and add some tests (PHPUnit is love, my friends).