Skip to content

Latest commit

 

History

History
90 lines (58 loc) · 3.36 KB

CONTRIBUTING.md

File metadata and controls

90 lines (58 loc) · 3.36 KB

Contributing to ksonnet

Thank you for taking the time to contribute to ksonnet! Before you submit any PRs, we encourage you to read the instructions for the developer certificate of origin (DCO), as well as the guidelines below:

Build

Ensure that you already have (1) a proper $GOPATH and (2) ksonnet installed. If not, follow these README instructions to get set up.

To build ksonnet locally (e.g. for open-source development), run the following in the root of your ksonnet repo (which is $GOPATH/src/github.com/ksonnet/ksonnet unless otherwise specified):

make all

This indirectly makes the following targets:

* `make ks` - Compiles all the code into a local `ks` binary
* `make docs` - Regenerates all the documentation for the ksonnet CLI, based on the code inside `cmd/`.

Troubleshooting

make docs relies on the realpath Linux utility. If you encounter a realpath: command not found error, and you are using OSX, run the following command:

brew install coreutils

Running make again afterwards should work.

Manage dependencies

This project uses dep to manage Go dependencies.

To make things easier for reviewers, put updates to vendor/ in a separate commit within the same PR.

Add a new dependency

To introduce a new dependency to the ksonnet codebase, follow these steps:

  1. Open an issue to discuss the use case and need for the dependency with the project maintainers.

  2. After building agreement, vendor the dependency using dep.

    • Where possible, please pin the dependency to a specific stable version. Please do not vendor HEAD if you can avoid it!
    • Please introduce a vendored dependency in a dedicated commit to make review easier!
  3. Write the code change that imports and uses the new dependency.

  4. Run the following in the root of the ksonnet repository:

    # Add new dependency
    dep ensure -add github.com/pkg/foo
  5. Prune unused dependencies in `vendor```

    # Prune
    dep prune
  6. Separate your dependencies (i.e. vendor/, Gopkg.*) and actual code changes into different pull requests:

    • Make a separate commit for your dependency changes, and cherry-pick it it into a new branch. Submit a PR for review.
    • After your dependency changes are checked in, rebase your original code change and submit that PR.
  7. Feel awesome for making a sizeable contribution to ksonnet! 🎉

Pin a dependency to a specific version

Pinning a dependency avoids the issue of breaking updates.

# Pin all imported client-go packages to release >= 3.0.0, < 3.1.0
dep ensure -add k8s.io/client-go@~v3.0.0

Test

Before making a PR, you should make sure to test your changes.

To do so, run make test in the root of the ksonnet repo, specifying any additional, custom Go flags with $EXTRA_GO_FLAGS.

Make a Release

See our release documentation for the process of creating a release.