You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by Apache Wiki <wi...@apache.org> on 2013/07/26 20:02:27 UTC

[Cordova Wiki] Update of "ContributorWorkflow" by SharifAhmed

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cordova Wiki" for change notification.

The "ContributorWorkflow" page has been changed by SharifAhmed:
https://wiki.apache.org/cordova/ContributorWorkflow?action=diff&rev1=27&rev2=28

  ## page was renamed from ContributerWorkflow
  = Look at the Website =
- 
- There is an intro to contributing here: [[http://cordova.apache.org/#contribute]].
+ There is an intro to contributing here: http://cordova.apache.org/#contribute.
- 
  
  = Contributor License Agreement =
- 
- You will need to have signed off on the [[http://www.apache.org/licenses/icla.txt|Apache CLA]] in order for changes to be accepted. For more information, refer to: [[http://www.apache.org/licenses/#clas]]
+ You will need to have signed off on the [[http://www.apache.org/licenses/icla.txt|Apache CLA]] in order for changes to be accepted. For more information, refer to: http://www.apache.org/licenses/#clas
  
+ = The Process of Contributing =
+ So, you are an open source enthusiast and want to contribute to the cordova project? Just follow the steps below and you will be ready in no time:
  
- = Identify Work =
+  * Step - 1: Join our mailing list - dev, issues, commit  http://cordova.apache.org/#mailing-list
+  * Step - 2: Sign ICLA  http://www.apache.org/licenses/#clas
+  * Step - 3: Create an account in jira apache  http://issues.apache.org/jira/
+  * Step - 4: Bookmark the following link: http://issues.apache.org/jira/browse/CB (this is the official url for cordova jira issues)
+  * Step - 5: Introduce yourself to the community, by giving a brief introductory mail to dev@cordova.apache.org
  
- [[https://issues.apache.org/jira/browse/CB|JIRA]] and the [[http://cordova.apache.org/#mailing-list|mailing list]] are great places to start!
+ If you have completed these steps, you are now ready to start contributing.
+ 
+ There are many ways you can contribute:
+ 
+  1. Find a new bug and report as an issue.
+  1. Solve existing issues.
+  1. Propose a new feature.
+  1. Propose refractor of existing features.
+ 
+ Cordova has a number of sub-projects to choose from. Fork your prefered project and start working on it.
+ 
+ '''To be remembered:'''
+ 
+  1. If you want to solve existing issues, look for jira issues that are both 'Open' and not 'In Progress'. Either comment on the issue or bring it up on the mailing list that you wish to try to patch the issue.
+  1. When you want to create a new issue, make sure you check whether similar issues already exists or not.
+  1. After creating a jira issue, if you want to assignee that issues to yourself and failed to do so, don't worry, give a mail to dev@cordova.apache.org and it will be fixed.
+  1. Whenever you are in doubt, feel free to ask on the mailing list about where to help out and how to go about doing it.
  
  = Fork =
- 
  Fork the official Apache Cordova project mirror with git. Git is the chosen revision control system for the Cordova project. There are many places to clone the code from:
  
   * from the [[http://git-wip-us.apache.org/repos/asf|official Apache servers]]
@@ -28, +46 @@

  
   1. Create an account on github.com. Note that your repositories will have a URL of the form 'https://github.com/you' where the string 'you' is your userid. For the exercise here, substitute 'you' with your github userid. The official github repos that are read-only are at https://github.com/apache.
   1. Note that Cordova has each component in a separate git repository, so there are many git repositories that compromise the entire project. They all start with "cordova-". So for this exercise we will use the fake name "cordova-x", which you should replace with the specific repository(s) you want to work with, such as "cordova-docs" or "cordova-android". The full list is on [[http://cordova.apache.org|the Cordova home page]].
-  1. On the !GitHub web interface, fork github.com/apache/cordova-x.git to your own account on !GitHub (ie, github.com/you/cordova-x.git). 
+  1. On the !GitHub web interface, fork github.com/apache/cordova-x.git to your own account on !GitHub (ie, github.com/you/cordova-x.git).
   1. From your workstation, clone your !GitHub repo (ie, github.com/you/cordova-x.git) to your workstation. For example, to clone a Cordova repository, from your workstation shell you would run (note the "https" protocol):
-  {{{ 
+  {{{
  $ git clone https://github.com/you/cordova-x.git
  }}}
   You should now have a "cordova-x" directory with the extracted source.
   1. Add a pointer back to the official repo:
-  {{{ 
+  {{{
  $ cd cordova-x
  $ git remote add apache https://git-wip-us.apache.org/repos/asf/cordova-x.git
  }}}
@@ -44, +62 @@

  
  {{http://cordova.apache.org/wiki-images/contributor-git.png}}
  
- If you want to simply check out the source code and don't plan on making contributions, then you can skip !GitHub and clone directly from the Apache servers:
+ If you want to simply check out the source code and don't plan on making contributions, then you can skip !GitHub and clone directly from the Apache servers: {{{ $ git clone https://git-wip-us.apache.org/repos/asf/cordova-x.git }}}
- {{{ $ git clone https://git-wip-us.apache.org/repos/asf/cordova-x.git }}}
  
  = Working in git =
- 
  The Cordova community encourages a certain type of workflow within git. However, the below are only guidelines.
  
  == Topic Branch ==
-  
  A good habit to get into is using topic branches for your work, while keeping the master branch untouched. You can then keep the master branch up-to-date with the main repository without worrying about merge conflicts.
-  
+ 
  === Reduce Merge Conflicts ===
-  
  By not working on the master branch, you ensure that the branch's history will not diverge from the main repository's master branch. This allows you to pull in updates from the main repository without merge conflicts.
-  
+ 
  === Organize and Isolate Contributions ===
-  
  By creating a topic branch for each contribution, you effectively isolate your changes into a single branch of history. As long as the topic branch is up-to-date, your changes will merge cleanly into the main repository. If your contributions cannot be merged cleanly, the repository maintainer may have to reject your contribution until you update it.
-  
+ 
  === Easier for the Maintainer ===
-  
  Maintainers like topic branches. It is easier to review the pull request and merge commits into the main repository.
-  
+ 
  == Git Workflow ==
-  
  Consider that you've decided to work on ticket # CB-1234 for the cordova-docs repository. You are charged with updating some documentation.
-  
+ 
  === Update your master branch ===
- 
  We're assuming you have cloned the docs repository as per the example above, and have the docs repository set up as a "apache" remote, with your own fork as the "origin". Let's first make sure your fork is up-to-date.
  
  {{{
@@ -80, +90 @@

  $ git pull apache master
  $ git push origin master
  }}}
-  
  === Create a topic branch ===
- 
  Let's create a new branch based off of master and call it "CB-1234".
  
  {{{
@@ -92, +100 @@

    master
  * CB-1234
  }}}
- 
  You can name the topic branch anything, but it makes sense to name it after the ticket. This topic branch is now isolated and branched off the history of your master branch.
-  
+ 
  === Make File Changes ===
- 
  Let's update the accelerometer documentation for the "watchPosition" function.
  
  {{{
@@ -104, +110 @@

  $ git status
    modified: accelerometer/watchPostion.md
  }}}
-  
  git status shows that you have modified one file.
-  
+ 
  === Commit the File Changes ===
- 
  git add will stage the file changes. You can then commit the staged file(s) with git commit. This is always the process to make changes to a git repository: stage, then commit.
  
  {{{
@@ -116, +120 @@

  $ git status
  $ git commit
  }}}
-  
  ==== About Commit Messages ====
- 
  You are highly encouraged to describe your {{{git commit}}} with enough detail for someone else to understand it. In doing so, your commit message can consist of multiple lines. However, it also is highly encouraged that the first line of your commit message not exceed 50 characters. This is because some of the tooling that sits on top of git (such as the httpd apps that let you browse the repo) assume that the first line is top-level summary that is 50 characters or less. Thus there will be highlighting and truncating of the commit message using these assumptions, and it will look weird if these assumptions are not kept. And there should be a blank line between the summary and any further detailed body. For example, here is a good example of a commit message:
  
  {{{
  [CB-1234] Fixed the whizbang widget
  
  - added more sanity checking in the build script.
- - fixed the API to return the correct value in the scenario where there 
+ - fixed the API to return the correct value in the scenario where there
    aren't any whizbangs present.
  - corrected the documentation.
  
@@ -133, +135 @@

  paragraph form, with each line wrapped at 72 chars and blank lines
  between paragraphs.
  }}}
- 
  Note that the first line does two things: (1) it is less than 50 characters. Subsequent lines after the first may exceed 50 characters. (2) it references a Jira issue by its id (CB-1234). Commonly, there should be a Jira issue open for defects and new features, and it is good practice for commits to point to the Jira issue they are addressing. And vice versa, you should add a comment to the Jira issue referencing the commit id(s) that contain your work. By adding the Jira number in square brackets in the commit message, you can take care of both in one step: there will be an [[http://www.apache.org/dev/svngit2jira.html|automatic comment]] added to the Jira item with the commit id, and of course the Jira item id will be in the git commit message.
  
  Long commit messages are not necessary, especially if there is a reference to a Jira item. More good advice on this topic is in the [[http://git-scm.com/book/ch5-2.html#Commit-Guidelines|Git book]].
  
  === Test Your Changes ===
- 
  The contributor is responsible to test their changes and correct any problems with their changes before a pull request is submitted. The testing includes both verifying the function they added/touched, plus running the test suites to verify there are no regressions.
  
  When we say "run the test suites" this includes all automated tests in mobile-spec, manual tests in mobile-spec that might be affected by the change, and any platform-specific unit tests (i.e., cordova-android/test, cordova-ios/CordovaLibTests, cordova-js jake test, cordova-plugman npm test, etc.)
  
  It is recommended that you add a comment in Jira about what testing you did with your change, so a committer can understand what testing was done before they merge your change. It is also recommended that where reasonably feasible, you add automated tests to validate your change and catch any future regressions.
-  
+ 
  === Commit More File Changes ===
- 
  {{{
  $ myeditor accelerometer/watchPosition.md
  $ git commit -a
  }}}
-  
  === Prepare to Send Pull Request ===
- 
  Before sending the pull request, you should ensure that your changes merge cleanly with the main documentation repository, and that the granularity of your commits make sense.
  
  {{{
@@ -163, +160 @@

  $ git checkout CB-1234
  $ git rebase master -i
  }}}
- 
  The rebase -i step allows you to re-order or combine commits. This can help to make your commits more readable.
  
  You can do this by pulling the latest changes from the main repository back into our master. We make sure that our master is always in sync before issuing pull requests. Next, we rebase the history of the master branch onto the topic branch ticket_11. Essentially, this will rewind your divergent commits, fast-forward your topic branch to the latest commit of the master, and then re-apply your topic branch commits in order. Ensures a clean application of code changes. The [[http://book.git-scm.com/4_rebasing.html|git community book has an excellent chapter on rebasing]].
-  
+ 
  Alternatively, you can use git merge master instead of git rebase master, but your topic branches history may not be as clean.
  
  Last thing is to make your code changes available from your fork.
@@ -176, +172 @@

  $ git checkout CB-1234
  $ git push origin CB-1234
  }}}
-  
  == Sharing your Changes ==
- 
  By pushing your topic branch onto your fork, an cordova-docs maintainer can review and merge the topic branch into the main repository.
-  
+ 
  === Sending a Pull Request from GitHub ===
- 
- Pull requests sent to the [[http://github.com/apache|Apache GitHub repositories]] are used to take contributions. 
+ Pull requests sent to the [[http://github.com/apache|Apache GitHub repositories]] are used to take contributions.
-  
+ 
   * Open a web browser to your GitHub account's cordova-docs fork.
   * Select your topic branch so that the pull request references the topic branch.
   * Click the Pull Request button.
  
  === Getting Noticed ===
- 
  It is strongly recommended that you sign up for the [[http://cordova.apache.org/#mailing-list|mailing list]] before issuing a pull request. If your pull request is related to an existing JIRA issue, then add a comment to the issue with a link to your pull request. If it's not (or you're feeling too lazy to search through JIRA), then you should email the mailing-list to notify committers of your pull request.
-  
+ 
  == While Waiting, Continuing Crafting Commits ==
-  
  Since you worked on the topic branch instead of the master branch, you can continue working while waiting for the pull request to go through.
-  
+ 
  Be sure to create the topic branch from master.
  
  {{{
@@ -208, +199 @@

    master
    CB-1234
  }}}
- 
  == When Your Pull Request is Accepted ==
- 
  {{{
  $ git checkout master
  $ git pull apache master
  $ git log | more
    hey there's me! ya!
  }}}
-  
- You can now delete your topic branch, because it is now merged into the main repository and in the master branch. 
+ You can now delete your topic branch, because it is now merged into the main repository and in the master branch.
  
  PLEASE delete your topic branch on github origin, as that will automatically close your pull request. Alternatively, from the github web interface you can close your pull request while leaving your topic branch present. The goal here is for pull requests to be closed after they are merged, so we don't end up with a bunch of pull requests that appear unresolved.
  
@@ -226, +214 @@

  $ git branch -d CB-1234
  $ git push origin :CB-1234
  }}}
- 
- I know, deleting a remote topic branch is ugly (git push origin :CB-1234). 
+ I know, deleting a remote topic branch is ugly (git push origin :CB-1234).
  
  == If Your Pull Request is Rejected ==
-  
  In this case, you just need to update your branch from the main repository and then address the rejection reason.
  
  {{{
@@ -241, +227 @@

  ( edit, commit, edit, commit, etc...)
  $ git push origin CB-1234
  }}}
- 
  Then delete your topic branch (or close your pull request) as described above.