blob: f3557d6e1ece978147a0a1d66ca706e5c3c5702d [file] [log] [blame]
Ian Maxon3dffc852015-07-13 20:17:09 -07001<!DOCTYPE html>
2<html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <meta name="viewport" content="width=device-width, initial-scale=1">
7 <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
8 <meta name="description" content="">
9 <meta name="author" content="">
Ian Maxonf84cb812015-12-07 15:09:45 -080010 <link rel="icon" href="favicon.ico">
Ian Maxon3dffc852015-07-13 20:17:09 -070011
12 <title>Contributing to AsterixDB</title>
13
14 <!-- Bootstrap core CSS -->
Ian Maxonf84cb812015-12-07 15:09:45 -080015 <link href="css/bootstrap.min.css" rel="stylesheet">
Ian Maxon3dffc852015-07-13 20:17:09 -070016 <!-- Bootstrap theme -->
17
18 <!-- Custom styles for this template -->
Ian Maxonf84cb812015-12-07 15:09:45 -080019 <link href="css/theme.css" rel="stylesheet">
Ian Maxon3dffc852015-07-13 20:17:09 -070020
21 <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
22 <!--[if lt IE 9]>
23 <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
24 <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
25 <![endif]-->
26 <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
27 </head>
28
29 <div class="container theme-showcase" role="main">
30 <div class="masthead">
31 <p class="lead">
Ian Maxonf84cb812015-12-07 15:09:45 -080032 <a href="index.html"><img src="img/asterixdb.png" style="height:75px; width:auto; vertical-align:bottom; margin-top:10px;"/></a>
Ian Maxon3dffc852015-07-13 20:17:09 -070033 </p>
34</div>
35
36<nav class="navbar navbar-default">
37 <div class="container">
38 <div class="navbar-header">
39 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
40 <span class="sr-only">Toggle navigation</span>
41 <span class="icon-bar"></span>
42 <span class="icon-bar"></span>
43 <span class="icon-bar"></span>
44 </button>
Ian Maxonf84cb812015-12-07 15:09:45 -080045 <a class="navbar-brand" href="index.html">Overview</a>
Ian Maxon3dffc852015-07-13 20:17:09 -070046 </div>
47 <div class="navbar-collapse collapse">
48 <ul class="nav navbar-nav">
Ian Maxonf84cb812015-12-07 15:09:45 -080049 <li><a href="download.html">Download</a></li>
Ian Maxona9643c82015-09-01 11:15:57 -100050 <li class="dropdown">
51 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Documentation<span class="caret"></span></a>
52 <ul class="dropdown-menu" role="menu">
53 <li class="dropdown-header">Stable release</li>
Ian Maxone2b799e2015-11-24 18:20:03 -080054 <li><a href="docs/0.8.7-incubating/index.html">Documentation for 0.8.7-incubating<i class="fa fa-external-link fa-sm"></i></a></li>
Ian Maxona9643c82015-09-01 11:15:57 -100055 <li class="divider"></li>
56 <li class="dropdown-header">Snapshot release</li>
Ian Maxone2b799e2015-11-24 18:20:03 -080057 <li><a href="https://ci.apache.org/projects/asterixdb/index.html">Documentation for 0.8.8-SNAPSHOT <i class="fa fa-external-link fa-sm"></i></a></li>
Ian Maxona9643c82015-09-01 11:15:57 -100058 </ul>
59 </li>
Ian Maxonf84cb812015-12-07 15:09:45 -080060 <li><a href="about.html">About</a></li>
61 <li><a href="community.html">Community</a></li>
Ian Maxon3dffc852015-07-13 20:17:09 -070062 <li class="dropdown">
63 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Contributing <span class="caret"></span></a>
64 <ul class="dropdown-menu" role="menu">
65 <li class="dropdown-header">For New Contributors</li>
Ian Maxonf84cb812015-12-07 15:09:45 -080066 <li><a href="dev-setup.html">Development Setup</a></li>
Ian Maxon3dffc852015-07-13 20:17:09 -070067 <li class="divider"></li>
68 <li class="dropdown-header">For Committers</li>
Ian Maxonf84cb812015-12-07 15:09:45 -080069 <li><a href="pushing.html">Pushing changes</a></li>
70 <li><a href="site.html">Editing this site</a></li>
Ian Maxon3dffc852015-07-13 20:17:09 -070071 </ul>
72 </li>
73 </ul>
74 </div><!--/.nav-collapse -->
75 </div>
76 </nav>
77
78
79 <div class="row">
80<div class="col-md-8 col-centered">
81<h2>Contributing to AsterixDB</h2>
82<hr />
83
84<ul id="markdown-toc">
85 <li><a href="#introduction" id="markdown-toc-introduction">Introduction</a></li>
Ian Maxonacb58492015-10-16 19:12:28 -070086 <li><a href="#master-snapshots" id="markdown-toc-master-snapshots">Master snapshots</a> <ul>
87 <li><a href="#managix-installer" id="markdown-toc-managix-installer">Managix Installer</a></li>
88 <li><a href="#yarn-installer" id="markdown-toc-yarn-installer">YARN Installer</a></li>
89 </ul>
90 </li>
Ian Maxon3dffc852015-07-13 20:17:09 -070091 <li><a href="#setting-up-an-asterix-development-environment-in-eclipse" id="markdown-toc-setting-up-an-asterix-development-environment-in-eclipse">Setting up an Asterix Development environment in Eclipse</a> <ul>
92 <li><a href="#prerequisites" id="markdown-toc-prerequisites">Prerequisites</a></li>
93 <li><a href="#steps" id="markdown-toc-steps">Steps</a></li>
94 </ul>
95 </li>
96 <li><a href="#signing-up-for-gerrit" id="markdown-toc-signing-up-for-gerrit">Signing Up for Gerrit</a></li>
97 <li><a href="#configuring-your-local-working-environment-for-gerrit" id="markdown-toc-configuring-your-local-working-environment-for-gerrit">Configuring your local working environment for Gerrit</a> <ul>
98 <li><a href="#one-time-tasks" id="markdown-toc-one-time-tasks">One-time tasks</a></li>
99 <li><a href="#once-per-repository-tasks" id="markdown-toc-once-per-repository-tasks">Once-per-repository tasks</a></li>
100 </ul>
101 </li>
102 <li><a href="#making-changes---working-method" id="markdown-toc-making-changes---working-method">Making Changes - working method</a></li>
103 <li><a href="#making-more-changes" id="markdown-toc-making-more-changes">Making More Changes</a></li>
104 <li><a href="#using-jenkins-with-gerrit" id="markdown-toc-using-jenkins-with-gerrit">Using Jenkins with Gerrit</a> <ul>
105 <li><a href="#verification" id="markdown-toc-verification">Verification</a></li>
106 <li><a href="#retrigggering-builds-and-triggering-builds-manually" id="markdown-toc-retrigggering-builds-and-triggering-builds-manually">Retrigggering builds and triggering builds manually</a></li>
107 <li><a href="#cross-project-dependencies" id="markdown-toc-cross-project-dependencies">Cross-project Dependencies</a></li>
108 </ul>
109 </li>
110</ul>
111
112<hr />
113
114<h2 id="introduction">Introduction</h2>
115<p>We warmly welcome any contributions to the AsterixDB or related (Hyracks, Pregelix) projects. A great way to start contributing is to pick a bug labelled starter in JIRA and submit a patch for it, to get acquainted with our codebase and development process.</p>
116
117<hr />
118
Ian Maxonacb58492015-10-16 19:12:28 -0700119<h2 id="master-snapshots">Master snapshots</h2>
120<p>If you are a developer simply looking for a snapshot of the latest development version of AsterixDB to test out your application that is based on top of AsterixDB, snapshots from the latest successful push to our master branch are available below. These are non ASF-release, automatic builds.</p>
121
122<h3 id="managix-installer">Managix Installer</h3>
Ian Maxon1bd67772015-11-12 16:14:20 -0800123<p><a class="btn btn-md btn-warning" href="https://asterix-jenkins.ics.uci.edu/job/asterix-test-full/lastStableBuild/org.apache.asterix$asterix-installer/artifact/org.apache.asterix/asterix-installer/0.8.8-SNAPSHOT/asterix-installer-0.8.8-SNAPSHOT-binary-assembly.zip" role="button">Download AsterixDB 0.8.8-SNAPSHOT <i class="fa fa-download fa-lg"></i> </a></p>
Ian Maxonacb58492015-10-16 19:12:28 -0700124
125<h3 id="yarn-installer">YARN Installer</h3>
Ian Maxon1bd67772015-11-12 16:14:20 -0800126<p><a class="btn btn-md btn-warning" href="https://asterix-jenkins.ics.uci.edu/job/asterix-test-full/lastStableBuild/org.apache.asterix$asterix-yarn/artifact/org.apache.asterix/asterix-yarn/0.8.8-SNAPSHOT/asterix-yarn-0.8.8-SNAPSHOT-binary-assembly.zip" role="button">Download AsterixDB 0.8.8-SNAPSHOT <i class="fa fa-download fa-lg"></i> </a></p>
Ian Maxonacb58492015-10-16 19:12:28 -0700127
128<hr />
129
Ian Maxon3dffc852015-07-13 20:17:09 -0700130<h2 id="setting-up-an-asterix-development-environment-in-eclipse">Setting up an Asterix Development environment in Eclipse</h2>
131
132<h3 id="prerequisites">Prerequisites</h3>
133<ul>
134 <li>A suitable *nix environment (Linux, OSX)</li>
Ian Maxon1bd67772015-11-12 16:14:20 -0800135 <li>JDK 1.8+</li>
136 <li>Maven 3.1.1 or greater</li>
Ian Maxon3dffc852015-07-13 20:17:09 -0700137 <li>A relatively recent version of Eclipse</li>
138</ul>
139
140<h3 id="steps">Steps</h3>
141
142<ol>
Ian Maxonf84cb812015-12-07 15:09:45 -0800143 <li>Check out Hyracks and Asterix master in two folders via git in the command line. Assume that the path is <code>$HOME/workspace</code>.</li>
144</ol>
Ian Maxon3dffc852015-07-13 20:17:09 -0700145
Ian Maxonf84cb812015-12-07 15:09:45 -0800146<pre><code> git clone https://github.com/apache/incubator-asterixdb/
147 git clone https://github.com/apache/incubator-asterixdb-hyracks/
148
149You will now have `$HOME/workspace/incubator-asterixdb/` and `$HOME/workspace/incubator-asterixdb-hyracks/`.
Ian Maxon3dffc852015-07-13 20:17:09 -0700150</code></pre>
151
Ian Maxonf84cb812015-12-07 15:09:45 -0800152<ol>
153 <li>Go to the hyracks and install it’s artifacts to the local Maven repository by executing the following commands:</li>
154</ol>
Ian Maxon3dffc852015-07-13 20:17:09 -0700155
Ian Maxonf84cb812015-12-07 15:09:45 -0800156<pre><code> cd incubator-asterixdb-hyracks/
157 mvn install -DskipTests
Ian Maxon3dffc852015-07-13 20:17:09 -0700158</code></pre>
Ian Maxon3dffc852015-07-13 20:17:09 -0700159
Ian Maxonf84cb812015-12-07 15:09:45 -0800160<ol>
161 <li>Go to the asterixdb folder and perform the same action:</li>
162</ol>
163
164<pre><code> cd ../incubator-asterixdb/asterix-maven-plugins/
165 mvn install -DskipTests
166 cd ../
167 mvn install -DskipTests
Ian Maxon3dffc852015-07-13 20:17:09 -0700168</code></pre>
Ian Maxonf84cb812015-12-07 15:09:45 -0800169
170<ol>
Ian Maxon3dffc852015-07-13 20:17:09 -0700171 <li>In Eclipse, import hyracks as an existing Maven Project.
172 <ul>
173 <li><code>File -&gt; Import -&gt; Maven -&gt; Existing Maven Projects -&gt; Next</code></li>
Ian Maxon4baed872015-10-06 19:01:17 -0700174 <li>Specify the Root directory as <code>incubator-asterixdb-hyracks</code> and then click Next until Finish is enabled.</li>
Ian Maxon3dffc852015-07-13 20:17:09 -0700175 <li>If Eclipse tries to install the <code>m2e</code> (Maven To Eclipse) connector, let it do so.</li>
176 <li>There might be some plugin errors; however, that is not a big deal. Wait until the job finishes.</li>
177 <li>Then, click Finish.</li>
178 </ul>
179 </li>
180 <li>Then import asterixdb as an existing Maven Project.
181 <ul>
182 <li><code>File -&gt; Import -&gt; Maven -&gt; Existing Maven Projects -&gt; Next</code></li>
183 <li>Specify root directory as <code>$HOME/workspace/asterixdb</code> and then click Next until Finish is enabled.</li>
184 <li>Eclipse may try installing <code>m2e</code> or other plugins again; let it do so.</li>
185 <li>Then, click Finish.</li>
186 </ul>
187 </li>
188 <li>Fix Eclipse’s build path to include compile-time generated sources.
189 <ul>
190 <li>Right click the project where a red X mark is shown(e.g. <code>asterix-algebra</code>. Then resolve by applying the following:
191 <ul>
192 <li>Right click asterix-algebra. Click Build Path and Configure Build Path. Click Add Folder.</li>
193 <li>Under the <code>target -&gt; generated sources</code>, check the parent folder of the <code>edu</code> folder and click OK.</li>
Ian Maxon4baed872015-10-06 19:01:17 -0700194 <li>For example, if the directory structure is “target - generated-sources - javacc - org - apache …”, check the javacc directory and click OK. Then X mark will dissapear.</li>
Ian Maxon3dffc852015-07-13 20:17:09 -0700195 </ul>
196 </li>
197 <li>Repeat this step to all projects which show a red X mark except “asterix-fuzzyjoin” and “asterix-transactions”.</li>
198 <li>It may be the case that only “asterix-algebra” and “asterix-runtime” will require these steps.</li>
199 </ul>
200 </li>
201 <li>Set up Eclipse code formatting rules
202 <ul>
203 <li>Download files <a href="http://wiki.asterixdb.googlecode.com/git/AsterixCodeFormatProfile.xml">AsterixCodeFormatProfile.xml</a> <a href="http://wiki.asterixdb.googlecode.com/git/AsterixCleanupFormatProfile.xml">AsterixCleanupFormatProfile.xml</a></li>
204 <li>Import profiles into Eclipse
205 <ul>
206 <li>Preferences -&gt; Java -&gt; Code style -&gt; Formatter -&gt; Import -&gt; Select AsterixCodeFormatProfile.xml</li>
207 <li>Preferences -&gt; Java -&gt; Code style -&gt; Clean up -&gt; Import -&gt; Select AsterixCleanupFormatProfile.xml</li>
208 <li>Preferences -&gt; Java -&gt; Editor -&gt; Save actions -&gt; Perform the selected action on save -&gt; Format source code</li>
209 </ul>
210 </li>
211 </ul>
212 </li>
213</ol>
214
215<hr />
216
217<h2 id="signing-up-for-gerrit">Signing Up for Gerrit</h2>
218
Ian Maxon4baed872015-10-06 19:01:17 -0700219<p>First, to contribute patches to AsterixDB, you should have an ICLA on file with the Apache Software Foundation.
220For details see the ASF website <a href="https://www.apache.org/dev/new-committers-guide.html#cla">here</a>
221You should only need to perform the following steps once.</p>
Ian Maxon3dffc852015-07-13 20:17:09 -0700222
223<p>Our Gerrit server is <a href="https://asterix-gerrit.ics.uci.edu/">here</a></p>
224
225<ol>
226 <li>Visit the above URL, and click on “Register” in the upper right.</li>
227 <li>Gerrit uses OpenID; you may create an account using any OpenID provider, or with a Yahoo! account.</li>
228 <li>Click on “Sign in with a Yahoo! ID”. You will be taken to a page to log in to Yahoo!.</li>
229 <li>From there, you will get a page asking you to allow asterix-gerrit.ics.uci.edu to access your email and basic information. Approve this request.</li>
230 <li>You will be directed back to Gerrit to complete the account signup. Make sure to fill out this page! It is necessary to allow you to push code changes to Gerrit for review.</li>
231 <li>For “Full Name” and “Preferred Email”, enter what you like. If you would like to register a different email address such as an @uci.edu address, you may do so. This is where Gerrit will send you notifications about code review requests, voting, and so on.</li>
232 <li>For “Select a unique username”, choose a short alphanumeric ID. This will be your ssh username for git access. Be sure to click “Select Username” to verify that the name is unique and allowed.</li>
233 <li>Also provide a ssh public key here. There is information on the page on creating one if you do not have one. Click “Add” when done.
234 * Note that you can create a new ssh public key just for Gerrit if you like; if you do so you will need to modify your .ssh/config file to ensure the right key is selected.</li>
235 <li>Click “Continue” at the bottom of the page.</li>
236 <li>
237 <p>Finally, verify that you have everything set up: From a command-line, type
238<code>
239ssh -p 29418 username@asterix-gerrit.ics.uci.edu
240</code></p>
241 </li>
242 <li>You should see</li>
243</ol>
244
245<pre><code> **** Welcome to Gerrit Code Review ****
246
247 Hi Full Name, you have successfully connected over SSH.
248
249 Unfortunately, interactive shells are disabled.
250 To clone a hosted Git repository, use:
251
252 git clone ssh://username@asterix-gerrit.ics.uci.edu:29418/REPOSITORY_NAME.git
253
254</code></pre>
255
256<p>At this point, please send an email to Chris or Ian, specifying the email address of your new account, and ask to be added to the “AsterixDB Devs” group. You may push change proposals to Gerrit, and vote +1/-1 Code Review on any proposals without being in AsterixDB Devs, but you cannot vote +2 on anything to allow a change to be merged.</p>
257
258<hr />
259
260<h2 id="configuring-your-local-working-environment-for-gerrit">Configuring your local working environment for Gerrit</h2>
261
262<h3 id="one-time-tasks">One-time tasks</h3>
263
264<ol>
265 <li>At the command-line, run the following. Replace “username” with the user name you chose in step 7 above.
266<code>
267git config --global gerrit.url ssh://username@asterix-gerrit.ics.uci.edu:29418/
268</code></li>
269 <li>Download my “git-gerrit” utility library:
270<code>
271git clone https://github.com/ceejatec/git-gerrit
272</code></li>
273 <li>Ensure that the <code>git-gerrit/git-gerrit</code> script is on your PATH. You could copy it to somewhere, but it would be best to leave it inside the github clone so you can easily get updates.</li>
274</ol>
275
276<h3 id="once-per-repository-tasks">Once-per-repository tasks</h3>
277
278<ol>
Ian Maxonf84cb812015-12-07 15:09:45 -0800279 <li>To work on (say) Asterix, first clone the Google Code repository (if you already have a local clone, great!).</li>
Ian Maxon3dffc852015-07-13 20:17:09 -0700280</ol>
281
Ian Maxonf84cb812015-12-07 15:09:45 -0800282<pre><code> git clone https://github.com/apache/incubator-asterixdb
283</code></pre>
284
285<ol>
286 <li><code>cd</code> into the clone repo directory, and then run the following command to create the “gerrit” remote.</li>
287</ol>
288
289<pre><code> git gerrit init
290</code></pre>
291
Ian Maxon3dffc852015-07-13 20:17:09 -0700292<hr />
293
294<h2 id="making-changes---working-method">Making Changes - working method</h2>
295
296<ol>
Ian Maxonf84cb812015-12-07 15:09:45 -0800297 <li>When you want to start working on a bug, feature, etc, first make a local <code>git</code> branch. Never work directly on <code>master</code>! <code>master</code> should always be a pure mirror of <code>origin/master</code>, ie, Google Code.</li>
298</ol>
Ian Maxon3dffc852015-07-13 20:17:09 -0700299
Ian Maxonf84cb812015-12-07 15:09:45 -0800300<pre><code> git checkout -b my_branch
Ian Maxon3dffc852015-07-13 20:17:09 -0700301</code></pre>
Ian Maxonf84cb812015-12-07 15:09:45 -0800302
303<ol>
Ian Maxon3dffc852015-07-13 20:17:09 -0700304 <li>Make your changes, test them, etc. Feel free to <code>git commit</code> as often as you like.</li>
Ian Maxonf84cb812015-12-07 15:09:45 -0800305 <li><strong>Optional</strong>: If you like, you can push your branch up to Google Code, either to share it with others or as a backup. You may do this at whatever point in time you like.</li>
306</ol>
Ian Maxon3dffc852015-07-13 20:17:09 -0700307
Ian Maxonf84cb812015-12-07 15:09:45 -0800308<pre><code> git push origin my_branch
Ian Maxon3dffc852015-07-13 20:17:09 -0700309</code></pre>
Ian Maxon3dffc852015-07-13 20:17:09 -0700310
Ian Maxonf84cb812015-12-07 15:09:45 -0800311<ol>
312 <li>Every so often, you should update your local <code>master</code> mirror, and then merge that onto your working branch. This will prevent your branch from falling too far out of date, and ensure that your code review proposals will merge successfully with <code>master</code>. There are a number of ways to do this, but <code>git-gerrit</code> provides a convenience function:</li>
313</ol>
Ian Maxon3dffc852015-07-13 20:17:09 -0700314
Ian Maxonf84cb812015-12-07 15:09:45 -0800315<pre><code> git gerrit update
Ian Maxon3dffc852015-07-13 20:17:09 -0700316</code></pre>
Ian Maxonf84cb812015-12-07 15:09:45 -0800317
318<ol>
319 <li>When you are ready to submit changes for code review, first ensure that you have committed everything locally that is necessary (<code>git status</code> should report “nothing to commit, working directory clean”). This is also a good time to update (see step 4). Then run:</li>
320</ol>
321
322<pre><code> git gerrit submit
323</code></pre>
324
325<ol>
Ian Maxon3dffc852015-07-13 20:17:09 -0700326 <li>This will pop open your editor to invite you to create a good commit message. This will be the single commit message which will be the only one to appear in the project’s master git history. Take the time to make it clear. The editor will contain the log messages of everything you committed on your branch as a reminder, but generally you will want to delete all this and replace it with a comprehensive message. Also: As noted in the initial message, the last line of the buffer will contain a <code>Change-Id</code> field. Do not delete that line! It is used by Gerrit to identify this particular merge proposal.</li>
Ian Maxonf84cb812015-12-07 15:09:45 -0800327 <li>When you save your commit message, git-gerrit will push all of the changes from your working branch up to Gerrit. Assuming no errors, you should see output similar to the following:</li>
328</ol>
Ian Maxon3dffc852015-07-13 20:17:09 -0700329
Ian Maxonf84cb812015-12-07 15:09:45 -0800330<pre><code> remote: Resolving deltas: 100% (1/1)
331 remote: Processing changes: new: 1, refs: 1, done
332 remote:
333 remote: New Changes:
334 remote: http://fulliautomatix.ics.uci.edu:8443/30
335 remote:
336 To ssh://ceej@fulliautomatix.ics.uci.edu:29418/ceej-gerrit-test
337 * [new branch] HEAD -&gt; refs/for/master
Ian Maxon3dffc852015-07-13 20:17:09 -0700338</code></pre>
Ian Maxonf84cb812015-12-07 15:09:45 -0800339
340<ol>
Ian Maxon3dffc852015-07-13 20:17:09 -0700341 <li>That URL under “New Changes” is your code review! Send it to others to request reviews.</li>
342 <li>If you get any negative code reviews and need to make changes, you can just repeat steps 2 - 6 of the working method. Your local branch will still have all the history you put there, if you need to revert changes or look back and see what you did, etc.</li>
343 <li>When you repeat step 6, you will notice two things: First, git-gerrit keeps the change message for you, including the Change-Id, so you don’t have to re-invent it every time. Second, the output from <code>git gerrit submit</code> will not include the URL of the review this time. I’m not sure why; I wish it did. But if you re-visit the old URL in your browser, you should see an additional “Patch Set” containing your revised changes for people to review.</li>
344</ol>
345
346<h2 id="making-more-changes">Making More Changes</h2>
347
348<p>You may have as many feature branches as you want locally, and each may be at any point in the review cycle.</p>
349
350<p>Once you are done with a change (that is, it has been Code Reviewed and approved in Gerrit and merged), it is probably best to start work on the next big thing on a new branch. However, git-gerrit attempts to be smart if you choose to re-use a branch. For example, it should notice if the “current” Change-Id for a branch has been merged to master, and it will create a new Change-Id and a new fresh commit message the next time you run <code>git gerrit submit</code>.</p>
351
352<p>In that case, you may notice that the list of changes on the branch still contains older commits which have been merged. That is due to the unfortunate way Gerrit works; it requires squashing to a single git commit for review, which loses the association with the original commits in your history.</p>
353
354<p>It is also possible that you may want to re-use a branch and git-gerrit fails to notice that the older change has been merged - or perhaps the change was Abandoned on Gerrit and not merged, and you want to continue working on the same branch to create a new proposal. In this case, run
355<code>
356git gerrit new
357</code>
358on your branch. This will force git-gerrit to create a new Change-Id and commit message the next time you run <code>git gerrit submit</code>.</p>
359
360<hr />
361
362<h2 id="using-jenkins-with-gerrit">Using Jenkins with Gerrit</h2>
363
364<h3 id="verification">Verification</h3>
365
366<p>As of right now, whenever a patch set is submitted to Gerrit (i.e. whenever a user performs ‘git gerrit submit’) are automatically picked up by Jenkins, which runs <code>mvn verify</code> to test the patch fully. Once the build finishes, Jenkins comments on the patchset and votes with the result (+1 for all tests passing, -1 for anything less). Ideally, and in most cases, verifocation of a patchset reqires no intervention. However there are a few exceptions to this as detailed below.</p>
367
368<h3 id="retrigggering-builds-and-triggering-builds-manually">Retrigggering builds and triggering builds manually</h3>
369
370<h4 id="retriggering">Retriggering</h4>
371<p>Occasionally, there are builds in which tests failed, but perhaps not for a reason that has anything to do with the proposed patch’s changes. For example, on occasion the Integration tests can have issues with ports on the build server already being bound. The simple work around to this is to try building again.</p>
372
373<p>One way to perform this is by simply visiting the link that is posted on Gerrit by Jenkins, and hitting the ‘Retrigger’ link on the left-hand side of the page. This will try retesting the build with the exact same parameters as last time, hopefully with a different result.</p>
374
375<h4 id="manual-trigger">Manual Trigger</h4>
376<p>Builds of Gerrit patches can also be fully manually triggered from Jenkins. This can be desirable if a change is now dependent on a Hyracks change (via the Topic field feature described below), or if the patch is a draft or is not triggered automatically for any other reason. To manually trigger a build of a patchset, visit the Jenkins front-page, and click the ‘Query and Trigger Gerrit patches’ link. This should link to a page allowing you to manually trigger Gerrit patches. In the search field any query that can be searched in the Gerrit web interface can be used, but the default query of all open patchsets is likely fine. Hit the ‘Search’ button, and then click the checkbox that represents the patch that needs to be built. Then simply click ‘Trigger Selected’ and the patch will start building.</p>
377
378<h3 id="cross-project-dependencies">Cross-project Dependencies</h3>
379
380<p>It is sometimes the case that a change in one related project alters interfaces or expected results that an upstream project relies on. The converse can be true as well, such as an AsterixDB change that needs a Hyracks feature. In these sorts of situations, there is a mechanism to describe to Jenkins this dependenc of one project’s patchset to a particular Hyracks Change, by using the ‘Topic’ field in Gerrit. To utilize
381this feature, perform the following steps:</p>
382
383<ol>
384 <li>First submit the Hyracks change which the upstream (AsterixDB,etc..) change depends on if you have not done so already</li>
385 <li>In the Hyracks change details on the Gerrit web interface, take note of the refspec in the <em>Download</em> field of the patchset details. It will look something like <code>refs/changes/07/207/1</code>. This is what uniquely identifies the Hyracks change in Gerrit.</li>
386 <li>Submit the dependent change now, if you have not done so already. In the Gerrit web interface, view the change’s details. In the upper left-hand corner, there will be an empty field in a table, labeled <code>Topic</code>, with a notepad icon right-justified in the second column of the table. Click the notepad Icon, and in the resulting dialog box, enter in the refspec (<code>refs/changes/07/207/1</code>) as the Topic value.</li>
387 <li>Now, manually trigger the dependent change in Jenkins (see previous section for details)</li>
388</ol>
389
390<hr />
391
392</div>
393</div>
394
395
396 <hr />
397
398 <footer>
399 <div class="row">
400 <div class="col-md-6 col-md-offset-3 text-center">
401 <p>&copy; Copyright 2015 The Apache Software foundation. All Rights Reserved. </p>
402 <p>Apache AsterixDB, Apache, and the Apache feather logo are trademarks of the Apache Software Foundation</p>
403 </div>
404 <div class="col-md-1 text-right">
Ian Maxonf84cb812015-12-07 15:09:45 -0800405 <img src="img/egg-logo.png" style="height:auto; width:200px; vertical-align:bottom;"/>
Ian Maxon3dffc852015-07-13 20:17:09 -0700406 </div>
407 </div>
408 </footer>
409 </div> <!-- /container -->
410
411
412 <!-- Bootstrap core JavaScript
413 ================================================== -->
414 <!-- Placed at the end of the document so the pages load faster -->
415 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
Ian Maxonf84cb812015-12-07 15:09:45 -0800416 <script src="js/bootstrap.min.js"></script>
Ian Maxon3dffc852015-07-13 20:17:09 -0700417 </body>
418</html>