<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">

<channel>
	<title>Kohsuke Kawaguchi</title>
	
	<link>http://kohsuke.org</link>
	<description>Personal website of Kohsuke Kawaguchi</description>
	<lastBuildDate>Fri, 27 Jan 2012 22:37:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<copyright>Copyright © Kohsuke Kawaguchi 2010 </copyright>
	<managingEditor>kk@kohsuke.org (Kohsuke Kawaguchi)</managingEditor>
	<webMaster>kk@kohsuke.org (Kohsuke Kawaguchi)</webMaster>
	<image>
		<url>http://kohsuke.org/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>Kohsuke Kawaguchi</title>
		<link>http://kohsuke.org</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle />
	<itunes:summary>Personal website of Kohsuke Kawaguchi</itunes:summary>
	<itunes:keywords />
	<itunes:category text="Society &amp; Culture" />
	<itunes:author>Kohsuke Kawaguchi</itunes:author>
	<itunes:owner>
		<itunes:name>Kohsuke Kawaguchi</itunes:name>
		<itunes:email>kk@kohsuke.org</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://kohsuke.org/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/kohsuke" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="kohsuke" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">kohsuke</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>@Override and interface</title>
		<link>http://kohsuke.org/2012/01/27/override-and-interface/</link>
		<comments>http://kohsuke.org/2012/01/27/override-and-interface/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 22:37:09 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[override]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=111</guid>
		<description><![CDATA[TweetJim Leary, my colleague at CloudBees, got me into digging into this.
The question is around putting the @Override annoation on a method that implements an interface method, like this:

public class Foo implements Runnable {
    @Override
    public void run() {}
}


As you can see in the javadoc, when @Override was originally [...]]]></description>
			<content:encoded><![CDATA[<div class="tw_button" style=";float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F01%2F27%2Foverride-and-interface%2F&amp;text=%40Override%20and%20interface&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F01%2F27%2Foverride-and-interface%2F" class="twitter-share-button" id="tweetbutton111" style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Jim Leary, my colleague at CloudBees, got me into digging into this.</p>
<p>The question is around putting the @Override annoation on a method that implements an interface method, like this:</p>
<pre>
public class Foo implements Runnable {
    @Override
    public void run() {}
}
</pre>
<p>
As you can see in <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Override.html">the javadoc</a>, when @Override was originally introduced, such use was not allowed. javac 1.5 rejects this, too (I verified this in 1.5.0_22.)</p>
<p>
Sun intended to change this in 1.6. Javac 1.6 indeed changed the behaviour to allow it (verified this in 1.6.0_26), but <a href="http://blogs.oracle.com/ahe/entry/override_snafu">someone forgot to update the documentation</a>, as <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Override.html">you can see in the Java 6 API reference</a>.</p>
<p>
The interesting thing is, if you use Javac 1.6 with &#8220;-source 1.5&#8243; and/or &#8220;-target 1.5&#8243;. In all the possible 3 combinations, the above code compiles. Is this a bug, or is this correct? The interesting thing is that the semantics of @Override is defined in the library, not in <a href="http://java.sun.com/docs/books/jls/">the Java language spec</a>. So an argument can be made that this is as it should be &#8212; JLS, which governs the -source/-target switches, have nothing to do with this annotation. It&#8217;s akin to your code relying on newly introduced types in Java 6. If you compile them with Javac 1.6 with -source 1.5, it won&#8217;t raise an error.</p>
<p>
But IDEs do seem to tie this with the language level. Jim said Eclipse, when set to language level 1.5, it will flag the above code as an error. I verified that IntelliJ does the same (but only in the editor, as the actual compilation happens via javac so the build will succeed.)</p>
<p>
So the end result is ugly. If you open the project in your IDE, you see all these errors, but your build (nor test nor any actual execution, for that matter) will not catch this problem. Even if this was a bug in javac, I don&#8217;t see it getting &#8220;fixed&#8221; &#8212; the last thing you want is your security update relese to Java6 break all your builds.</p>
<p>
I guess the right thing to do for projects (like Jenkins) is to try to avoid putting @Override on interfaces and as we discover them, remove them. So that people who open the source tree in IDE won&#8217;t see those false positive errors. This is a bummer because it&#8217;s actually useful to have @Override on interfaces (that&#8217;s why the behaviour was changed in 1.6 in the first place!) Does anyone know of a FindBugs rule or some refactoring tool to check this? Or should these be filed as bugs against IDEs? For enforcing something that&#8217;s not in JLS?</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/01/27/override-and-interface/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Writing programs that drive Jenkins</title>
		<link>http://kohsuke.org/2012/01/27/writing-programs-that-drive-jenkins/</link>
		<comments>http://kohsuke.org/2012/01/27/writing-programs-that-drive-jenkins/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 16:00:56 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[remoting]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=110</guid>
		<description><![CDATA[Tweet
One of the interesting discussions during SCALE 10x was about using Jenkins as a piece of a bigger software. This person was interested in using Jenkins to run some business analysis operations, and wanted to have a separate interface for business oriented people. This is actually an emerging but common theme I hear from many [...]]]></description>
			<content:encoded><![CDATA[<div class="tw_button" style=";float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2012%2F01%2F27%2Fwriting-programs-that-drive-jenkins%2F&amp;text=Writing%20programs%20that%20drive%20Jenkins&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2012%2F01%2F27%2Fwriting-programs-that-drive-jenkins%2F" class="twitter-share-button" id="tweetbutton110" style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>
One of the interesting discussions during <a href="http://jenkins-ci.org/event/jenkins-scale-10x-los-angeles">SCALE 10x</a> was about using Jenkins as a piece of a bigger software. This person was interested in using Jenkins to run some business analysis operations, and wanted to have a separate interface for business oriented people. This is actually an emerging but common theme I hear from many users. Another company in San Jose actually built the workflow engine that uses Jenkins as a piece in a bigger application (aside from the actual build and test, this workflow involves reviews, approvals, etc.), and <a href="http://kohsuke.org/2011/12/20/github-releases-janky/">GitHub Janky</a> can be classified as one such app, too.</p>
<p>
This is something I always believed in &mdash; that every piece of software needs to be usable but a layer above. Or put another way, every software should be usable as a library.</p>
<p>
So in this post I&#8217;m going to discuss various ways you can programmatically drive Jenkins.</p>
<p>
Let&#8217;s start with <a href="https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API">the REST API of Jenkins</a>. For most of the data Jenkins renders as HTML, you can access its XML version and JSON version (as well as a few other formats, like Python literal fragment.) You do this by adding <tt>/api</tt> to the page (see <a href="http://ci.jenkins-ci.org/api">http://ci.jenkins-ci.org/api</a> for example.) Those pages discusss other REST API where applicable. For example, you can POST to certain URL and it&#8217;ll create/update job definitions, etc.</p>
<p>
If you are going to use REST API, you might find <a href="https://wiki.jenkins-ci.org/display/JENKINS/Auto-discovering+Jenkins+on+the+network">the auto-discovery for Jenkins</a> useful. You can discover Jenkins on the local subnet via UDP broadcast, or DNS multi-cast. There&#8217;s also a distinctive HTTP header &#8220;Jenkins-Version&#8221; on the top page of Jenkins that allows your application to verify that it&#8217;s talking to a real Jenkins server, as well as <a href="https://wiki.jenkins-ci.org/display/JENKINS/Instance+Identity">an instance ID</a> that allows you to identify Jenkins instanecs. These featuers allow you to build smarter applications.</p>
<p>
For Jenkins protected by some authentication mechanism, you can use the user name + API key in the HTTP basic auth (and I want to add OAuth support here.)</p>
<p>
REST API is great that it&#8217;s programming language agnostic. It is also convenient that neither the server nor the client has to trust each other. But those APIs are bound by the request/response oriented nature of the HTTP protocol.</p>
<p>
Another great integration point for Jenkins is <a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI">the CLI</a>. This uses <a href="https://github.com/jenkinsci/remoting/">the same underlying technology that drives master/slave architecture</a>, which enables your command line clients to be a lot more intelligent. For example, REST API exposes an URL that you can post to get a build started. But the equivalent command in CLI can have you block until the build is complete (and exit code indicates the status), or run the polling first and proceed to build only when the polling detects a change, or allow you perform a parameterized build with multiple file uploads very easily. For protected Jenkins, CLI supports <a href="http://blog.cloudbees.com/2011/06/public-key-authentication-in-jenkins.html">SSH public key authentication</a> to securely authenticate the client.</p>
<p>
A slightly different version of the CLI is <a href="http://kohsuke.org/2011/12/27/jenkins-now-acts-as-an-ssh-daemon/">&#8220;Jenkins as SSH server&#8221;</a>. Jenkins speaks the server side of the SSH protocol, and allow regular SSH clients to execute a subset of CLI commands. In this way, you don&#8217;t need any Java runtime installed on the client side to drive Jenkins.</p>
<p>
These two integration APIs are often much easier to script than REST API.</p>
<p>
Those APIs are available for non-privileged users, and they are great for small scale integrations. But for more sophisticated integration needs, we have additional APIs.</p>
<p>
One is the REST API access to <a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console">the Groovy console</a>, which allows administrator users to run arbitrary Groovy script inside the Jenkins master JVM (and you can submit this script as POST payload, and get the response back as the HTTP response.) This allows you to tap into all the Jenkins object models. Unlike the REST API, in this way you can ship the computation, so in one round-trip you can do a lot. You can do the same with CLI, which also lets you access stdin/stdout of the CLI.</p>
<p>
The other sophisticated integration API I wanted to talk about is the remoting API that does Java RPC (not to be confused with the remote API, which is the synonym for the REST API.) The remoting API is the underlying protocol that we use for master/slave communications, and it revolves around the notion of shipping a closure (and code associated with it) from one JVM to another, execute it, and get the result back. If your application runs elsewhere, you can establish the remoting API channel with Jenkins master, then prepare a <tt>Callable</tt> object. You can then have Jenkins master execute this closure, and the result is sent back to your JVM.</p>
<p>
There&#8217;s <a href="https://github.com/jenkinsci/cli-channel-demo">an example of this available</a>. You bootstrap this in the same way the CLI client talks to the master, then you &#8220;upgrade&#8221; the communication channel by activating the remote code download support (which requires the administrator privilege, for obvious reasons.)</p>
<p>
The great thing about this is that your data structure is rich Java object model all the way, and you never have to translate your data to externalizable serialization data format like XML or JSON. This greatly simplifies your program.</p>
<p>
I think this list covers all the major integration APIs that Jenkins offers. If you are building any interesting applications that uses Jenkins as a building block, please share your experience so that we can make it better!</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2012/01/27/writing-programs-that-drive-jenkins/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Jenkins ChromeDriver plugin</title>
		<link>http://kohsuke.org/2011/12/28/jenkins-chromedriver-plugin/</link>
		<comments>http://kohsuke.org/2011/12/28/jenkins-chromedriver-plugin/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 04:36:50 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[potd]]></category>
		<category><![CDATA[chromedriver]]></category>
		<category><![CDATA[selenium]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=109</guid>
		<description><![CDATA[Tweet
I released Jenkins ChromeDriver plugin that auto-installs chromedriver on all slaves. Here is why this is useful.

ChromeDriver is needed to run WebDriver-based tests with Chrome. Unfortunately this is a native program, so in a heterogenous Jenkins, you need to make sure you have the right binary available on each of the slaves. While that&#8217;s not [...]]]></description>
			<content:encoded><![CDATA[<div class="tw_button" style=";float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F28%2Fjenkins-chromedriver-plugin%2F&amp;text=Jenkins%20ChromeDriver%20plugin&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F28%2Fjenkins-chromedriver-plugin%2F" class="twitter-share-button" id="tweetbutton109" style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>
I released <a href="https://wiki.jenkins-ci.org/display/JENKINS/ChromeDriver+plugin">Jenkins ChromeDriver plugin</a> that auto-installs chromedriver on all slaves. Here is why this is useful.</p>
<p>
ChromeDriver is needed to run WebDriver-based tests with Chrome. Unfortunately this is a native program, so in a heterogenous Jenkins, you need to make sure you have the right binary available on each of the slaves. While that&#8217;s not hard, it&#8217;s awfully tedious. This plugin fixes that by automating it.</p>
<p>
This plugin would be a nice companion to the recently upgraded <a href="https://wiki.jenkins-ci.org/display/JENKINS/Selenium+Plugin">Selenium Grid plugin</a> that automatically runs Selenium Grid on top of your Jenkins slaves. When you combined, you just install two plugins to the Jenkins master, and without touching slaves at all, you got the whole cluster instantly ready for Selenium2 WebDriver testing. How is that?</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2011/12/28/jenkins-chromedriver-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>DNS outage with jenkins-ci.org</title>
		<link>http://kohsuke.org/2011/12/28/dns-outage-with-jenkins-ci-org/</link>
		<comments>http://kohsuke.org/2011/12/28/dns-outage-with-jenkins-ci-org/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 15:26:13 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=108</guid>
		<description><![CDATA[TweetAs Tyler summarized it in this e-mail thread, currently there&#8217;s an DNS outage going on with jenkins-ci.org that makes all name resolutions fail.
The current ETA is right around the new year, but in the mean time, you can add our temporary DNS server into your /etc/resolv.conf via &#8220;nameserver 140.211.15.121&#8243;.
Once again our apologies for this outage.
]]></description>
			<content:encoded><![CDATA[<div class="tw_button" style=";float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F28%2Fdns-outage-with-jenkins-ci-org%2F&amp;text=DNS%20outage%20with%20jenkins-ci.org&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F28%2Fdns-outage-with-jenkins-ci-org%2F" class="twitter-share-button" id="tweetbutton108" style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>As Tyler summarized it in <a href="https://groups.google.com/forum/#!topic/jenkinsci-users/sQFdbv1TND8">this e-mail thread</a>, currently there&#8217;s an DNS outage going on with <tt>jenkins-ci.org</tt> that makes all name resolutions fail.</p>
<p>The current ETA is right around the new year, but in the mean time, you can add our temporary DNS server into your <tt>/etc/resolv.conf</tt> via &#8220;nameserver 140.211.15.121&#8243;.</p>
<p>Once again our apologies for this outage.</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2011/12/28/dns-outage-with-jenkins-ci-org/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Jenkins now acts as an SSH daemon</title>
		<link>http://kohsuke.org/2011/12/27/jenkins-now-acts-as-an-ssh-daemon/</link>
		<comments>http://kohsuke.org/2011/12/27/jenkins-now-acts-as-an-ssh-daemon/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 19:00:28 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=107</guid>
		<description><![CDATA[Tweet
Starting in the upcoming Jenkins 1.446, Jenkins speaks the server-side of the SSH protocol. I think this is exciting, and here is why.
For quite some time now, there is Jenkins CLI, which lets you access Jenkins from command line by using a custom client jar file. There are several dozen commands available (that you can [...]]]></description>
			<content:encoded><![CDATA[<div class="tw_button" style=";float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F27%2Fjenkins-now-acts-as-an-ssh-daemon%2F&amp;text=Jenkins%20now%20acts%20as%20an%20SSH%20daemon&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F27%2Fjenkins-now-acts-as-an-ssh-daemon%2F" class="twitter-share-button" id="tweetbutton107" style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><div style="float:right;margin:1em"><a href="http://www.flickr.com/photos/amagill/51806161/"><img src="http://farm1.staticflickr.com/26/51806161_cd3aba65a9_m.jpg"></a></div>
<p>Starting in the upcoming Jenkins 1.446, Jenkins speaks the server-side of the SSH protocol. I think this is exciting, and here is why.</p>
<p>For quite some time now, there is <a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI">Jenkins CLI</a>, which lets you access Jenkins from command line by using a custom client jar file. There are several dozen commands available (that you can check by visiting <tt>http://server/jenkins/cli</tt>), ranging from creating a job to shutting down Jenkins. These CLIs are often a lot more scriptable than HTTP interfaces, and so it is often used by other programs to interact with Jenkins.</p>
<p>Jenkins 1.446 exposes a large subset of these commands through SSH, making it even easier to access this functionality. You no longer need any special client jar nor Java VM to talk to Jenkins. All you need is a stock ssh client. <a href="http://blog.cloudbees.com/2011/06/public-key-authentication-in-jenkins.html">As I explained earlier</a>, Jenkins lets you register your SSH public keys, and that is how you authenticate.</p>
<p>As always, the server side of this is extensible. Plugins can define additional commands to be exposed via SSH, which is a great building block for more sophisticated integrations. This is particularly so because SSH is a standard transport protocol for many tools, such as Git, Subversion, and so on. I&#8217;m planning to write a few plugins that take advantage of this in the coming days.</p>
<p><a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+SSH">Wiki article</a> talks more about the details, including how you can discover the endpoint, how you can verify the server key, and so on.</p>
<p>(And no, this is not about making Jenkins a general-purpose SSH server that you can use to login to the server.)</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2011/12/27/jenkins-now-acts-as-an-ssh-daemon/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Upcoming San Francisco training</title>
		<link>http://kohsuke.org/2011/12/21/upcoming-san-francisco-training/</link>
		<comments>http://kohsuke.org/2011/12/21/upcoming-san-francisco-training/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 19:33:04 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[cloudbees]]></category>
		<category><![CDATA[san francisco]]></category>
		<category><![CDATA[training]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=104</guid>
		<description><![CDATA[Tweet


CloudBees will be hosting another training in San Francisco Bay Area in January 26, 2012, and Feburary 23rd in Tokyo.
This 1-day training starts with the basics and then covers some of the advanced techniques, especially in combination with some plugins. As we deliver this training more, we gradually adjusted the material to cover more advanced [...]]]></description>
			<content:encoded><![CDATA[<div class="tw_button" style=";float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F21%2Fupcoming-san-francisco-training%2F&amp;text=Upcoming%20San%20Francisco%20training&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F21%2Fupcoming-san-francisco-training%2F" class="twitter-share-button" id="tweetbutton104" style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><div style="float:left; margin:1em"><a href="http://en.wikipedia.org/wiki/Portal:San_Francisco_Bay_Area"><br />
<img width=240 height=160 src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Golden_Gate_Bridge%2C_September_2004_-_by_Beverly_Bray.jpg/320px-Golden_Gate_Bridge%2C_September_2004_-_by_Beverly_Bray.jpg"><br />
</a></div>
<p>CloudBees will be hosting <a href="http://www.cloudbees.com/training.cb">another training in San Francisco Bay Area in January 26, 2012</a>, and Feburary 23rd in Tokyo.</p>
<p>This 1-day training starts with the basics and then covers some of the advanced techniques, especially in combination with some plugins. As we deliver this training more, we gradually adjusted the material to cover more advanced topics, like promotion, build pipeline, parameterized triggers, and so on &mdash; the kind that&#8217;s getting more traction lately as Jenkins starts to encompass continuous delivery.</p>
<p>And for me, this training will be the first to use the latest &#8220;install plugins without restart&#8221; feature, so that should help with attendees keeping the focus a bit.</p>
<p>In these trainings, we cap the number of attendees to a fairly small size so that I can pay attention to each attendees enough. People normally bring in questions that go beyond the training curriculam to discuss the problems they face in their day-to-day Jenkins administrations. I welcome those, too!</p>
<p>If you are interested, please <a href="http://www.cloudbees.com/training.cb">sign up</a> while the seats are available!</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2011/12/21/upcoming-san-francisco-training/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GitHub releases Janky</title>
		<link>http://kohsuke.org/2011/12/20/github-releases-janky/</link>
		<comments>http://kohsuke.org/2011/12/20/github-releases-janky/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 06:50:37 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[campfire]]></category>
		<category><![CDATA[cloudbees]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[janky]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=105</guid>
		<description><![CDATA[Tweet


I saw an announcement that GitHub released Janky today.
I initially got confused a bit because the post says Janky is a continuous integration server, which got me thinking that it&#8217;s something you&#8217;d use instead of Jenkins, but as I read more about it, it became clear that it&#8217;s something you use in conjunction with Jenkins [...]]]></description>
			<content:encoded><![CDATA[<div class="tw_button" style=";float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F20%2Fgithub-releases-janky%2F&amp;text=GitHub%20releases%20Janky&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F20%2Fgithub-releases-janky%2F" class="twitter-share-button" id="tweetbutton105" style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><div style="float:left; margin:1em"><a href="http://octodex.github.com/jenktocat/"><br />
<img src=http://octodex.github.com/images/jenktocat.jpg width=128><br />
</a></div>
<p>I saw an announcement that <a href="https://github.com/blog/1013-janky">GitHub released Janky</a> today.</p>
<p>I initially got confused a bit because the post says Janky is a continuous integration server, which got me thinking that it&#8217;s something you&#8217;d use <i>instead of</i> Jenkins, but as I read more about it, it became clear that it&#8217;s something you use <i>in conjunction with</i> Jenkins &mdash; it&#8217;s an application that sits between GitHub API, Jenkins API, and <a href="http://hubot.github.com/">Hubot</a> chat bot to help you create jobs on Jenkins, set up build triggers from push notifications, and so on. So for those who are using GitHub for hosting repositories and Campfire for chat, this is a nice interface that lets you get more out of your Jenkins.</p>
<p>The other thing I like here is that Janky pretty much requires you to run all the services &#8220;on the cloud&#8221;, because they need to talk to each other via HTTP calls. This makes it a great fit with <a href="http://www.cloudbees.com/dev.cb">CloudBees&#8217;s DEV@cloud</a>, the hosted Jenkins service CloudBees provide. So between GitHub as a hosted service for repositories, Campfire for a hosted service for chats, and DEV@cloud for a hosted service for Jenkins, you can start to see the power of integration between hosted services. Greater collaboration of web services is a future I can believe in!</p>
<p>And if you like the idea of GitHub + Jenkins but you don&#8217;t do Campfire, you might find <a href="https://wiki.jenkins-ci.org/display/JENKINS/Github+Plugin">the Jenkins GitHub plugin</a> useful. This plugin lets you set up <a href="http://kohsuke.org/2011/12/01/polling-must-die-triggering-jenkins-builds-from-a-git-hook/">a push-based build triggering</a> from your GitHub project with a single checkbox. </p>
<p>Finally, as an icing on the cake, they got <a href="https://github.com/github/janky">this nice thing to say</a> about Jenkins:</p>
<blockquote><p>The power, vast amount of plugins and large community of the popular CI server all wrapped up in a great experience.</p></blockquote>
<p>One more validation to the great momentum of <a href="http://jenkins-ci.org/">the Jenkins project</a>. Yay! </p>
<p>Congrats to the GitHub guys for the launch of Janky!</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2011/12/20/github-releases-janky/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webinar: Jenkins Enterprise by CloudBees</title>
		<link>http://kohsuke.org/2011/12/15/webinar-jenkins-enterprise-by-cloudbees/</link>
		<comments>http://kohsuke.org/2011/12/15/webinar-jenkins-enterprise-by-cloudbees/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 22:53:15 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[cloudbees]]></category>
		<category><![CDATA[webinar]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=102</guid>
		<description><![CDATA[Tweet

On Janurary 10th, I&#8217;ll be doing a webinar about Jenkins Enterprise by CloudBees (formerly known as Nectar, which we renamed with the permission of the community.)

Jenkins Enterprise is Jenkins LTS + a number of CloudBees&#8217; value-add plugins that help large and serious users, with the support. This release contains a number of new plugins, most [...]]]></description>
			<content:encoded><![CDATA[<div class="tw_button" style=";float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F15%2Fwebinar-jenkins-enterprise-by-cloudbees%2F&amp;text=Webinar%3A%20Jenkins%20Enterprise%20by%20CloudBees&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F15%2Fwebinar-jenkins-enterprise-by-cloudbees%2F" class="twitter-share-button" id="tweetbutton102" style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Computer-aj_aj_ashton_01.svg/320px-Computer-aj_aj_ashton_01.svg.png" style="float:left; padding:1em; width:160px"><br />
On Janurary 10th, I&#8217;ll be doing <a href="http://www3.gotomeeting.com/register/467263174">a webinar</a> about <a href="http://www.cloudbees.com/jenkins-enterprise-by-cloudbees.cb">Jenkins Enterprise by CloudBees</a> (formerly known as Nectar, which we renamed with the permission of the community.)</p>
<p>
Jenkins Enterprise is Jenkins LTS + a number of CloudBees&#8217; value-add plugins that help large and serious users, with the support. This release contains a number of new plugins, most notably the template plugin, which allows people to manage a large number of similar jobs, creating more domain friendly configuration mechanism, as well as means for the administrators to force certain practice on jobs.</p>
<p>
The release also includes improvements to existing plugins &mdash; folders can now have views defined within them, and with VMWare, you can now tell Jenkins to use all computers in a specific folder, as opposed to configure individual machines one by one. There&#8217;s also a new job scheduling mode that makes Jenkins prefer idle slaves over partially used slaves that already have your workspace. And so on.</p>
<p>
This release also lets you <a href="https://cloudbees.zendesk.com/entries/20586306-using-cloudbees-jenkins-plugins-on-your-jenkins">run these value-add plugins on top of non-LTS stock Jenkins</a>.</p>
<p>
All things combined, I think we got something interesting for many Jenkins users. Hope you can <a href="http://www3.gotomeeting.com/register/467263174">join us in this webinar</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2011/12/15/webinar-jenkins-enterprise-by-cloudbees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jenkins Plugin Tip: Access control and visibility in actions</title>
		<link>http://kohsuke.org/2011/12/08/jenkins-plugin-tip-access-control-and-visibility-in-actions/</link>
		<comments>http://kohsuke.org/2011/12/08/jenkins-plugin-tip-access-control-and-visibility-in-actions/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 17:00:47 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[internal]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=98</guid>
		<description><![CDATA[TweetAs I discussed before, Action is one of the primary ways plugins use to add more information to the top page, project pages, build pages, and so on.
Today I&#8217;d like to talk about writing protected actions that require some kind of access control. Depending on your requirements, there are several ways to do this. There [...]]]></description>
			<content:encoded><![CDATA[<div class="tw_button" style=";float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F08%2Fjenkins-plugin-tip-access-control-and-visibility-in-actions%2F&amp;text=Jenkins%20Plugin%20Tip%3A%20Access%20control%20and%20visibility%20in%20actions&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F08%2Fjenkins-plugin-tip-access-control-and-visibility-in-actions%2F" class="twitter-share-button" id="tweetbutton98" style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p><a href="http://blog.cloudbees.com/2011/08/jenkins-internal-action-and-its.html">As I discussed before</a>, <a href="http://javadoc.jenkins-ci.org/byShortName/Action"><tt>Action</tt></a> is one of the primary ways plugins use to add more information to the top page, project pages, build pages, and so on.</p>
<p>Today I&#8217;d like to talk about writing protected actions that require some kind of access control. Depending on your requirements, there are several ways to do this. There are three parts in Action that affects behaviours with this regard.</p>
<p>One is the <tt>getIconFileName()</tt> method. As its javadoc states, returning null from this method hides your action from the HTML page. So if you have an action and you don&#8217;t want to show it for users who don&#8217;t have the permission to access it, it could be something like the following:</p>
<pre>
public String getIconFileName() {
    return Jenkins.getInstance().hasPermission(Model.LIST)
         ? "gear.png" : null;
}
</pre>
<p>The next is the <tt>getUrlName()</tt> method. This method also allows null as the return value. This might sound similar to <tt>getIconFileName()</tt> but the implication is different. With <tt>getIconFileName()</tt> returning null, the rendered HTML page won&#8217;t show the link but if someone knows the URL, they can still access it. But with this method returning null, it&#8217;s as if no such URL is recognized.</p>
<p>So with the code like the following, if someone without the permission requests it, he&#8217;ll get 404 not found (modulo a bug, which I just fixed toward 1.443). This is sometimes desirable, as not only can you hide the data, but you can also hide the fact that something exists. For jobs, Jenkins does this &mdash; http://jenkins/job/top-secret-project/ returns 404 not found, not 401 forbidden, so guessing the project name will not help attackers gain any information.</p>
<pre>
public String getUrlName() {
    return Jenkins.getInstance().hasPermission(Model.LIST)
         ? "template" : null;
}
</pre>
<p>But this is sometimes undesirable, as users will not be prompted for authentication. If someone hits the link with an expired session, he&#8217;ll get 404 not found and he needs to be smart enough to know that this is because he hasn&#8217;t logged in, then navigate manually to the login page and come back. To avoid this problem, you&#8217;ll do the following and advertise the URL all the time.</p>
<pre>
public String getUrlName() {
    return "template";
}
</pre>
<p>And that brings me to the third part, because <tt>getUrlName()</tt> now always returning non-null means you aren&#8217;t actually checking if those who are accessing has a permission to do so. To do this, you use <a href="http://stapler.java.net/apidocs/org/kohsuke/stapler/StaplerProxy.html"><tt>StaplerProxy</tt></a>.</p>
<pre>
class MyAction implements Action, StaplerProxy {
    ...

    public Object getTarget() {
        Jenkins.getInstance().checkPermission(Model.LIST);
        return this;
    }
}
</pre>
<p>What happens is that when the URL that someone requests hits this action (or something underneath), we&#8217;ll verify that the requestor has the permission. If not, this will initiate the authentication, such as redirecting the user to the login page, or initiating the OpenID protocol with the preconfigured identity provider. Normally this interface is used to defer the UI processing to another object (sort of like how symlink works), but in this case we return <tt>this</tt> to indicate that we process this request by ourselves, and it&#8217;s smart enough not to cause infinitely recursion.</p>
<p>I guess the rule of thumb is that (1) you have to check the permission either in <tt>getUrlName()</tt> or <tt>getTarget()</tt>, or else there&#8217;s no access control, (2) you use <tt>getIconFileName()</tt> control the visibility in the HTML page, and (3) you use <tt>getUrlName()</tt> to control if you want 401 or 404 in case the access is denied.</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2011/12/08/jenkins-plugin-tip-access-control-and-visibility-in-actions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing plugins to Jenkins without restart</title>
		<link>http://kohsuke.org/2011/12/06/installing-plugins-to-jenkins-without-restart/</link>
		<comments>http://kohsuke.org/2011/12/06/installing-plugins-to-jenkins-without-restart/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 17:39:36 +0000</pubDate>
		<dc:creator>kohsuke</dc:creator>
				<category><![CDATA[jenkins]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://kohsuke.org/?p=95</guid>
		<description><![CDATA[Tweet
Today I&#8217;m going to talk about the upcoming feature in Jenkins 1.442 (to be released today), which allows you to finally install plugins without restarting Jenkins.

As I&#8217;ll discuss later, internally this is somewhat of an involving work. But for users, this is a very simple feature that doesn&#8217;t involve any learning curve. You&#8217;ll go to [...]]]></description>
			<content:encoded><![CDATA[<div class="tw_button" style=";float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F06%2Finstalling-plugins-to-jenkins-without-restart%2F&amp;text=Installing%20plugins%20to%20Jenkins%20without%20restart&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fkohsuke.org%2F2011%2F12%2F06%2Finstalling-plugins-to-jenkins-without-restart%2F" class="twitter-share-button" id="tweetbutton95" style="width:55px;height:22px;background:transparent url('http://kohsuke.org/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>
Today I&#8217;m going to talk about the upcoming feature in Jenkins 1.442 (to be released today), which allows you to finally install plugins without restarting Jenkins.</p>
<p>
As I&#8217;ll discuss later, internally this is somewhat of an involving work. But for users, this is a very simple feature that doesn&#8217;t involve any learning curve. You&#8217;ll go to the plugin manager, click &#8220;Available&#8221; tab, then choose the plugins to install. Scroll all the way down, then you&#8217;ll see the &#8220;Install without restart&#8221; button as well as the &#8220;Download new and install after restart&#8221; button. The former is the result of this work, allowing you to start using the new plugins right away. The latter is the traditional behaviour, where new plugins take effect after the next restart.</p>
<p>
I&#8217;m even thinking about removing the latter button after a while, once we gain enough confidence in the feature. I can&#8217;t think of any inherent reasons the latter is desirable over the former.</p>
<div align=center>
<img src="http://cdn-ak.f.st-hatena.com/images/fotolife/k/kkawa/20111129/20111129184656.png"/>
</div>
<p>
Click the button on the left, and the plugin gets downloaded, installed, and activated:</p>
<div align=center>
<img src="http://kohsuke.org/wp-content/uploads/2011/12/install-plugins.png"/>
</div>
<p>
Whereas existing users would by now be &#8220;trained&#8221; to click the &#8220;restart Jenkins when done&#8221; checkbox, now you can just go back to the top page and start using the new features from this plugin right away. Yup, that&#8217;s all there is to it.</p>
<h2>But how about upgrades?</h2>
<p>
Unfortunately, because of the architectual choice made in Jenkins, this same scheme wouldn&#8217;t allow us to upgrade existing plugins. See below.</p>
<h2>But how about uninstallation?</h2>
<p>
Likewise, this same scheme wouldn&#8217;t really let us do the &#8220;uninstallation&#8221; in the normal sense of the word. But I think some fake of that might be possible &mdash; like disabling all the contributions from this plugin (which will prevent anyone from using builders/publishers/etc in newly created jobs), but leaving existing jobs with those features configured as-is, until the next reboot, at which point those features will be just forgotten.</p>
<h2>Internal</h2>
<p>
Jenkins added the plugin support in 1.44, which is some 400 releases ago (man I&#8217;ve been doing this for long time!), and since that time Jenkins required a restart for new plugins to take effect. This is because we load plugins at start-up, doing all kinds of computation to build up the immutable data structure around all the plugins. Thus requiring a restart was partly out of my laziness, partly my preference to the immutable data structures, and partly because the computation was rather sequential. And I had bigger fishes to fry, like update centers, and things were left as it was.</p>
<p>
Then later came the improvement to the boot up, which removed a long sequential code, and divided them up to the directed acyclic graph of smaller tasks, which we then execute in parallel. This was primarily to speed up the boot time, but this made it somewhat easier to do dynamic initialization as a side effect. Then further down the road, the introduction of Guice made it harder once again, as it prefers immutability, too. So the current implementation puts the new components into the child injector, which seems to make enough plugins happy.</p>
<p>
Finally, why is upgrade hard? This is because Jenkins keeps instances of model objects for long time in memory (unlike, say, a typical database application, where those things are request scoped and thus much short-lived.) I like this for a number of reasons, such as more straight-forward object traversals, and the fact that builds take a long time anyway. But as with everything else in the software design, it is not without downsides, and one of them is that it makes dynamic reloading harder. This hopefully answers why just using OSGi alone does not fix this problem.</p>
<p>
My current thinking is that &#8220;fixing&#8221; this via HA is probably the way to go. Or maybe fake uninstallation + dynamic installation might be enough for most plugins. We&#8217;ll see.</p>
<h2>Conclusion</h2>
<p>
Hopefully you&#8217;ll like this feature. While this is an obvious simple feature for users, as you see internally I&#8217;ve done some hard work. If this makes it easier for you to try out new plugins, my time was well spent.</p>
]]></content:encoded>
			<wfw:commentRss>http://kohsuke.org/2011/12/06/installing-plugins-to-jenkins-without-restart/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 0.596 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-01-31 10:11:38 -->

