This is a cross post by Veaceslav Gaidarji , open source developer and contributor to the Jenkins and Bitrise projects.

Some time ago I encountered a LIFX smart bulbs. These are the bulbs with a chip inside - 50% bulb, 50% chip. There are mobile applications for easy configuration and remote control of the bulb. Nothing special here, it simply works and is very convenient to have such bulbs in dormitory.

First option is always easy and effortless, but second one is more challenging.

forget about building something new and just use the plugin

Before starting to work on such Jenkins plugin, I searched for similar projects on Google and the first links pointed me to existing LIFX notifier plugin and a blog post from Michael Neale who created the plugin. Michael’s post describes exactly what I had in mind.

The idea was: to connect a LIFX bulb to Jenkins server and update the color according to a job’s state.

And as it always happens, the developer inside me generated an idea which, as it always happens, was implemented by someone else already.

99% of ideas which come to our minds either were already implemented by someone else or they are useless.

Improving an existing plugin

The existing LIFX notifier plugin did its job really well and I was able to connect my bulb to Jenkins and test it. But it wasn’t complete and had no configurable at all, therefore no possibility to change the colors.

First, I read Jenkins contribution guidelines, which encourage developers to improve existing plugins (if any) and not create other versions of plugins with similar functionality. Then I contacted the plugin author, Michael Neale, via email and kindly asked for the contributor access in GitHub for the existing plugin version. After a short discussion about my plans on this plugin, Michael added me as a contributor to GitHub repo and wished me good luck. Thanks Michael!

I wanted to improve the LIFX notifier plugin to add the ability customize the colors ( in progress , build success and build failure ). This is not a hard task actually. A 1000+ plugins were developed for Jenkins by the hackers like me, which means that I should have no problem to do it as well. Fortunately for me, I have used some plugins already which had a UI similar to that I had planned to add to the LIFX notifier, such as:

Reviewing the code for these plugins, plus Jenkins plugin development documentation, and of course looking over Jelly components helped me to:

Better understand the Jenkins architecture.

Learn how Jenkins plugins work in general.

Learn how to create the UI components for a plugin.

Learn how to subscribe to Jenkins job state changes using appropriate extension points.

In a few weeks I’ve finished my plugin modifications and added unit tests for its major parts. As a result, the plugin now has a UI configuration section in Post-build Actions which is self descriptive:

The last step was to prepare new plugin version and publish it to the world! The Jenkins "Hosting plugins" document describes step by step process of how to publish a plugin.