Contributing: PRs: Document how and why to run static checks

We need to encourage developers to run the static checks and
test suites locally before submitting PRs, or their PRs will
just bounce on the first go. We also need to document how to
run the checks, and any other caveats.

Fixes: #45

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
This commit is contained in:
Graham Whaley 2018-07-09 18:29:17 +01:00
parent 5db315c93a
commit e27aafb90a

View File

@ -5,6 +5,7 @@
* [Certificate of Origin](#certificate-of-origin) * [Certificate of Origin](#certificate-of-origin)
* [Pull requests](#pull-requests) * [Pull requests](#pull-requests)
* [Before starting work on a PR](#before-starting-work-on-a-pr) * [Before starting work on a PR](#before-starting-work-on-a-pr)
* [Before submitting a PR](#before-submitting-a-pr)
* [Normal PR workflow](#normal-pr-workflow) * [Normal PR workflow](#normal-pr-workflow)
* [Assisted PR workflow](#assisted-pr-workflow) * [Assisted PR workflow](#assisted-pr-workflow)
* [Re-vendor PRs](#re-vendor-prs) * [Re-vendor PRs](#re-vendor-prs)
@ -64,6 +65,34 @@ issue yourself. This gives the team visibility of the work you plan to do.
The other advantage to raising the issue at the outset is that our process requires an The other advantage to raising the issue at the outset is that our process requires an
issue to be associated with every PR (see [patch format](#patch-format)). issue to be associated with every PR (see [patch format](#patch-format)).
### Before submitting a PR
Kata Containers utilizes a number of [CI systems](https://en.wikipedia.org/wiki/Continuous_integration)
to automatically check every PR. As well as performing execution tests locally on
your PR before submission, you are strongly encouraged to also run the same suite of
[static checks](https://github.com/kata-containers/tests/blob/master/.ci/static-checks.sh)
the CI will execute. The easiest way to execute these in most of the repositories is
to invoke the `Makefile` `check` and `test` rules, while developer mode is enabled:
```sh
$ export KATA_DEV_MODE=true
$ make check
$ make test
```
These should execute without errors. If errors are reported, fix them
before submitting your PR.
> **Note:** To ensure you replicate the static checks performed by the CI system, it is
recommended that you:
> * Ensure you have a 'clean' source tree, as the checks will check all files present, and
might fail if you have extra files or your files are out of date in your tree.
> * Ensure that [gometalinter](https://github.com/alecthomas/gometalinter) is current or
has not been installed (the static check scripts will install it if necessary). Changes
in either the linters used or the Kata Containers code base can produce spurious errors
that do not fail inside the CI systems.
### Normal PR workflow ### Normal PR workflow
Github has a basic introduction to the PR process Github has a basic introduction to the PR process