<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Just for fun</title>
	<atom:link href="http://ostrovsky.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://ostrovsky.org</link>
	<description>Why are we hiding from the police dad? They use vi son, we use emacs.</description>
	<lastBuildDate>Wed, 13 Mar 2013 08:11:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Main reason to use open source software: customizability</title>
		<link>http://ostrovsky.org/main-reason-to-use-open-source-software-customizability/</link>
		<comments>http://ostrovsky.org/main-reason-to-use-open-source-software-customizability/#comments</comments>
		<pubDate>Tue, 12 Mar 2013 22:47:27 +0000</pubDate>
		<dc:creator>davido</dc:creator>
				<category><![CDATA[code review system]]></category>
		<category><![CDATA[Gerrit]]></category>

		<guid isPermaLink="false">http://ostrovsky.org/?p=254</guid>
		<description><![CDATA[Why are we using open source software? Well that&#8217;s a rhetoric question and i am sure you come up with many reasons for that, just to name few: Freedom Quality Security Try it first Community And many others. How about customizability? Have you already realized that some feature is missing in product &#8220;foo&#8221;? Fine, what [...]]]></description>
			<content:encoded><![CDATA[<p>Why are we using open source software? Well that&#8217;s a rhetoric question and i am sure you come up with many reasons for that, just to name few:</p>
<ul>
<li>Freedom</li>
<li>Quality</li>
<li>Security</li>
<li>Try it first</li>
<li>Community</li>
</ul>
<p>And many others. How about customizability? Have you already realized that some feature is missing in product &#8220;foo&#8221;? Fine, what now? Well try to bring the vendor to extend it. But wait, we are using open source software, right? Let&#8217;s patch it then <img src='http://ostrovsky.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Let&#8217;s see how easy it is &#8230; but the problem first:</p>
<pre class="brush: bash; title: ; notranslate">
$&gt;git

usage: git [--version] [--exec-path[= ]] ...

The most commonly used git commands are:

add      Add file contents to the index
branch   List, create, or delete branches
clone    Clone a repository into a new directory
[...]

</pre>
<p>So now let&#8217;s compare that output with our another favorite tool that we all so love: <a title="Gerrit" href="http://code.google.com/p/gerrit/">Gerrit</a>:</p>
<pre class="brush: bash; title: ; notranslate">
$&gt;ssh gerrit gerrit --help

gerrit COMMAND [ARG ...] [--] [--help (-h)]
[...]
Available commands of gerrit are:

   ban-commit
   create-account
[...]
</pre>
<p><span id="more-254"></span></p>
<p>Well, almoust identically? What about mandatory &#8220;&#8211;help&#8221; option and missing command descriptions? Yes. It is even more annoying once you extend Gerrit and create a plugin for it, <a title="like we did" href="https://github.com/davido/gerrit-buildbot-plugin">like we did</a>. Gerrit plugin typically exposes some functionality through ssh commands. And the consumer would like to know what these commands are doing. And that&#8217;s very handy to have one line description for it. Note: plugin uses the same extended documentation functionality like Gerrit code: markdown html page generation, but you still need a browser to <a href="https://gerrit.libreoffice.org/plugins/buildbot/Documentation/index.html" title="read it">read it</a>. So let&#8217;s <a title="patch it" href="https://gerrit-review.googlesource.com/#/c/41100/">patch it</a> upstream. It was never so easy with Gerrit: clone it, extend it and upload it to Gerrit, then wait for review. Once reviewed adjust it and wait for merging. Once it is merged, recieve congratulations for extending your favorite tool upstream <img src='http://ostrovsky.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<pre class="brush: bash; title: ; notranslate">
$&gt;ssh gerrit gerrit
Available commands of gerrit are:


   ban-commit      Ban a commit from a project's repo
   create-account  Create a new batch/role account
[...]
</pre>
<p>Is that the whole story? Well not really, how about manual page?</p>
<pre class="brush: bash; title: ; notranslate">
$&gt;man gerrit-review
No manual entry for gerrit-review
</pre>
<p>Hm&#8230; That would be hard, in the end we consume only ssh commands from Gerrit. And Gerrit is shipped with pretty <a title="cool documeentation" href="http://gerrit-documentation.googlecode.com/svn/Documentation/2.5.2/index.html">cool documentation</a>. OTOH that documentation is html based and we have to leave our terminal and switch to browser&#8230; really? So let&#8217;s <a title="patch that too" href="https://gerrit-review.googlesource.com/#/c/42901/">patch that too</a>. And create local gerrit man-pages. After deploying, it just work:</p>
<pre class="brush: bash; title: ; notranslate">
$&gt;man gerrit-review
[...]
</pre>
<p>Note: once the core Gerrit provides manual pages, the tool chain is established, it is trivial now to provide manual pages for plugins. Just copy the <a href="https://gerrit.googlesource.com/gerrit/+/master/Documentation/man/Makefile" title="makefile">makefile</a> adjust it, generate manual pages and distribute it. So, once you are using open source and missing something &#8230; go ahead and customize it <img src='http://ostrovsky.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Many thanks to Norbert who fisrt argued, that Gerrit is missing these features and to great Gerrit community for helping me to integrate it!</p>
]]></content:encoded>
			<wfw:commentRss>http://ostrovsky.org/main-reason-to-use-open-source-software-customizability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gbildify expat module and test it on windows</title>
		<link>http://ostrovsky.org/gbildify-expat-module-and-test-it-on-windows/</link>
		<comments>http://ostrovsky.org/gbildify-expat-module-and-test-it-on-windows/#comments</comments>
		<pubDate>Mon, 29 Oct 2012 11:27:23 +0000</pubDate>
		<dc:creator>davido</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ostrovsky.org/?p=198</guid>
		<description><![CDATA[During my work on migration from dmake to gnu make (gbuildification) of expat module i discovered some innocent looking lines in the old dmake based make file: So what is BUILD_X64 here and when it is used? My understanding was, that LO isn&#8217;t shipping as 64 bit binary on Windows. Tor did some great work [...]]]></description>
			<content:encoded><![CDATA[<p>During my work on migration from dmake to gnu make (gbuildification) of <a title="expat module" href="https://gerrit.libreoffice.org/#/c/867/">expat module</a> i discovered some innocent looking lines in the old dmake based make file:</p>
<pre class="brush: bash; title: ; notranslate">
.IF &quot;$(BUILD_X64)&quot;!=&quot;&quot;
# ---------------- X64 stuff special ---------------------
#  use UNICODE only because shell/shlxthandler
#  doesn't link against ascii_expat_xmlparse
#---------------------------------------------------------
SLOFILES_X64=$(SLO_X64)/xmlparse.obj \
             $(SLO_X64)/xmlrole.obj \
             $(SLO_X64)/xmltok.obj
CDEFS_X64+=-DXML_UNICODE -DCOMPILED_FROM_DSP
CFLAGS_X64+=-I..
LIB1TARGET_X64=$(SLB_X64)/$(TARGET)_xmlparse.lib
LIB1OBJFILES_X64=$(SLO_X64)/xmlparse.obj
LIB2TARGET_X64=$(SLB_X64)/$(TARGET)_xmltok.lib
LIB2OBJFILES_X64=$(SLO_X64)/xmlrole.obj \
    $(SLO_X64)/xmltok.obj
.ENDIF # &quot;$(BUILD_X64)&quot;!=&quot;&quot;
</pre>
<p>So what is BUILD_X64 here and when it is used? My understanding was, that LO isn&#8217;t shipping as 64 bit binary on Windows. Tor did some <a href="http://tml-blog.blogspot.de/2011_03_01_archive.html" title="great work">great work</a> on it but it is still highly experimented. So what is all that stuff about? It turns out, that LO does shipp nativ 64 bit extension for 64 bit OS for shell integration and special version of expat (64 bit) must be created for that.</p>
<p>Not big deal, right? So what&#8217;s the problem with that? The problem was to test it. Gbuildification has already broken almoust everything, so before merging the gbuildified expat to master some real tests should be done, especially if some native bits are involved. Having only access to WinXP (32 bit) and VS 2008 Express was clearly not sufficient. So before installing a whole blown testbed with new VM, 2008 Server 64 bit, SDKs and 64 bit VS compiler i thought i would just ask the folks out there for help.</p>
<p><span id="more-198"></span></p>
<p>So i asked Norbert on LO congress to attach his 2008R2@16 tinderbox to my gerrit patch. He did (thank you Norbert!) and it failed. Unfortunatelly i din&#8217;t figure out how to access the error log for that. Well, i configured a new VM and installed Windows Server 2008, SDKs, VS 2008 Express compiler to test my patch. But the disappointment was really big: this configuration neither tested 64 bit shell extension nor did it test expat 64 bit code. As i understand now, VS express edition doesn&#8217;t ship 64 bit executables (or at least i didn&#8217;t figure out how to install that).</p>
<p>Having access to VS 2010 professional only, i found myself starting a new adventure: adjusting LO code to compile on that new compiler. Thank Peter&#8217;s work it almoust worked. I filed some changes in this gerrit patch <a title="link" href="https://gerrit.libreoffice.org/#/c/914/">link</a> and updated the documentation correspondingly: <a title="here" href="http://wiki.documentfoundation.org/Development/Windows_Build_Dependencies#Visual_Studio_2010_compiler">here</a> and <a title="here" href="http://wiki.documentfoundation.org/Development/Windows_Build_Dependencies#Visual_Studio_2012_compiler">here</a>. One weird templating problem in writerfilter is still not solved, though: <a title="link" href="http://pastebin.com/4fwg9FWL">link</a>. Any help here would be highly appreciated!</p>
<p>After all these tricky problems i could check my patch and found the problem. It was failing to link 64 bit native libs because of architecture mismatch: objects were (still) built with _X86_ but the lib was AMD64. The reason for that was: i forgot to extend the compilation to honour BUILD_X64 setting. So i introduced a new function and used it (in C++ case it was already there) and all was fine:</p>
<pre class="brush: bash; title: ; notranslate">
gb_StaticLibrary_add_x64_generated_cobjects
</pre>
<p>In the end i wanted to test the created msi file but was experiencing that weird msi installation problem: <a title="fdo#55290" href="https://bugs.freedesktop.org/show_bug.cgi?id=55290">fdo#55290</a>. It was clear that the problem was introduced with gbuildification of cli_ure module.</p>
<p>The comparison of verbose output of old <a title="dmake build" href="https://ci.idaia.de/job/LO-WinXP-Head/65/console">dmake build</a> and <a title="the new one" href="https://ci.idaia.de/job/LO-Win2008-VC2010/3/console">the new one</a> reveals the different approaches in creating the native library. While in the old build system the library was created under the end name cli_cppuhelper.dll and signed afterwards, on the new gbuild system it was first created under the different name cli_cppuhelper_native.dll and then renamed during the signing step to the end name cli_cppuhelper.dll. This is due the fact, that in gbuild world we don&#8217;t want to mess with copying artifacts around: all libs are living under bin directory. That why that is natural on gbuild to prefer name differentiation over different directories.</p>
<p>But the problem is that the native library may not be renamed. If you look inside it (emacs) you can see that it &#8220;remembers&#8221; his name. Like always, the standard action sequence: &#8220;reproduce, isolate, find workaround, understand and fix&#8221; <a title="link" href="http://cgit.freedesktop.org/libreoffice/core/commit/?id=8865b7f013bcd9b4ce41dd98be28ba28aeb22e66">worked here</a>.</p>
<p>After all, i am able to install a fresh built LibO-Dev_3.7.0.0.alpha0_Win_x86_install_en-US.msi, compiled with VS 2010 and contained gbuidified expat with 64 bit shell integration. But Michael Stahl merged my gerrit <a title="expat module" href="https://gerrit.libreoffice.org/#/c/867/">expat module</a> already (thank you Michael!) and besides i have no idea how to test that LO shell integration? May be some one can point me to a RTFM or send me a screen shot: it would be nice to know why i was messing around with all that stuff. I wanted only gbuildify expat module &#8230; <img src='http://ostrovsky.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ostrovsky.org/gbildify-expat-module-and-test-it-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LibreOffice: new mork driver</title>
		<link>http://ostrovsky.org/libreoffice-new-mork-driver/</link>
		<comments>http://ostrovsky.org/libreoffice-new-mork-driver/#comments</comments>
		<pubDate>Sun, 23 Sep 2012 21:35:07 +0000</pubDate>
		<dc:creator>davido</dc:creator>
				<category><![CDATA[LibreOffice]]></category>
		<category><![CDATA[mork file format]]></category>

		<guid isPermaLink="false">http://ostrovsky.org/?p=70</guid>
		<description><![CDATA[Some history first First time i compiled LibreOffice (LO) in march 2012, it failed to compile in the seamonkey (moz) module (i didn&#8217;t enable it explicitly). I had many questions about moz integration in LO: what has an office suite to do with a browser? why it is enabled per default, if it&#8217;s something optional? why [...]]]></description>
			<content:encoded><![CDATA[<h5>Some history first</h5>
<p>First time i compiled LibreOffice (LO) in march 2012, it failed to compile in the seamonkey (moz) module (i didn&#8217;t enable it explicitly). I had many questions about moz integration in LO:</p>
<ol>
<li>what has an office suite to do with a browser?</li>
<li>why it is enabled per default, if it&#8217;s something optional?</li>
<li>why it was failing to compile on my recent Ubuntu box?</li>
</ol>
<p>Six months later i knew the answers to all these questions <img src='http://ostrovsky.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<ol>
<li>it is needed for Thunderbird address book integration and some other extensions.</li>
<li>it is (well was) not really optional: mail merge is an important feature, because sooner or later you want to send mails from your office suite to the recipients from your address book. To import the Mozilla Address Book (MAB) data, which is stored in mork file format, LO need some means to read and interpret that format. Because of lack of alternative implementations Mozilla itself was used for that purpose.</li>
<li>well here things started to become complicated. It was subtle linking issue: compiler tool chain configuration was changed on Debian/Ubuntu: &#8220;as-needed&#8221; became the default, breaking many tools and libraries, among other the moz module in LO. But why two distros had a compilation problem in the moz module and nobody noticed? Debian/Ubuntu maintainers disabled this &#8220;a strangely hacked up Mozilla binary&#8221; inside of LO.</li>
</ol>
<p><span id="more-70"></span>The chronology of events was:</p>
<ul>
<li>All was fine: moz module could be compiled on Debian/Ubuntu</li>
<li>Debian/Ubuntu maintainer disabled mozilla in LO: &#8220;It is NO OPTION to use obsolete, patched seamonkey for providing the Mozilla Adress Book stuff.  [...] Thus it&#8217;s (let alone for security reasons) disabled in most distros.&#8221; <a title="link" href="https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/93546/comments/182">link</a></li>
<li>Debian/Ubuntu introduced a compiler tool chain configuration change, making &#8220;as-needed&#8221; the default (see <a title="here" href="https://lists.ubuntu.com/archives/ubuntu-devel-announce/2010-October/000772.html">here</a> and <a title="here" href="http://wiki.debian.org/ToolChain/DSOLinking">here</a>)</li>
<li>folks tried to compile LO and it was failing on Debian/Ubuntu</li>
</ul>
<p>At that stage I didn&#8217;t know the whole story but I could convince the LO dev guys to invert the logic and to make &#8211;disable-mozilla the default <a title="option" href="http://cgit.freedesktop.org/libreoffice/core/commit/?id=bbdb00c8c57a72f9bc730d3f7aab8a4d4acc6308">option</a>. Finally I <a title="fixed" href="http://cgit.freedesktop.org/libreoffice/core/commit/?id=e5ac3107e1bef08f619f42c099424a70a9ade281">fixed</a> the compilation problem (providing &#8220;-Wl,&#8211;no-as-needed&#8221; option) and forgot about that stuff.</p>
<h5>Work on mork driver</h5>
<p>Some time later a core developer sent me a link to this <a title="bugzilla issue" href="https://bugs.freedesktop.org/show_bug.cgi?id=51004">bugzilla issue</a> and asked me if I would like to take a look at it. I was interested. Submitter of that easy hack did very impressive job with his in depths description. I started to analyse how all parts were matching together: mozab driver, profile discovery, MQuery, xpcom backend driver (part of seamonkey) and the new open source mork file parser. It was very quickly obviously that substantial part of old mozab driver implementation must be reused. After some deeper investigation of the old implementation and the new mork parser the whole picture was clear to me. Basically there are two use cases:</p>
<ul>
<li>MorkDriver Bootstrap:</li>
</ul>
<p><a href="http://ostrovsky.org/wp-content/uploads/2012/09/import_mab_source.png"><img class="alignnone size-full wp-image-145" title="import_mab_source" src="http://ostrovsky.org/wp-content/uploads/2012/09/import_mab_source.png" alt="" width="660" height="575" /></a></p>
<ul>
<li>Query Execution:</li>
</ul>
<p><a href="http://ostrovsky.org/wp-content/uploads/2012/09/execute_query.png"><img class="alignnone size-full wp-image-146" title="execute_query" src="http://ostrovsky.org/wp-content/uploads/2012/09/execute_query.png" alt="" width="667" height="545" /></a></p>
<p>Some words about mork file format. In a nutshell <a title="mork file format" href="https://developer.mozilla.org/en-US/docs/Mork_Structure">mork file format</a> is a generic <a title="sparce matrix" href="http://en.wikipedia.org/wiki/Sparse_matrix">sparce matrix</a> data structure. It matches exactly the requirements: in an average address book only a small part of possible properties is actually filled. I you would open abook.mab file, you would see something like that:</p>
<pre class="brush: plain; title: ; notranslate">

[keys]:
  (83=FirstName)(84=LastName)(85=PhoneticFirstName)
  (86=PhoneticLastName)(87=DisplayName)(88=NickName)
  (89=PrimaryEmail) [...]

[values]:
(81=John)(82=Doe)(83=)
(84='John Doe')(85=jdoe@somewhere.org)
[...]

[rows]:
  [1(^83^81)(^84^82)(^85=)(^86=)
    (^87^84)(^88^81)(^89^85)
[...]

</pre>
<p>Well, there is no magic once you understand how it works. We have overlaping key and value namespaces that makes it some hard to understand. It was used to save the place (for which cost?). So the common construct in mork file is (^83^81). This is a so called cell and consist from pointer to column and pointer to value, i. e. in the record above the name is Joe, the last name is Doe and the email is &#8220;jdoe@somewhere.org&#8221;.</p>
<p>I sarted the implementation with a small utility: <a title="mork_helper.cxx" href="http://cgit.freedesktop.org/libreoffice/core/tree/connectivity/source/drivers/mork/mork_helper.cxx">mork_helper.cxx</a>. With it you can dump the whole content of your abook.mab file (using profile discovery to locate it first). Once it worked i shamelessly stollen substantial part of the old mozab driver, replacing more or less the interface to the backend and the backend itsef.</p>
<h5>Conclusion:</h5>
<p>It was really exciting time to work on new mork driver for LibreOffice. On linux platform the new mork driver would be shipped from release 3.7 on. However on windows old seamonkey binary continue to be packaged. On windows, seamonkey is also in charge for reading Outlook and Outlook Express file formats. There is no native (not deprecated) API for that. That&#8217;s pretty uncool. I&#8217;m thinking of extracting that part of seamonkey and use it directly (like open source mork parser) without shipping the whole seamonkey. Once in place we would hopefully be able to strip this &#8220;strangely hacked up Mozilla binary&#8221; from LO repository. And last but not least many thanks to all who helped out during the development and integration, especially Stephan Bergmann, Michael Stahl, Fridrich Strba, Michael Meeks, David Tardon and Caolan McNamara.</p>
<p>scratched</p>
]]></content:encoded>
			<wfw:commentRss>http://ostrovsky.org/libreoffice-new-mork-driver/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How Gerrit fits in LibreOffice CI Infrastructure</title>
		<link>http://ostrovsky.org/how-gerrit-fits-in-libreoffice-ci-infrastructure/</link>
		<comments>http://ostrovsky.org/how-gerrit-fits-in-libreoffice-ci-infrastructure/#comments</comments>
		<pubDate>Sun, 12 Aug 2012 19:14:18 +0000</pubDate>
		<dc:creator>davido</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Gerrit]]></category>
		<category><![CDATA[LibreOffice]]></category>
		<category><![CDATA[Tinderbox]]></category>

		<guid isPermaLink="false">http://ostrovsky.org/?p=42</guid>
		<description><![CDATA[As you may know, LibreOffice undergoes currently migration to code review system gerrit. In his post to dev ML Why Gerrit and other consideration Norbert Thiebaud explained the objectives which the initiators of that move are trying to achieve. As though by chance, the first reason behind that move was cit. a/ Allow dev to [...]]]></description>
			<content:encoded><![CDATA[<p>As you may know, LibreOffice undergoes currently migration to code review system gerrit. In his post to dev ML <a title="Why Gerrit and other consideration" href="http://lists.freedesktop.org/archives/libreoffice/2012-June/033872.html">Why Gerrit and other consideration</a> Norbert Thiebaud explained the objectives which the initiators of that move are trying to achieve. As though by chance, the first reason behind that move was cit.</p>
<pre>a/ Allow dev to pre-build commit on a variety of platform _before_
pushing them to master. iow check and push rather than the current
push and fix. [...]</pre>
<p>To see how gerrit fits in current LibreOffice CI picture or what should be done for it let us first take a look at the situation prior to gerrit migration. At the moment there are 23 <a title="Tinderboxes" href="http://wiki.documentfoundation.org/Development/Tinderbox">Tinderboxes</a> (TB), that independently running on donated machines and asynchronously verify different git branches. They upload the build results to the master TB per mail. Master TB extracts the log from the mail and puts it to the web site for that specific branch, i.e. for master you can find it <a title="here" href="http://tinderbox.libreoffice.org/MASTER/status.html">here</a>.<span id="more-42"></span></p>
<p>So basically we have to set up some process let us name it task queue that has to solve the follow challenges to integrate TB and gerrit change verification:</p>
<ul>
<li>one gerrit change must ber verifies on variety of platform simultaneously by different TB.</li>
<li>ACL: only authorized gerrit user might (mostly member of non nteractive group, i. e. BuildBot) be able to do it.</li>
<li>if more then one TB exists for each platform engaged in gerrit patch verification (and this is often the case)  only one TB may win the gerrit change verification competition. Obviously that require something that behaves like a blocking queue for each platform.</li>
<li>One combined approval message for all platform has to be reported back to gerrit: +a if and only if all tasks on all platform were successful. -1 otherwise.</li>
<li><strong>idle-timeout</strong>: if task is scheduled to platform specific verification queue and was not picked up. Note: it is not a failure.</li>
<li><strong>engaged-timeout</strong>: task was picked up, but no result was reported during reasonable amount of time. In that case one can think about recovering process: reschedule the same task once time again to platform specific verification queue.</li>
<li>Receive the log files from TB and present them. It is clear that fire and forget functionality (TB send per mail result to master TB) doesn&#8217;t work with gerrit, because the verification message must contain link to the log file and TB master is not involved in that use case.</li>
<li>Communication between tinbuild2 (bash script) and gerrit itself.</li>
</ul>
<p>LibreOffice is not the first project that integrates gerrit with CI Infrastructure. We have <a title="Jenkins Gerrit Trigger Plugin" href="https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger">Jenkins Gerrit Trigger Plugin</a> and Openstack project has <a title="zuul" href="https://github.com/openstack-ci/zuul/">zuul</a>. But what makes the situation unique is the fact, that the TB don&#8217;t maintain the continuous connection to any master, they appear only for a moment, pick a task, disappear, report results and so on. To address this problem a new approach must be implemented.</p>
<p>Since version 2.4 and upcoming 2.5 gerrit provides mature plugin architecture. gerrit plugin has access to all gerrit services, including</p>
<ul>
<li>native support for SSH commands.</li>
</ul>
<ul>
<li>stream event listener provides access to all gerrit events, i.e. patchset created.</li>
</ul>
<ul>
<li>publish event factory used to report review/verify message for gerrit change</li>
</ul>
<ul>
<li>HTTP module integrates with gerrit web application. It is needed to implement access to the log files, received from TB.</li>
</ul>
<p>To see how it fits all together, look at that picture:</p>
<p><a href="http://ostrovsky.org/wp-content/uploads/2012/08/truegate.png"><img class="alignnone size-large wp-image-57" title="truegate" src="http://ostrovsky.org/wp-content/uploads/2012/08/truegate-1024x768.png" alt="" width="565" height="423" /></a></p>
<ol>
<li>Buildbot gerrit plugin listens to gerrit patch set created events.</li>
<li>developer uploads a patch set to gerrit.</li>
<li>Listener receives the event and creates a GerritJob instance with n TB tasks (one per each platform). Those tasks are maintained in platform specific blocking queue.</li>
<li>TB ask per ssh for a task with <strong>get-task</strong> command (for their platform). The task is removed from the queue and TB is engaged. In that way it is guaranteed that only one TB get the same task to build.</li>
<li>Once ready TB reports the result and send the log file and the status per ssh with <strong>report</strong> command.</li>
<li>When the last task status is reported for the gerrit job is considered as ready and combined verify message is reported back to gerrit. The message contains the links to the log files for all checked platform.</li>
<li>Behind that link the the own log file servlet is located.</li>
</ol>
<p>Current status of plugin: basic functionality is provided. Code must be consolidated and more tests and feature must be implemented: Multi project support, Admin GUI, persistence of queue, timeout behaviour. If you want contribute you can find the code &#8230; on gerrit: <a title="buildbot-gerrit-plugin" href="https://review.idaia.de/#/q/status:open+project:gerrit-buildbot,n,z">Buildbot-gerrit-plugin</a>. Here are steps how to contribute:</p>
<ol>
<li>register with OpenID to <a title="gerrit" href="https://review.idaia.de">gerrit</a> and upload your public keygerrit:.</li>
<li>clone the repo:<br />
git clone ssh://davido@review.idaia.de:29418/gerrit-buildbot.git .</li>
<li>install git-review:<br />
sudo pip install git-review<br />
and set it up: git review &#8211;setup</li>
<li>change something and commit</li>
<li>push to gerrit:<br />
git review</li>
<li>wait for verification/approval.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ostrovsky.org/how-gerrit-fits-in-libreoffice-ci-infrastructure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting IRC gerrit bot for LibreOffice project</title>
		<link>http://ostrovsky.org/setting-irc-gerrit-bot-for-libreoffice-project/</link>
		<comments>http://ostrovsky.org/setting-irc-gerrit-bot-for-libreoffice-project/#comments</comments>
		<pubDate>Tue, 17 Jul 2012 21:28:17 +0000</pubDate>
		<dc:creator>davido</dc:creator>
				<category><![CDATA[code review system]]></category>
		<category><![CDATA[Gerrit]]></category>
		<category><![CDATA[gerrit]]></category>
		<category><![CDATA[IRCbot]]></category>
		<category><![CDATA[LibreOffice]]></category>

		<guid isPermaLink="false">https://ostrovsky.org/?p=8</guid>
		<description><![CDATA[LibreOffice project is migrating currently to gerrit code review system. While gerrit provides mail channel out of the box, to install IRC gerrit bot to get notified on all or some gerrit events you are on your own. Thankfully OpenStack project comes to rescue, they have created and extracted simple yet very powerful multi project [...]]]></description>
			<content:encoded><![CDATA[<p><a title="LibreOffice" href="http://www.libreoffice.org/">LibreOffice</a> project is migrating currently to <a title="gerrit code review system" href="http://code.google.com/p/gerrit/">gerrit code review system</a>. While gerrit provides <a title="mail channel" href="http://gerrit-documentation.googlecode.com/svn/Documentation/2.4.2/config-mail.html">mail channel</a> out of the box, to install IRC gerrit bot to get notified on all or some gerrit events you are on your own. Thankfully <a title="OpenStack" href="http://www.openstack.org/">OpenStack</a> project comes to rescue, they have created and extracted simple yet very powerful multi project and multi channel <a title="gerritbot" href="https://github.com/openstack-ci/gerritbot">gerritbot</a>. It has 3 prerequisites:</p>
<ul>
<li>python-daemon</li>
<li>python-yaml</li>
<li>irc</li>
</ul>
<p>To be configured it needs two files: one for gerrit and IRC configuration and one for mapping of multiple IRC channels to gerrit events. Sample for gerritbot.cfg file:</p>
<pre class="brush: bash; title: ; notranslate">

[ircbot]
 nick=myIRCgerritBot
 pass=
 server=irc.freenode.net
 port=6667
 channel_config=/home/gerrit2/bot/channel.yaml

[gerrit]
 user=gerritbot
 key=/home/gerrit2/.ssh/id_rsa
 host=gerrit.libreoffice.org
 port=29418

</pre>
<p><span id="more-8"></span>gerritbot.channel.yaml:</p>
<pre class="brush: bash; title: ; notranslate">

libreoffice-dev:
 events:
 - patchset-created
 - change-merged
 projects:
 - dev-tools
 branches:
 - master

libreoffice-infra:
 events:
 - patchset-created
 - change-merged
 projects:
 - dev-tools
 branches:
 - master

</pre>
<p>As you can see, we have configured two different channels and mapped the same gerrit events to both. To start you can use gerritbot.init file or just start it as a daemon from the command line with the gerritbot.cfg as argument. Note: if daemon is not started (lock file is not created) then you may experience some configuration problem. While gerritbot still doesn&#8217;t provides a logging machinery (why wouldn&#8217;t you provide a patch for that?) it might be manipulated to comment out daemonization and run it as a script. Just comment out four lines and call _main() directly. Now you must see configuration problems.</p>
<p>Another problem may occur with IRC channel. These one can be tracked down with irclib. Just turn on DEBUG=1 in irclib.py on your system and irclib would be very verbose and would tell you the whole truth.</p>
<p>Every time someone upload or commenting something on gerrit IRC bot would say something like that:</p>
<pre class="brush: plain; light: true; title: ; notranslate">

logerritbot David Ostrovsky proposed a change to dev-tools: add configuration files for IRC gerrit bot  https://gerrit.libreoffice.org/327

</pre>
]]></content:encoded>
			<wfw:commentRss>http://ostrovsky.org/setting-irc-gerrit-bot-for-libreoffice-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
