Difference between revisions of "Orion/Contributing Code"

From Eclipsepedia

Jump to: navigation, search
m (For Orion Committers: pulling in the changes)
Line 1: Line 1:
The Orion project welcomes code contributions from the public.  This page details how to set up a work environment and submit code changes for review and inclusion by a committer.
+
The Orion project welcomes code contributions from the public.  This page details how to set up a work environment and submit code changes for review and inclusion by a committer.  It also describes the process for accepting these changes if you are a committer.
  
== Identify an opportunity ==
+
== For contributors ==
  
Bug fixes are the most common type of code contribution. For a list of currently-open Orion bugs see the [https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=UNCONFIRMED;bug_status=NEW;bug_status=ASSIGNED;bug_status=REOPENED;product=Orion;classification=Eclipse Eclipse Bugzilla database].  If a bug's Assignee is an "inbox" name (eg.- "orion.client-inbox@eclipse.org") then it has not been assigned to anyone yet, and is a good candidate for investigation.  If you plan to fix a bug in Orion that does not already have a bug report then be sure to first log a report, and in the initial comment specify that you are investigating a fix for it.  This report should be logged up-front so that if the bug is not one that should be fixed (for example, it is actually working as designed, its component is in the midst of a re-write, etc.), then a committer can add a follow-up comment indicating that the bug is not worth investigating.
+
Welcome!  Thanks for helping us out.  Here are the basic steps for bug fixing, which is the most common type of contribution.
 +
 
 +
=== Identify an opportunity ===
 +
 
 +
For a list of currently-open Orion bugs see the [https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=UNCONFIRMED;bug_status=NEW;bug_status=ASSIGNED;bug_status=REOPENED;product=Orion;classification=Eclipse Eclipse Bugzilla database].  If a bug's Assignee is an "inbox" name (eg.- "orion.client-inbox@eclipse.org") then it has not been assigned to anyone yet, and is a good candidate for investigation.  If you plan to fix a bug in Orion that does not already have a bug report then be sure to first log a report, and in the initial comment specify that you are investigating a fix for it.  This report should be logged up-front so that if the bug is not one that should be fixed (for example, it is actually working as designed, its component is in the midst of a re-write, etc.), then a committer can add a follow-up comment indicating that the bug is not worth investigating.
  
 
New features/enhancements can also be contributed, but for these it is important that a committer comment in its bug report indicate that the feature is desirable.  The potential for feature work in any project is limitless, but not all features are good fits, so a feature that was not pre-approved by a committer risks not being ultimately accepted.
 
New features/enhancements can also be contributed, but for these it is important that a committer comment in its bug report indicate that the feature is desirable.  The potential for feature work in any project is limitless, but not all features are good fits, so a feature that was not pre-approved by a committer risks not being ultimately accepted.
  
== Set up a Git repository ==
+
=== Set up a Git repository ===
  
 
The first step is to establish a Git repository.  The remainder of this page assumes that GitHub is being used to host your repository, since it is a well-established Git hosting service and the Orion repository is mirrored there.  However using GitHub is not a strict requirement.
 
The first step is to establish a Git repository.  The remainder of this page assumes that GitHub is being used to host your repository, since it is a well-established Git hosting service and the Orion repository is mirrored there.  However using GitHub is not a strict requirement.
Line 14: Line 18:
 
<br><br>[[Image:github-fork.jpg]]
 
<br><br>[[Image:github-fork.jpg]]
  
== Clone your GitHub repository ==
+
=== Clone your GitHub repository ===
  
 
The next step is to clone your newly-created repository into your work environment.  For example, if you are planning to use Orion to develop Orion client-side code then you will clone the GitHub repository as described [http://wiki.eclipse.org/Orion/How_Tos/Cloning_repository_from_github here].  Alternatively, if you will be developing Orion server-side code then you will likely use Eclipse as your development environment, and either EGit or command-line Git for cloning your GitHub repository locally.
 
The next step is to clone your newly-created repository into your work environment.  For example, if you are planning to use Orion to develop Orion client-side code then you will clone the GitHub repository as described [http://wiki.eclipse.org/Orion/How_Tos/Cloning_repository_from_github here].  Alternatively, if you will be developing Orion server-side code then you will likely use Eclipse as your development environment, and either EGit or command-line Git for cloning your GitHub repository locally.
Line 22: Line 26:
 
For more info on developing Orion see the [http://wiki.eclipse.org/Orion Development Resources] section.
 
For more info on developing Orion see the [http://wiki.eclipse.org/Orion Development Resources] section.
  
== Commit your changes ==
+
=== Commit your changes ===
  
 
When your changes are ready for submission, you first commit them to your cloned Git repository (in your newly-created branch), and then push this repository to your GitHub repository.  For more detailed information on using Orion's Git facilities see the [http://wiki.eclipse.org/Orion/Documentation/User_Guide Orion User Guide].
 
When your changes are ready for submission, you first commit them to your cloned Git repository (in your newly-created branch), and then push this repository to your GitHub repository.  For more detailed information on using Orion's Git facilities see the [http://wiki.eclipse.org/Orion/Documentation/User_Guide Orion User Guide].
  
== Request adoption of your changes ==
+
=== Request adoption of your changes ===
 +
 
 +
Finally, add a comment to the Orion bug report indicating that you have changes that you want to submit, and provide the following:
 +
* the URL of your GitHub repository (read-only access is fine)
 +
* the name of the branch containing your changes
 +
* the commit id of the commit in the branch
 +
 
 +
It will then be up to a committer to review your change, ask questions, suggest improvements, etc.  Once the change is deemed to be ready then the committer can add it to the Orion repository.
 +
 
 +
== For Orion Committers ==
  
Finally, add a comment to the Orion bug report indicating that you have changes that you want to submit, and provide the URL of your GitHub repository (read-only access is fine) and the name of the branch containing your changes.  It will then be up to a committer to review your change, ask questions, suggest improvements, etc.  Once the change is deemed to be ready then the committer can add it to the Orion repository.
+
Hopefully this will get easier in the future.  
  
==== For Orion Committers: pulling in the changes ====
+
# Open the Orion Repositories page on the orion repo (client or server) that is appropriate.
Here's how an Orion committer (you) grabs the contributor's changes from GitHub:
+
# Scroll down to the '''Remotes''' section of the page and push the plus sign icon on the right of the section heading to add a remote.
# Go to the GitHub profile of the community member who wants to contribute the changes.
+
# Copy the URL of the GitHub repository provided by the committer. It will look something like <tt>git@github.com:someusername/orion.client.git</tt>
# Copy the URL of their GitHub clone. It will look something like <tt>git@github.com:someusername/orion.client.git</tt>
+
# Push the "Fetch" button to retrieve the branches from the remote
# Using Orion's Repository page, browse to your local clone of the repo. Click '''New Remote''' and paste in the URL from the previous step.
+
# Scroll back up to the '''Branches''' section of the page and click on the link that says '''See all branches''' (See [[Bug 369297]] as this is evolving...)
# Using Orion's Repository view, drill into the committer's remote, and open the '''Git Log''' page on whatever branch their changes are in.<br><br><b>Note:</b> [https://bugs.eclipse.org/bugs/show_bug.cgi?id=369297 Bug 369297] currently blocks this step. You can use the old repository page (/git/git-clone.html) as a temporary workaround.
+
# Open the '''Git Log''' page on that branch and find the commit you are looking for.
# From the Git Log page, click the '''Cherry Pick''' icon beside the commit(s) you want to grab. This will apply the commit to your active branch.
+
# Click on the commit link to open a commit page and browse the diffs.
 +
## If you don't like the proposed fix, communicate with the contributor in the bug, and start over when a new commit is proposed.
 +
## If the fix is acceptable, can cherry pick the commit, which will apply the commit to your active branch.
 
# Open the Git Log view on your active branch. Verify that the contributor's commit(s) are present, and that their name appears in the "Author" field. (Your name should appear in the "Committer" field.)
 
# Open the Git Log view on your active branch. Verify that the contributor's commit(s) are present, and that their name appears in the "Author" field. (Your name should appear in the "Committer" field.)
 
# Push.
 
# Push.
 
# Thank the contributor. :)
 
# Thank the contributor. :)
 +
# Make suggestions in {{Bug 369591}} for how this could be better.
  
 
[[Category:Orion|Contributing Code]]
 
[[Category:Orion|Contributing Code]]

Revision as of 16:30, 24 January 2012

The Orion project welcomes code contributions from the public. This page details how to set up a work environment and submit code changes for review and inclusion by a committer. It also describes the process for accepting these changes if you are a committer.

Contents

For contributors

Welcome! Thanks for helping us out. Here are the basic steps for bug fixing, which is the most common type of contribution.

Identify an opportunity

For a list of currently-open Orion bugs see the Eclipse Bugzilla database. If a bug's Assignee is an "inbox" name (eg.- "orion.client-inbox@eclipse.org") then it has not been assigned to anyone yet, and is a good candidate for investigation. If you plan to fix a bug in Orion that does not already have a bug report then be sure to first log a report, and in the initial comment specify that you are investigating a fix for it. This report should be logged up-front so that if the bug is not one that should be fixed (for example, it is actually working as designed, its component is in the midst of a re-write, etc.), then a committer can add a follow-up comment indicating that the bug is not worth investigating.

New features/enhancements can also be contributed, but for these it is important that a committer comment in its bug report indicate that the feature is desirable. The potential for feature work in any project is limitless, but not all features are good fits, so a feature that was not pre-approved by a committer risks not being ultimately accepted.

Set up a Git repository

The first step is to establish a Git repository. The remainder of this page assumes that GitHub is being used to host your repository, since it is a well-established Git hosting service and the Orion repository is mirrored there. However using GitHub is not a strict requirement.

Once you have a user account on GitHub, start by creating forks of the https://github.com/eclipse/orion.client and/or https://github.com/eclipse/orion.server repositories. These repositories will initially contain the latest Orion code in their "master" branch, and will eventually receive your code changes for submission.

Github-fork.jpg

Clone your GitHub repository

The next step is to clone your newly-created repository into your work environment. For example, if you are planning to use Orion to develop Orion client-side code then you will clone the GitHub repository as described here. Alternatively, if you will be developing Orion server-side code then you will likely use Eclipse as your development environment, and either EGit or command-line Git for cloning your GitHub repository locally.

You can now load the retrieved project(s) from your cloned repository into your workspace. But before you begin hacking, be sure to create a new branch for your work on this particular task. This branch is where you will ultimately make your changes available from.

For more info on developing Orion see the Development Resources section.

Commit your changes

When your changes are ready for submission, you first commit them to your cloned Git repository (in your newly-created branch), and then push this repository to your GitHub repository. For more detailed information on using Orion's Git facilities see the Orion User Guide.

Request adoption of your changes

Finally, add a comment to the Orion bug report indicating that you have changes that you want to submit, and provide the following:

  • the URL of your GitHub repository (read-only access is fine)
  • the name of the branch containing your changes
  • the commit id of the commit in the branch

It will then be up to a committer to review your change, ask questions, suggest improvements, etc. Once the change is deemed to be ready then the committer can add it to the Orion repository.

For Orion Committers

Hopefully this will get easier in the future.

  1. Open the Orion Repositories page on the orion repo (client or server) that is appropriate.
  2. Scroll down to the Remotes section of the page and push the plus sign icon on the right of the section heading to add a remote.
  3. Copy the URL of the GitHub repository provided by the committer. It will look something like git@github.com:someusername/orion.client.git
  4. Push the "Fetch" button to retrieve the branches from the remote
  5. Scroll back up to the Branches section of the page and click on the link that says See all branches (See Bug 369297 as this is evolving...)
  6. Open the Git Log page on that branch and find the commit you are looking for.
  7. Click on the commit link to open a commit page and browse the diffs.
    1. If you don't like the proposed fix, communicate with the contributor in the bug, and start over when a new commit is proposed.
    2. If the fix is acceptable, can cherry pick the commit, which will apply the commit to your active branch.
  8. Open the Git Log view on your active branch. Verify that the contributor's commit(s) are present, and that their name appears in the "Author" field. (Your name should appear in the "Committer" field.)
  9. Push.
  10. Thank the contributor. :)
  11. Make suggestions in Template:Bug 369591 for how this could be better.