devoxx 2011 - jenkins bof on plugin compatibility tester

18
Plugin compatibility tester & Scm sync configuration Frédéric CAMBLOR Developper @ 4sh.bordeaux.fr [email protected] @fcamblor http://fcamblor.wordpress.com

Upload: camblor-frederic

Post on 18-Jul-2015

563 views

Category:

Technology


0 download

TRANSCRIPT

Plugin compatibility tester

& Scm sync configurationFrédéric CAMBLOR

Developper @ 4sh.bordeaux.fr

[email protected]

@fcamblor

http://fcamblor.wordpress.com

Me

2

• Developper @ 4sh.bordeaux.fr

– Devop, Team support, Tech lead, App designer

• Jenkins plugins commiter– Not only plugins … we’ll see it in a few seconds…

• Curious about everything related to Java & Web• Ant/Maven & Jenkins CI

• JEE & Spring worlds

• TDD and unit testing in general

• HTML 5 and Javascript ecosystem2

Plugin compatibility tester“Detect backward uncompatibilities between

plugins and jenkins core versions “

I said I’m curious…

44

How many Jenkins plugin developers

in the audience ?

Who is using Ruby to develop his plugins ?

Jenkins plugins & Maven

5

• Most of plugins are based on Java & Maven– Except for all new Ruby-written Plugins…

• First thing to do after having initiated your SCM

– Configure your pom.xml

5

<project><parent>

<groupId>org.jvnet.hudson.plugins</groupId><artifactId>plugin</artifactId><!-- Which version of Jenkins is this plugin built against ? --><version>1.339</version><relativePath>../pom.xml</relativePath>

</parent>

<artifactId>global-build-stats</artifactId><version>1.1-SNAPSHOT</version><name>Jenkins global-build-stats plugin</name><packaging>hpi</packaging>

Continuous development

6

• Jenkins folks are releasing often

– 1 Release per week

– 1 Long Time Release per season (or maybe longer…)

• How to ensure Jenkins API changes are not

impacting your plugin ?

• How to ensure implementation changes doesn’t

affect your plugin implementation ?

6

Possible answers…

7

• Align your plugin on every Jenkins release

– You’ll have to release your plugin every week...

– No way !

• Align regularly your plugin over some Jenkins

releases

– For example, LTS

– Drawback : Jenkins users must upgrade their Jenkins

version to follow your requirements

• If you’re on Jenkins v1.409, you won’t see plugin having

Jenkins 1.410 as parent in your update center

7

Honestly

8

We are all lazy !

– Users (exceptions apart) won’t upgrade frequently

their Jenkins version

• Would imply a regression test harness on their builds

– Plugin commiters won’t release often on the long term8

PCT to the rescue !

9

• On each Jenkins release :

– Retrieve Update Center JSON file to have a list of

current plugins (with version)

• For each plugin :

– Download HPI and extract pom.xml from META-INF

– Checkout sources from pom’s <scm>

– Hack pom.xml and change parent to latest jenkins

– Launch compilation and tests from maven

– Gather results and publish it on Google App Engine

9

jenkins-pct.appspot.comDémo

What’s coming next

11

• Develop new features on GAE app

– Weekly digest subscriptions for plugin commiters

• I can active it automatically thanks to mail located in POM

– WDYT about it ? It can be intrusive…

• Remove XML form of plugin compat tester on

ci.jenkins-ci.org

– Would free memory and 15Go of disk usage

– Need to implement some caching features on GAE

11

What’s coming next

12

• Integrate new Ruby-coded plugins

– Don’t know if it is even possible

• Try to solve some problems on pom

– If you don’t set the <parent> tag

– Git tags are not present in <scm> tag

12

Scm Sync Config Plugin“Synchronize Jenkins configuration files with an SCM”

Overview

14

• Main Idea : Jenkins configuration should be part

of the project source code

– You commit your build descriptor (ant, maven etc..)

– Why wouldn’t you commit your jenkins config files ?

• Features

– Everytime a configuration screen is submitted, a

commit message is prompted to the user

– Can be considered as a backup / traceability tool !

14

Plugin is still young !

15

• Still in alpha (0.0.4)

– Only SVN http/https with simple authentication

– Only a few configuration files are supported

• Global config, per build config, views

– Only a 1-way synchronization (no restore)

• Some pending issues are hard to fix/reproduce

– Maven SCM API is not obvious !

• Help is welcome !

15

Roadmap

16

• Add Git as a supported SCM

– Should be fast thanks to SCM access abstraction

• Revision view allowing to display configuration

history & diff between them

– Hard since this feature is not in Maven SCM API

• Checkout latest configuration files from SCM

– Would allow to commit job config then import it

– Would allow to have a mirroring jenkins for QA

16

Scm Sync Config PluginDemo

License & Copyright

18

• Pictures & logos belong to their respective authors/owners

• Content under Creative Commons 2.0–Attribution — You must attribute the work in the manner

specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).

–Noncommercial — You may not use this work for commercial purposes.

–Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

• http://creativecommons.org/licenses/by-nc-sa/2.0/

18