Skip to content

ContributingCode

tsahi edited this page Sep 26, 2020 · 1 revision
Documentation > ContributingCode

How to Contribute Code

Quick Overview

  1. Agree to the Apache License, Version 2.0
  2. Review the Project Guidelines and Coding Conventions.
  3. Review the Product Backlog for each project and discuss with the community on the Issues tab.
  4. Fork the repository.
  5. Send a pull request.

Agree to the Apache License

By contributing code, you agree to license your code to this project under the Apache License, Version 2.0, as detailed in the LICENSE.txt file at the root of the repository.

Review Guidelines, Conventions, and 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 Project Guidelines and the Coding Conventions.

Likewise, it is good idea to discuss your intended contribution with community on the respective Issues 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 GitHub.

Detailed descriptions of creating forks and sending pull request can be found in the GitHub guide.

Please keep in mind that not all requests will be approved. Requests are reviewed by the project 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 [year] [name and email of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
  • 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 commits 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.