blob: 2ecc318f0bbb29df6a31543d59cbdf0d89b6567c [file] [log] [blame]
<!doctype html>
<!--
Minimal Mistakes Jekyll Theme 4.4.1 by Michael Rose
Copyright 2017 Michael Rose - mademistakes.com | @mmistakes
Free for personal and commercial use under the MIT license
https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt
-->
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<!-- begin SEO -->
<title>Howto Submit Code - Apache ServiceComb</title>
<meta name="description" content="Howto submit code for SerivceComb">
<meta name="author" content="">
<meta property="og:locale" content="en">
<meta property="og:site_name" content="Apache ServiceComb">
<meta property="og:title" content="Howto Submit Code">
<link rel="canonical" href="https://github.com/pages/apache/incubator-servicecomb-website/developers/submit-codes/">
<meta property="og:url" content="https://github.com/pages/apache/incubator-servicecomb-website/developers/submit-codes/">
<meta property="og:description" content="Howto submit code for SerivceComb">
<meta name="twitter:site" content="@ServiceComb">
<meta name="twitter:title" content="Howto Submit Code">
<meta name="twitter:description" content="Howto submit code for SerivceComb">
<meta name="twitter:url" content="">
<meta name="twitter:card" content="summary">
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Person",
"name" : "Apache ServiceComb",
"url" : "https://github.com/pages/apache/incubator-servicecomb-website",
"sameAs" : null
}
</script>
<meta name="google-site-verification" content="HvJjNd7vvJ-yjSTHlBiIWEYxp_Hrz-PYEY5Idz9LRcA" />
<!-- end SEO -->
<link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Apache ServiceComb Feed">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script>
<script src="/assets/vendor/prism/prism.js"></script>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
<!-- For all browsers -->
<link rel="stylesheet" href="/assets/css/main.css?v=1">
<link rel="stylesheet" href="/assets/vendor/prism/prism.css?v=1">
<!--[if lte IE 9]>
<style>
/* old IE unsupported flexbox fixes */
.greedy-nav .site-title {
padding-right: 3em;
}
.greedy-nav button {
position: absolute;
top: 0;
right: 0;
height: 100%;
}
</style>
<![endif]-->
<meta http-equiv="cleartype" content="on">
<!-- start custom head snippets -->
<!-- insert favicons. use http://realfavicongenerator.net/ -->
<link href="https://fonts.cat.net/css?family=Roboto:400,500,700|Source+Code+Pro" rel="stylesheet">
<script src="/assets/js/custom.js"></script>
<!-- end custom head snippets -->
</head>
<body class="layout--single">
<!--[if lt IE 9]>
<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div>
<![endif]-->
<div class="masthead" onmouseleave="$('#childrenShow').css('display', 'none')">
<div class="masthead__inner-wrap">
<div class="masthead__menu">
<nav id="site-nav" class="greedy-nav">
<a class="site-title active" href="/"><img src="https://www.apache.org/img/servicecomb.png"></a>
<ul class="visible-links">
<li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')">
<a href="/">Home</a>
</li>
<li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')">
<a href="/developers/">Projects</a>
</li>
<li class="def-nav-li" onmouseenter="$('#childrenShow').css('display', 'block')">
<a href="/docs/users/">Documentation</a>
<ul id="childrenShow" class="def-children-show-en" onmouseleave="$('#childrenShow').css('display', 'none')">
<li><a href="/docs/getting-started/" class="">Getting started</a></li>
<li><a href="/docs/users/" class="">Docs</a></li>
<li><a href="/slides/" class="">Video</a></li>
<li><a href="/faqs/" class="">FAQ</a></li>
</ul>
</li>
<li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')">
<a class="active" href="/developers/contributing">Community</a>
</li>
<li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')">
<a href="/year-archive/">Blogs</a>
</li>
<li class="masthead__menu-item" onmouseenter="$('#childrenShow').css('display', 'none')">
<a href="/release/">Downloads</a>
</li>
</ul>
<button><div class="navicon"></div></button>
<ul class="hidden-links hidden"></ul>
<div class="nav-lang">
<a href=/cn/developers/submit-codes/>中文</a>
</div>
</nav>
</div>
</div>
</div>
<div id="main" role="main">
<div class="sidebar sticky">
<div class="back-to-home"><a href="/">Home</a> > Howto Submit Code</div>
<nav class="nav__list">
<input id="ac-toc" name="accordion-toc" type="checkbox" />
<label for="ac-toc">Toggle Menu</label>
<ul class="nav__items">
<li>
<a href="/developers/"><span class="nav__sub-title nav__sub-title-with-url">Projects</span></a>
</li>
<li>
<a href="/developers/team/"><span class="nav__sub-title nav__sub-title-with-url">Team</span></a>
</li>
<li>
<a href="/developers/contributing"><span class="nav__sub-title nav__sub-title-with-url">Contributing to Apache ServiceComb</span></a>
</li>
<li>
<a href="/developers/becomming-a-commiter"><span class="nav__sub-title nav__sub-title-with-url">Becoming A Committer of Apache ServiceComb</span></a>
</li>
<li>
<a href="/developers/setup-develop-environment/"><span class="nav__sub-title nav__sub-title-with-url">Develop Environment Setup</span></a>
</li>
<li>
<a href="/developers/submit-codes/"><span class="nav__sub-title nav__sub-title-with-url">Code Submit Guide</span></a>
</li>
<li>
<a href="/developers/use-jira/"><span class="nav__sub-title nav__sub-title-with-url">How to Use JIRA</span></a>
</li>
<li>
<a href="/developers/setup-committer-rights/"><span class="nav__sub-title nav__sub-title-with-url">Set Up Write Access for Committer</span></a>
</li>
<li>
<a href="/developers/release-guide/"><span class="nav__sub-title nav__sub-title-with-url">How to Release in Apache</span></a>
</li>
<li>
<a href="/developers/release-validation-guide/"><span class="nav__sub-title nav__sub-title-with-url">How to verify Apache Release</span></a>
</li>
<li>
<a href="/developers/sonarcloud-how-to/"><span class="nav__sub-title nav__sub-title-with-url">How to Use SonarCloud</span></a>
</li>
</ul>
</nav>
</div>
<article class="page" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="headline" content="Howto Submit Code">
<meta itemprop="description" content="Howto submit code for SerivceComb">
<meta itemprop="dateModified" content="September 08, 2017">
<div class="page__inner-wrap">
<header>
<h1 class="page__title" itemprop="headline">Howto Submit Code
</h1>
</header>
<section class="page__content" itemprop="text">
<aside class="sidebar__right">
<nav class="toc">
<!-- <header><h4 class="nav__title"><i class="fa fa-file-text"></i> On This Page</h4></header> -->
<ul class="toc__menu" id="markdown-toc">
<li><a href="#contributing" id="markdown-toc-contributing">Contributing</a></li>
<li><a href="#run-tests" id="markdown-toc-run-tests">Run tests</a></li>
<li><a href="#how-to-submit-a-pr" id="markdown-toc-how-to-submit-a-pr">How to submit a PR</a> <ul>
<li><a href="#fork-repository" id="markdown-toc-fork-repository">Fork repository</a></li>
<li><a href="#setup-local-repository" id="markdown-toc-setup-local-repository">Setup local repository</a></li>
<li><a href="#create-pr" id="markdown-toc-create-pr">Create PR</a></li>
<li><a href="#resolve-conflicts" id="markdown-toc-resolve-conflicts">Resolve conflicts</a></li>
</ul>
</li>
</ul>
</nav>
</aside>
<h2 id="contributing">Contributing</h2>
<p>ServiceComb is still growing and we hope that more will join us to share this. There are many ways to contribute:</p>
<ul>
<li>Improve documents. Help us improve the documents on this site or the API documentation. For the documents on this site, you can find links <strong>Report a Doc Issue</strong> or <strong>Edit This Page on Github</strong> to start.</li>
<li>
<p>Implement feature request or fix bugs. You can find all the feature request and bug reports on the projects’ issues pages. Take <a href="https://github.com/apache/servicecomb-saga/issues">Saga</a> as an example, issues will be labeled as <strong>enhancement</strong> or <strong>bug</strong>, you can choose the ones you are interested in. Bug reports and new feature requests are also welcomed.</p>
<p><img src="/assets/images/find-features-by-example.png" alt="Find Features" class="align-center" /></p>
</li>
</ul>
<h2 id="run-tests">Run tests</h2>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Before submitting code, make sure that you have properly tested the functionality and verified the implementation according to the auto test section in README.
</code></pre></div></div>
<h2 id="how-to-submit-a-pr">How to submit a PR</h2>
<p>  It’s quite convenient to submit a <a href="https://help.github.com/articles/about-pull-requests/">Pull Request(PR)</a> on <a href="https://github.com/search?q=org%3Aapache+servicecomb">Github</a>. Take the <a href="https://github.com/apache/servicecomb-website">apache/servicecomb-website</a> as an example:</p>
<h3 id="fork-repository">Fork repository</h3>
<p>  Visit the apache/servicecomb-website project’s <a href="https://github.com/apache/servicecomb-website">github page</a>, click <code class="highlighter-rouge">Fork</code> button on the right left cornor.</p>
<p><img src="/assets/images/fork-repo.jpg" alt="Fork Repository" class="align-center" /></p>
<h3 id="setup-local-repository">Setup local repository</h3>
<ul>
<li>
<p>Clone the source code to local machine:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/&lt;your_github_name&gt;/servicecomb-website.git
</code></pre></div> </div>
<p>Note: substitute &lt;your_github_name&gt; with your github username.</p>
<p>After the clone is done, the origin remote will point to the default branch of the cloned repository.</p>
</li>
<li>
<p>Add apache/servicecomb-website as upstream remote:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd </span>servicecomb-website
git remote add upstream https://github.com/apache/servicecomb-website.git
</code></pre></div> </div>
</li>
<li>
<p>Check the local repository’s remotes</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git remote <span class="nt">-v</span>
origin https://github.com/&lt;your_github_name&gt;/servicecomb-website.git <span class="o">(</span>fetch<span class="o">)</span>
origin https://github.com/&lt;your_github_name&gt;/servicecomb-website.git <span class="o">(</span>push<span class="o">)</span>
upstream https://github.com/apache/servicecomb-website.git <span class="o">(</span>fetch<span class="o">)</span>
upstream https://github.com/apache/servicecomb-website.git <span class="o">(</span>push<span class="o">)</span>
</code></pre></div> </div>
</li>
<li>
<p>Create a new branch to start working</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git checkout <span class="nt">-b</span> &lt;your_branch_name&gt;
</code></pre></div> </div>
<p>Note: replace &lt;your_branch_name&gt; with an actual branch name at your choice, like feature-foo/bugfix-bar
Now you can start coding.</p>
</li>
<li>
<p>Push the changes to a remote repository</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git commit <span class="nt">-a</span> <span class="nt">-m</span> <span class="s2">"&lt;you_commit_message&gt;"</span>
git push origin &lt;your_branch_name&gt;
</code></pre></div> </div>
</li>
</ul>
<p> For more on git usages, please visit<a href="https://www.atlassian.com/git/tutorials/setting-up-a-repository">Git tutorial</a>.</p>
<h3 id="create-pr">Create PR</h3>
<p>Goto your github page, find the apache/servicecomb-website project, swich to the branch you just pushed, click on <code class="highlighter-rouge">New pull request</code> and then <code class="highlighter-rouge">Create pull request</code>, see the image below:</p>
<p class="figure-caption"><img src="/assets/images/new-pr.jpg" alt="New Pull Request" class="align-center" />
fig-1 New pull request</p>
<p class="figure-caption"><img src="/assets/images/create-pr.jpg" alt="Create Pull Request" class="align-center" />
fig-2 Create pull request</p>
<p>Congrautulations, now you have succesfully submitted a PR. For more on PR, please read <a href="https://help.github.com/categories/collaborating-with-issues-and-pull-requests/">collaborating-with-issues-and-pull-requests</a></p>
<h3 id="resolve-conflicts">Resolve conflicts</h3>
<p>When a same piece of file is edited by multiple person simultaneously, conflicts can occur. It can be resolved as follow:</p>
<ol>
<li>Switch to the master branch
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git checkout master
</code></pre></div> </div>
</li>
<li>Pull the upstream’s master branch
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git pull upstream master
</code></pre></div> </div>
</li>
<li>Switch back to the branch we are working on(e.g. fix)
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git checkout fix
</code></pre></div> </div>
</li>
<li>Rebase the working branch onto the master branch
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git rebase <span class="nt">-i</span> master
</code></pre></div> </div>
<p>A list of commits will be listed on your text editor. Normally we can just save and exit.
Git will now apply the commits one by one onto the master branch until it encounters a conflict. When this happens, the rebase process is paused. We need to resolve the conflicts, then execute</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git add <span class="nb">.</span>
git rebase <span class="nt">--continue</span>
</code></pre></div> </div>
<p>Repeat this process until all commits are successfully applied. And finally run</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git push <span class="nt">-f</span> origin fix
</code></pre></div> </div>
<p>to push the resolved branch to remote origin</p>
</li>
</ol>
</section>
<footer class="page__meta">
</footer>
</div>
</article>
</div>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<div align="center" style="margin: 0 0;">
<ins class="adsbygoogle"
style="display:block; border-bottom: initial;"
data-ad-client="ca-pub-7328585512091257"
data-ad-slot="3049671934"
data-ad-format="auto"></ins>
</div>
<div class="page__footer">
<footer>
<!-- start custom footer snippets -->
<!-- end custom footer snippets -->
<div class="container">
<div class="row justify-content-md-center">
<div class="col">
<ul>
<p class="header">Resources</p>
<li><a href="/docs/getting-started/">Getting started</a></li>
<li><a href="/docs/users/">User Guide</a></li>
<li><a href="/slides/">Slides</a></li>
<li><a href="/users/faq/">Common Questions</a></li>
</ul>
</div>
<div class="col">
<ul>
<p class="header">ASF</p>
<li><a href="http://www.apache.org">Foundation</a></li>
<li><a href="http://www.apache.org/licenses/">License</a></li>
<li><a href="http://www.apache.org/events/current-event">Events</a></li>
<li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
</ul>
</div>
<div class="col">
<ul>
<p class="header">Contribute</p>
<li><a href="http://issues.apache.org/jira/browse/SCB">Report a Doc Issue</a></li>
<li><a href="https://github.com/apache/servicecomb-website/edit/master/_developers/submit-codes.md">Edit This Page on Github</a></li>
<li><a href="/developers/submit-codes/">Code Submit Guide</a></li>
<li><a href="/security">Security</a></li>
</ul>
</div>
<div class="col">
<ul class="social-icons">
<p class="header">Community</p>
<li>
<a href="mailto:dev-subscribe@servicecomb.incubator.apache.org" rel="nofollow"><span class="mail">Mailing List</span></a>
</li>
<li>
<a href="https://github.com/apache?q=ServiceComb" target="_blank"><span class="github">Github</span></a>
</li>
<li>
<a href="https://twitter.com/ServiceComb" target="_blank"><span class="twitter">Twitter</span></a>
</li>
<li>
<a href="/feed.xml" target="_blank"><span class="rss">Feed</span></a>
</li>
</ul>
</div>
</div>
</div>
<div class="page__footer-bottom">
<div>&copy; 2019 Apache ServiceComb. Powered by <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div>All other marks mentioned may be trademarks or registered trademarks of their respective owners.</div>
</div>
</footer>
</div>
<script src="/assets/js/main.min.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-101622733-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>