Skip to content

Latest commit

 

History

History
97 lines (81 loc) · 4.27 KB

CONTRIBUTING.md

File metadata and controls

97 lines (81 loc) · 4.27 KB

How to contribute

We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.

Check out the source

Do the following to check out the GAPID source code on GitHub:

  1. Sign up for GitHub at https://github.com/ if you don’t already have an account.
  2. (Optional) Set up an SSH key to connect to your account using SSH.
  3. (Optional) Add a GPG signing key to your account.
  4. Go to the project landing page at https://github.com/google/gapid.
  5. Fork the repository. This creates a copy of the repository in your account.
  6. Create a work folder on your workstation. The rest of this document assumes ~/work, adjust as needed.
  7. On your GAPID project page, clone your copy of the repository and add it to your local work folder:
    cd ~/work
    git clone <clone-url>
    cd gapid
    
  8. Add the Google remote repository to your local repository:
    git remote add goog [email protected]:google/gapid.git
    git fetch goog
    

(Optional) Configure git

Use the following commands to configure git for GAPID development:

# Assume the remote branch has the same name as your local branch to make pushing changes easier
git config push.default current 
# Default to pushing to your fork (assuming the above directions)
git config remote.pushDefault origin
# Make git clean up all the remote tags it creates when you delete remote branches
git config fetch.prune true
git config user.name <your-name> # Add --global to make this a global setting
git config user.email <[email protected]> # Can also be a global setting
# If you added a GPG signing key, run the following commands:
git config user.signingkey <keyid> 
git config commit.gpgsign true

Build GAPID for the first time

Follow the build instructions in the GAPID repository.

Sign the Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution, this simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.

Open a pull request (PR)

Do the following to contribute to the GAPID project:

  1. Prepare your changes on a dedicated branch in your local repository:
    git checkout -b <my-branch>
    
  2. Make changes, commit the changes, and squash them into a single commit.
  3. Use the presubmit script to check code formatting and other things:
    # Install clang-format 6.0 
    sudo apt-get install -y clang-format-6.0 
    export CLANG_FORMAT=clang-format-6.0
    # Run the script
    ./kokoro/presubmit/presubmit.sh
    
  4. Fix potential issues, commit the fix, squash into a single commit again.
  5. Re-run presubmit script until it passes without warnings.
  6. Check that the tests pass:
    bazel test tests
    
  7. Push to your GitHub repo:
    git push 
    
  8. Visit https://github.com/google/gapid to see a pop-up dialog inviting you to open a PR; click on the dialog to create a PR. See Creating a pull request from a fork for more information.
  9. All submissions, including submissions by project members, require review. You can request specific reviewers for your PR or leave the reviewers section blank. A GAPID team member will review the request.

Consult GitHub Help for more information on using pull requests.