Skip to content

Latest commit

 

History

History
154 lines (106 loc) · 5.22 KB

CONTRIBUTING.md

File metadata and controls

154 lines (106 loc) · 5.22 KB

Contributing to VIC Product

Getting started

First, fork the repository on GitHub to your personal account.

Note that GOPATH can be any directory, the example below uses $HOME/vic-product. Change $USER below to your GitHub username.

export GOPATH=$HOME/vic-product
mkdir -p $GOPATH/src/github.com/vmware
go get github.com/vmware/vic-product
cd $GOPATH/src/github.com/vmware/vic-product
git config push.default nothing # anything to avoid pushing to vmware/vic-product by default
git remote rename origin vmware
git remote add $USER git@github.com:$USER/vic-product.git
git fetch $USER

Contribution flow

This is a rough outline of what a contributor's workflow looks like:

  • Create a topic branch from where you want to base your work.
  • Make commits of logical units.
  • Make sure your commit messages are in the proper format (see below).
  • Push your changes to a topic branch in your fork of the repository.
  • Test your changes as detailed in the Automated Testing section.
  • Submit a pull request to vmware/vic-product.
  • Your PR must receive approvals from component owners before merging.

Example:

cd $GOPATH/src/github.com/vmware/vic-product
git checkout -b my-new-feature
$ <change or add files>
git commit -a
git push $USER my-new-feature

Submit a pull request (PR) to vic-product through GitHub.

Stay in sync with upstream

When your branch gets out of sync with the vmware/master branch, use the following to update:

git checkout my-new-feature
git fetch -a
git rebase vmware/master
git push --force-with-lease $USER my-new-feature

Updating pull requests

If your PR fails to pass CI or needs changes based on code review, you'll most likely want to squash these changes into existing commits.

If your pull request contains a single commit or your changes are related to the most recent commit, you can simply amend the commit.

$ <change or add files>
git add <changed or added files>
git commit --amend
git push --force-with-lease $USER my-new-feature

If you need to squash changes into an earlier commit, you can use:

$ <change or add files>
git add <changed or added files>
git commit --fixup <commit>
git rebase -i --autosquash vmware/master
git push --force-with-lease $USER my-new-feature

Be sure to add a comment to the PR indicating your new changes are ready to review, as GitHub does not generate a notification when you git push.

Code style

The coding style suggested by the Golang community is used in VIC. See the style doc for details.

Try to limit column width to 120 characters for both code and markdown documents such as this one.

Format of the Commit Message

We follow the conventions on How to Write a Git Commit Message.

Be sure to include any related GitHub issue references in the commit message. See GFM syntax for referencing issues and commits.

To help write conforming commit messages, it is recommended to set up the git-good-commit commit hook. Run this command in the vic-product root directory:

curl https://cdn.rawgit.com/tommarshall/git-good-commit/v0.6.1/hook.sh > .git/hooks/commit-msg && chmod +x .git/hooks/commit-msg

Automated Testing

CI pipeline is setup using Drone and Automated integration testing using Robot Framework.

PRs must pass unit tests and integration tests before being merged into master.

For details, see CI Workflow and Automated Testing

Reporting Bugs and Creating Issues

When opening a new issue, try to roughly follow the commit message format conventions above.

Please follow the detailed instructions in https://github.com/vmware/vic/blob/master/CONTRIBUTING.md#reporting-bugs-and-creating-issues when creating and triaging issues.

For cross-component or VIC Appliance issues, please use the vic-product Github issue tracker

For issues relating to individual components, please use the component specific Github issue tracker:

VIC Engine

Harbor

Admiral

If you are unsure which component your issue relates to, submit it here and we will triage it. Thank you for contributing to VIC Product!

Repository structure

The layout in the repo is as follows:

  • dinv - DCH Photon
  • docs - Documentation for VIC Product
  • installer - Build and source for building VIC Appliance and its platform services
  • tests - VIC Appliance tests
  • tutorials - Tutorials

VIC Appliance

View the VIC Appliance Readme

Troubleshooting

View the VIC Appliance Troubleshooting Guide