blob: 3f7b71a3d2922e4fa1c8e3e6fa6283bd7ce034d4 [file] [log] [blame]
<!DOCTYPE html>
<html xmlns="" xml:lang="en" lang="en">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="en-us" http-equiv="Content-Language" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/static/images/favicon.ico" rel="shortcut icon" />
<link href="/static/css/style.css" rel="stylesheet" type="text/css" />
<link href="/static/css/codehilite.css" rel="stylesheet" type="text/css" />
<link href="/static/css/bootstrap.css" media="screen, projection" rel="stylesheet" type="text/css" />
<link href="/static/css/thrift.css" media="screen, projection" rel="stylesheet" type="text/css" />
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/bootstrap-dropdown.js"></script>
<script src="/static/js/bootstrap-tab.js"></script>
<script src="/static/js/thrift.js"></script>
<title>Apache Thrift - How To Contribute</title>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="/">Apache Thrift &trade;</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li><a href="/download">Download</a></li>
<li><a href="/docs">Documentation</a></li>
<li><a href="/developers">Developers</a></li>
<li><a href="/lib">Libraries</a></li>
<li><a href="/tutorial">Tutorial</a></li>
<li><a href="/test">Test Suite</a></li>
<li><a href="/about">About</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="" target="_blank">Apache Home</a></li>
<li><a href="" target="_blank">Apache License v2.0</a></li>
<li><a href="" target="_blank">Donate</a></li>
<li><a href="" target="_blank">Thanks</a></li>
<li><a href="" target="_blank">Security</a></li>
<div class="container">
<h1 id="how-to-contribute">How to Contribute</h1>
<p>Thank you for your interest in contributing to the Apache Thrift project! Information on why and how to contribute is available on the Apache Software Foundation (ASF) web site. In particular, we recommend the following to become acquainted with Apache Contributions:</p>
<li><a href="">Contributors Tech Guide</a></li>
<li><a href="">Get involved!</a></li>
<li><a href="">Legal aspects on Submission of Contributions (Patches)</a></li>
<h2 id="github-pull-requests">GitHub pull requests</h2>
<p>This is the preferred method of submitting changes. When you submit a pull request through github,
it activates the continuous integration (CI) build systems at Appveyor and Travis to build your changesxi
on a variety of Linux and Windows configurations and run all the test suites. Follow these requirements
for a successful pull request:</p>
<p>All significant changes require an <a href="">Apache Jira THRIFT Issue</a> ticket. Trivial changes such as fixing a typo or a compiler warning do not.</p>
<li>All pull requests should contain a single commit per issue, or we will ask you to squash it.</li>
<p>The pull request title must begin with the Jira THRIFT ticket identifier if it has an associated ticket, for example:</p>
<pre><code>THRIFT-9999: an example pull request title
<p>Commit messages must follow this pattern for code changes (deviations will not be merged):</p>
<pre><code>THRIFT-9999: [summary of fix, one line if possible]
Client: [language(s) affected, comma separated, for example: "cpp,erl,perl"]
<li>Create a fork in your GitHub account of</li>
<li>Clone the fork to your development system.</li>
<li>Create a branch for your changes (best practice is issue as branch name, e.g. THRIFT-9999).</li>
<p>Modify the source to include the improvement/bugfix, and:</p>
<li>Remember to provide <em>tests</em> for all submitted changes!</li>
<li>Use test-driven development (TDD): add a test that will isolate the bug <em>before</em> applying the change that fixes it.</li>
<li>Verify that you follow <a href="/docs/coding_standards">Thrift Coding Standards</a> (you can run &#8216;make style&#8217;, which ensures proper format for some languages).</li>
<li>[<em>optional</em>] Verify that your change works on other platforms by adding a GitHub service hook to <a href="">Travis CI</a> and <a href="">AppVeyor</a>. You can use this technique to run the Thrift CI jobs in your account to check your changes before they are made public. Every GitHub pull request into Thrift will run the full CI build and test suite on your changes.</li>
<li>Squash your changes to a single commit. This maintains clean change history.</li>
<li>Commit and push changes to your branch (please use issue name and description as commit title, e.g. &#8220;THRIFT-9999: make it perfect&#8221;), with the affected languages on the next line of the description.</li>
<li>Use GitHub to create a pull request going from your branch to apache:master. Ensure that the Jira ticket number is at the beginning of the title of your pull request, same as the commit title.</li>
<li>Wait for other contributors or committers to review your new addition, and for a CI build to complete.</li>
<li>Wait for a committer to commit your patch. You can nudge the committers if necessary by sending a message to the <a href="">Apache Thrift mailing list</a>.</li>
<h2 id="if-you-want-to-build-the-project-locally">If you want to build the project locally</h2>
<p>For Windows systems, see our detailed instructions on the <a href="/build/cmake/">CMake README</a>.</p>
<p>For Windows Native C++ builds, see our detailed instructions on the <a href="/build/wincpp/">WinCPP README</a>.</p>
<p>For unix systems, see our detailed instructions on the <a href="/build/docker/">Docker README</a>.</p>
<h2 id="if-you-want-to-review-open-issues">If you want to review open issues&#8230;</h2>
<li>Review the <a href="">GitHub Pull Request Backlog</a>. Code reviews are open to all.</li>
<li>Review the <a href="">Jira issue tracker</a>. You can search for tickets relating to languages you are interested in or currently using with thrift, for example a Jira search (Issues -&gt; Search For Issues) query of <code>project = THRIFT AND component in ("Erlang - Library") and status not in (resolved, closed)</code> will locate all the open Erlang Library issues.</li>
<h2 id="if-you-discovered-a-defect">If you discovered a defect&#8230;</h2>
<li>Check to see if the issue is already in the <a href="">Jira issue tracker</a>.</li>
<li>If not, create a ticket describing the change you&#8217;re proposing in the Jira issue tracker.</li>
<li>Contribute your code changes using the GitHub pull request method:</li>
<h2 id="contributing-via-patch">Contributing via Patch</h2>
<p>To create a patch from changes in your local directory:</p>
<pre><code>git diff &gt; ../THRIFT-NNNN.patch
<p>then wait for contributors or committers to review your changes, and then for a committer to apply your patch. This is not the preferred way to submit changes and incurs additional overhead for committers who must then create a pull request for you.</p>
<h2 id="github-recipes-for-pull-requests">GitHub recipes for Pull Requests</h2>
<p>Sometimes commmitters may ask you to take actions in your pull requests. Here are some recipes that will help you accomplish those requests. These examples assume you are working on Jira issue THRIFT-9999. You should also be familiar with the <a href="">upstream</a> repository concept.</p>
<h3 id="squash-your-changes">Squash your changes</h3>
<p>If you have not submitted a pull request yet, or if you have not yet rebased your existing pull request, you can squash all your commits down to a single commit. This makes life easier for the committers. If your pull request on GitHub has more than one commit, you should do this.</p>
<li>Use the command <code>git log</code> to identify how many commits you made since you began.</li>
<li>Use the command <code>git rebase -i HEAD~N</code> where N is the number of commits.</li>
<li>Leave &#8220;pull&#8221; in the first line.</li>
<li>Change all other lines from &#8220;pull&#8221; to &#8220;fixup&#8221;.</li>
<li>All your changes are now in a single commit.</li>
<p>If you already have a pull request outstanding, you will need to do a &#8220;force push&#8221; to overwrite it since you changed your commit history:</p>
<pre><code>git push -u origin THRIFT-9999 --force
<p>A more detailed walkthrough of a squash can be found at <a href="">Git Ready</a>.</p>
<h3 id="rebase-your-pull-request">Rebase your pull request</h3>
<p>If your pull request has a conflict with master, it needs to be rebased:</p>
<pre><code>git checkout THRIFT-9999
git rebase upstream master
(resolve any conflicts, make sure it builds)
git push -u origin THRIFT-9999 --force
<h3 id="fix-a-bad-merge">Fix a bad merge</h3>
<p>If your pull request contains commits that are not yours, then you should use the following technique to fix the bad merge in your branch:</p>
<pre><code>git checkout master
git pull upstream master
git checkout -b THRIFT-9999-take-2
git cherry-pick ...
(pick only your commits from your original pull request in ascending chronological order)
squash your changes to a single commit if there is more than one (see above)
git push -u origin THRIFT-9999-take-2:THRIFT-9999
<p>This procedure will apply only your commits in order to the current master, then you will squash them to a single commit, and then you force push your local THRIFT-9999-take-2 into remote THRIFT-9999 which represents your pull request, replacing all the commits with the new one.</p>
<p class="snippet_footer">This page was generated by Apache Thrift's <strong>source tree docs</strong>:
<a href=";a=blob;hb=HEAD;"></a>
<div class="container">
<footer class="footer">
<div class="row">
<div class="span3">
<ul class="unstyled">
<li><a href="/download">Download</a></li>
<li><a href="/developers">Developers</a></li>
<li><a href="/tutorial">Tutorials</a></li>
<ul class="unstyled">
<li><a href="/sitemap">Sitemap</a></li>
<div class="span3">
<h3>Get Involved</h3>
<ul class="unstyled">
<li><a href="/mailing">Mailing Lists</a></li>
<li><a href="">Issue Tracking</a></li>
<li><a href="/docs/HowToContribute">How To Contribute</a></li>
<div class="span6">
<a href=""><img src="/static/images/feather.svg" onerror="this.src='/static/images/feather.png';this.onerror=null;" /></a>
Copyright &copy; 2023 <a href="">Apache Software Foundation</a>.
Licensed under the <a href="">Apache License v2.0</a>.
Apache, Apache Thrift, and the Apache feather logo are trademarks of The Apache Software Foundation.