How to Contribute Code

Quick Overview

  1. Sign the Contributor License Agreement (CLA).
  2. Review the ProjectGuidelines and CodingConventions.
  3. Review the Product Backlog for each project (the Issues tab) and discuss with the community (on the respective Discussions tab).
  4. Fork the repository.
  5. Send a pull request.

Sign the CLA

In order to become a contributor to the project you must sign the Contributor License Agreement (CLA). Signing the CLA enables us to review your contributions, but it does not grant you rights to commit to the repositories. You will be credited for any contributions we accept.
  1. Download the CLA.
  2. Fill out the form and sign it.
  3. Scan the completed form and send it to cla@microsoft.com with the "CLA for {project name}” as the subject line.
You do not need to sign a separate agreement if you have already submitted one to contribute to other Microsoft OSS projects (such as Windows Azure SDK, ASP.NET MVC, Entity Framework or CQRS Journey) and if your employer hasn't changed.

Review Guidelines, Conventions, & Roadmap

We want to maintain a reasonable level of consistency throughout the source code. We have striven to make the process as friction free as possible. Nevertheless, please take a moment to review the ProjectGuidelines and the CodingConventions.

Likewise, it is good idea to discuss your intended contribution with community on the respective Discussions tab (for each project).

Finally, we have published a RoadMap that indicates the overall direction of the project. Your contribution does not necessarily need to directly align with the roadmap, but we are likely to reject contributions that diverge significantly and have not been previously discussed.

Send a Pull Request

Git is used for the repository and is required for submitting contributions.

The general outline of the workflow is:
  1. Create a fork of the repository.
  2. Clone your fork locally.
  3. Makes changes and commit them locally.
  4. Push the changes to your fork.
  5. Submit a pull request from your fork’s page on CodePlex.
Detailed descriptions of creating forks and sending pull request can be found in the CodePlex guide.

Please keep in mind that not all requests will be approved. Requests are reviewed by the p&p team on a regular basis and will be updated with the status at each review. Only those that meet both quality and design/roadmap appropriateness will be merged into the source.

If your request is rejected you will receive information about the reasons why it was rejected.

Preparing The Code

When preparing your code for a pull request, you will need to:
  • Include the file header for any new files:
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
  • Write appropriate unit tests.
  • Run msbuild from the project’s build folder and confirm that there are no errors.
    • While developing you probably want to use the test runner inside Visual Studio.
  • Provide a summary of your contribution and reference applicable product backlog work items/bugs in the pull request.
  • Document any new functionality.
In order to speed up the process of accepting your contributions, you should try to make your check-ins as small as possible, avoid any unnecessary deltas and the need to rebase.

Commit Messages

Commit messages should be in the following format:

Write a short summary of the commit on the first line.

If you need more than one line, leave a blank line and then write a more
detailed description of the commit starting on line 3, using multiple
lines if needed.

Commit messages should use complete sentences.

Describe the change the commit is making using imperative sentences. For example:
  • Update the ODP provider for DAAB to latest version.
  • Synchronize the chronosynclastic infundibulator.
  • Calculate the permutations of 42.
If the commit fixes a bug, include that information in the first line of the commit message, for example:
Fix ExceptionResult status code (fixes #1318). 

Pull Requests

  • Choose a title that summarizes the intention of the commits included in the pull request.
  • A pull request can contain multiple commits, however it should represent a single logical contribution.
  • The description should include any additional information about the contribution that will assist in evaluating the pull request.

Last edited Nov 21, 2013 at 3:40 PM by gmelnik, version 5

Comments

No comments yet.