blob: 45bb7569bf7b9814c6fad0fc288bb8d8389b8a93 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{144:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return h}));var a=r(0),i=r.n(a);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,a,i=function(e,t){if(null==e)return{};var r,a,i={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var u=i.a.createContext({}),s=function(e){var t=i.a.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},b=function(e){var t=s(e.components);return i.a.createElement(u.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},m=i.a.forwardRef((function(e,t){var r=e.components,a=e.mdxType,n=e.originalType,c=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),b=s(r),m=a,h=b["".concat(c,".").concat(m)]||b[m]||p[m]||n;return r?i.a.createElement(h,o(o({ref:t},u),{},{components:r})):i.a.createElement(h,o({ref:t},u))}));function h(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var n=r.length,c=new Array(n);c[0]=m;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o.mdxType="string"==typeof e?e:a,c[1]=o;for(var u=2;u<n;u++)c[u]=r[u];return i.a.createElement.apply(null,c)}return i.a.createElement.apply(null,r)}m.displayName="MDXCreateElement"},208:function(e,t,r){"use strict";r.r(t),t.default=r.p+"assets/images/jira_number_example-9d86e8dd3b72d9d9c2adddfbffc00a54.png"},209:function(e,t,r){"use strict";r.r(t),t.default=r.p+"assets/images/compare_pull_request_button-a5c8f7a7ebda5fad45d1d9e6ca8ed58a.png"},210:function(e,t,r){"use strict";r.r(t),t.default=r.p+"assets/images/pull_request_template_example-5db7207e23fa54cca6de32325e8d7c67.png"},89:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return c})),r.d(t,"metadata",(function(){return o})),r.d(t,"toc",(function(){return l})),r.d(t,"default",(function(){return s}));var a=r(3),i=r(7),n=(r(0),r(144)),c={title:"How To Contribute to Submarine"},o={unversionedId:"community/contributing",id:"community/contributing",isDocsHomePage:!1,title:"How To Contribute to Submarine",description:"\x3c!--",source:"@site/docs/community/contributing.md",slug:"/community/contributing",permalink:"/docs/community/contributing",editUrl:"https://github.com/apache/submarine/edit/master/website/docs/community/contributing.md",version:"current",sidebar:"docs",previous:{title:"Guide for Apache Submarine Committers",permalink:"/docs/community/HowToCommit"},next:{title:"Architecture and Requirment",permalink:"/docs/designDocs/architecture-and-requirements"}},l=[{value:"Preface",id:"preface",children:[]},{value:"Build Submarine",id:"build-submarine",children:[]},{value:"Creating patches",id:"creating-patches",children:[{value:"Step1: Fork apache/submarine github repository (first time)",id:"step1-fork-apachesubmarine-github-repository-first-time",children:[]},{value:"Step2: Clone the Submarine to your local machine",id:"step2-clone-the-submarine-to-your-local-machine",children:[]},{value:"Step3: Create a new Jira in Submarine project",id:"step3-create-a-new-jira-in-submarine-project",children:[]},{value:"Step4: Create a local branch for your contribution",id:"step4-create-a-local-branch-for-your-contribution",children:[]},{value:"Step5: Develop &amp; Create commits",id:"step5-develop--create-commits",children:[]},{value:"Step6: Syncing your local branch with upstream/master",id:"step6-syncing-your-local-branch-with-upstreammaster",children:[]},{value:"Step7: Push your local branch to your personal fork",id:"step7-push-your-local-branch-to-your-personal-fork",children:[]},{value:"Step8: Check Travis-ci status of your personal fork",id:"step8-check-travis-ci-status-of-your-personal-fork",children:[]},{value:"Step9: Create a pull request on github UI",id:"step9-create-a-pull-request-on-github-ui",children:[]},{value:"Step10: Check Travis-ci status of your pull request in apache/submarine",id:"step10-check-travis-ci-status-of-your-pull-request-in-apachesubmarine",children:[]},{value:"Step11: The Review Process",id:"step11-the-review-process",children:[]},{value:"Step12: Address review comments",id:"step12-address-review-comments",children:[]},{value:"Code convention",id:"code-convention",children:[]}]}],u={toc:l};function s(e){var t=e.components,c=Object(i.a)(e,["components"]);return Object(n.b)("wrapper",Object(a.a)({},u,c,{components:t,mdxType:"MDXLayout"}),Object(n.b)("p",null,"There are several ways to contribute to Submarine:"),Object(n.b)("ol",null,Object(n.b)("li",{parentName:"ol"},"Develop and Commit source code (This document will primarily focus on this.)"),Object(n.b)("li",{parentName:"ol"},"Report issues (You can report issues with both Github or Jira.)"),Object(n.b)("li",{parentName:"ol"},"Discuss/Answer questions on the mailing list"),Object(n.b)("li",{parentName:"ol"},"Share use cases")),Object(n.b)("h2",{id:"preface"},"Preface"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},Object(n.b)("strong",{parentName:"li"},"Apache Submarine")," is an ",Object(n.b)("a",{parentName:"li",href:"https://github.com/apache/submarine/blob/master/LICENSE"},"Apache 2.0 License")," Software. Contributing to Submarine means you agree to the Apache 2.0 License. "),Object(n.b)("li",{parentName:"ul"},"Please read ",Object(n.b)("a",{parentName:"li",href:"http://www.apache.org/foundation/policies/conduct.html"},"Code of Conduct")," carefully."),Object(n.b)("li",{parentName:"ul"},"The document ",Object(n.b)("a",{parentName:"li",href:"http://www.apache.org/foundation/how-it-works.html"},"How It Works")," can help you understand Apache Software Foundation further.")),Object(n.b)("h2",{id:"build-submarine"},"Build Submarine"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},Object(n.b)("a",{parentName:"li",href:"https://github.com/apache/submarine/blob/master/website/docs/devDocs/BuildFromCode.md"},"Build From Code"))),Object(n.b)("h2",{id:"creating-patches"},"Creating patches"),Object(n.b)("p",null,"Submarine follows ",Object(n.b)("a",{parentName:"p",href:"https://github.com/sevntu-checkstyle/sevntu.checkstyle/wiki/Development-workflow-with-Git:-Fork,-Branching,-Commits,-and-Pull-Request"},"Fork & Pull")," model."),Object(n.b)("h3",{id:"step1-fork-apachesubmarine-github-repository-first-time"},"Step1: Fork apache/submarine github repository (first time)"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},"Visit ",Object(n.b)("a",{parentName:"li",href:"https://github.com/apache/submarine"},"https://github.com/apache/submarine")),Object(n.b)("li",{parentName:"ul"},"Click the ",Object(n.b)("inlineCode",{parentName:"li"},"Fork")," button to create a fork of the repository")),Object(n.b)("h3",{id:"step2-clone-the-submarine-to-your-local-machine"},"Step2: Clone the Submarine to your local machine"),Object(n.b)("pre",null,Object(n.b)("code",{parentName:"pre",className:"language-sh"},"# USERNAME \u2013 your Github user account name.\ngit clone git@github.com:${USERNAME}/submarine.git\n# or: git clone https://github.com/${USERNAME}/submarine.git \n \ncd submarine\n# set upstream \ngit remote add upstream git@github.com:apache/submarine.git\n# or: git remote add upstream https://github.com/apache/submarine.git\n\n# Don't push to the upstream master.\ngit remote set-url --push upstream no_push\n\n# Check upstream/origin:\n# origin git@github.com:${USERNAME}/submarine.git (fetch)\n# origin git@github.com:${USERNAME}/submarine.git (push)\n# upstream git@github.com:apache/submarine.git (fetch)\n# upstream no_push (push)\ngit remote -v\n")),Object(n.b)("h3",{id:"step3-create-a-new-jira-in-submarine-project"},"Step3: Create a new Jira in Submarine project"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},"New contributors need privilege to create JIRA issues. Please email ",Object(n.b)("a",{parentName:"li",href:"mailto:kaihsun@apache.org"},"kaihsun@apache.org"),' with your Jira username. In addition, the email title should be "',"[New Submarine Contributor]",'".'),Object(n.b)("li",{parentName:"ul"},"Check ",Object(n.b)("a",{parentName:"li",href:"https://issues.apache.org/jira/projects/SUBMARINE/issues/SUBMARINE-748?filter=allopenissues"},"Jira issue tracker")," for existing issues."),Object(n.b)("li",{parentName:"ul"},"Create a new Jira issue in Submarine project. When the issue is created, a Jira number (eg. SUBMARINE-748) will be assigned to the issue automatically.\n",Object(n.b)("img",{alt:"jira_number_example",src:r(208).default}))),Object(n.b)("h3",{id:"step4-create-a-local-branch-for-your-contribution"},"Step4: Create a local branch for your contribution"),Object(n.b)("pre",null,Object(n.b)("code",{parentName:"pre",className:"language-sh"},"cd submarine\n\n# Make your local master up-to-date\ngit checkout master\ngit fetch upstream \ngit rebase upstream/master\n\n# Create a new branch fro issue SUBMARINE-${jira_number}\ngit checkout -b SUBMARINE-${jira_number}\n\n# Example: git checkout -b SUBMARINE-748 \n")),Object(n.b)("h3",{id:"step5-develop--create-commits"},"Step5: Develop & Create commits"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},"You can edit the code on the ",Object(n.b)("inlineCode",{parentName:"li"},"SUBMARINE-${jira_number}")," branch. (Coding Style: ",Object(n.b)("a",{parentName:"li",href:"#code-convention"},"Code Convention"),")"),Object(n.b)("li",{parentName:"ul"},"Create commits")),Object(n.b)("pre",null,Object(n.b)("code",{parentName:"pre",className:"language-sh"},'git add ${edited files}\ngit commit -m "SUBMARINE-${jira_number}. ${Commit Message}"\n# Example: git commit -m "SUBMARINE-748. Update Contributing guide" \n')),Object(n.b)("h3",{id:"step6-syncing-your-local-branch-with-upstreammaster"},"Step6: Syncing your local branch with upstream/master"),Object(n.b)("pre",null,Object(n.b)("code",{parentName:"pre",className:"language-sh"},"# On SUBMARINE-${jira_number} branch\ngit fetch upstream\ngit rebase upstream/master\n")),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},"Please do not use ",Object(n.b)("inlineCode",{parentName:"li"},"git pull")," to synchronize your local branch. Because ",Object(n.b)("inlineCode",{parentName:"li"},"git pull")," does a merge to create merged commits, these will make commit history messy.")),Object(n.b)("h3",{id:"step7-push-your-local-branch-to-your-personal-fork"},"Step7: Push your local branch to your personal fork"),Object(n.b)("pre",null,Object(n.b)("code",{parentName:"pre",className:"language-sh"},"git push origin SUBMARINE-${jira_number} \n")),Object(n.b)("h3",{id:"step8-check-travis-ci-status-of-your-personal-fork"},"Step8: Check Travis-ci status of your personal fork"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},"Visit ",Object(n.b)("inlineCode",{parentName:"li"},"https://travis-ci.com/github/${USERNAME}/submarine")),Object(n.b)("li",{parentName:"ul"},"Please make sure your new commits can pass all integration tests before creating a pull request.")),Object(n.b)("h3",{id:"step9-create-a-pull-request-on-github-ui"},"Step9: Create a pull request on github UI"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},"Visit your fork at ",Object(n.b)("inlineCode",{parentName:"li"},"https://github.com/${USERNAME}/submarine.git")),Object(n.b)("li",{parentName:"ul"},"Click ",Object(n.b)("inlineCode",{parentName:"li"},"Compare & Pull Request")," button to create pull request.\n",Object(n.b)("img",{alt:"compare_pull_request_button",src:r(209).default}))),Object(n.b)("h4",{id:"pull-request-template"},"Pull Request template"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},Object(n.b)("a",{parentName:"li",href:"https://github.com/apache/submarine/blob/bd7578cc28f8280f9170938d4469fcc965e24a89/.github/PULL_REQUEST_TEMPLATE"},"Pull request template")),Object(n.b)("li",{parentName:"ul"},"Filling the template thoroughly can improve the speed of the review process. Example: ")),Object(n.b)("p",null,Object(n.b)("img",{alt:"pull_request_template_example",src:r(210).default})),Object(n.b)("h3",{id:"step10-check-travis-ci-status-of-your-pull-request-in-apachesubmarine"},"Step10: Check Travis-ci status of your pull request in apache/submarine"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},"Visit ",Object(n.b)("a",{parentName:"li",href:"https://travis-ci.com/github/apache/submarine/pull_requests"},"https://travis-ci.com/github/apache/submarine/pull_requests")),Object(n.b)("li",{parentName:"ul"},"Please make sure your pull request can pass all integration tests. ")),Object(n.b)("h3",{id:"step11-the-review-process"},"Step11: The Review Process"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},"Anyone can be a reviewer and comment on the pull requests."),Object(n.b)("li",{parentName:"ul"},'Reviewer can indicate that a patch looks suitable for merging with a comment such as: "Looks good", "LGTM", "+1". (PS: LGTM = Looks Good To Me)'),Object(n.b)("li",{parentName:"ul"},'At least one indication of suitability (e.g. "LGTM") from a committer is required to be merged. '),Object(n.b)("li",{parentName:"ul"},'A committer can then initiate lazy consensus ("Merge if there is no more discussion") after which the code can be merged after a particular time (usually 24 hours) if there are no more reviews.'),Object(n.b)("li",{parentName:"ul"},"Contributors can ping reviewers (including committers) by commenting 'Ready to review'.")),Object(n.b)("h3",{id:"step12-address-review-comments"},"Step12: Address review comments"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},"Push new commits to SUBMARINE-${jira_number} branch. The pull request will update automatically."),Object(n.b)("li",{parentName:"ul"},"After you address all review comments, committers will merge the pull request.")),Object(n.b)("h3",{id:"code-convention"},"Code convention"),Object(n.b)("p",null,"We are following Google Code style:"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},Object(n.b)("a",{parentName:"li",href:"https://google.github.io/styleguide/javaguide.html"},"Java style")),Object(n.b)("li",{parentName:"ul"},Object(n.b)("a",{parentName:"li",href:"https://google.github.io/styleguide/shell.xml"},"Shell style"))),Object(n.b)("p",null,"There are some plugins to format, lint your code in IDE (use ",Object(n.b)("a",{parentName:"p",href:"hhttps://github.com/apache/submarine/blob/master/dev-support/maven-config/checkstyle.xml"},"dev-support/maven-config/checkstyle.xml")," as rules)"),Object(n.b)("ul",null,Object(n.b)("li",{parentName:"ul"},Object(n.b)("a",{parentName:"li",href:"https://plugins.jetbrains.com/plugin/1065"},"Checkstyle plugin for Intellij")," (",Object(n.b)("a",{parentName:"li",href:"http://stackoverflow.com/questions/26955766/intellij-idea-checkstyle"},"Setting Guide"),")"),Object(n.b)("li",{parentName:"ul"},Object(n.b)("a",{parentName:"li",href:"http://eclipse-cs.sourceforge.net/#!/"},"Checkstyle plugin for Eclipse")," (",Object(n.b)("a",{parentName:"li",href:"http://eclipse-cs.sourceforge.net/#!/project-setup"},"Setting Guide"),")")))}s.isMDXComponent=!0}}]);