2014-02-05 15:51:24 -08:00
# How to Contribute
2014-01-19 12:25:11 -08:00
2014-04-04 10:08:25 -07:00
CoreOS projects are [Apache 2.0 licensed ](LICENSE ) and accept contributions via
2017-05-19 15:06:34 -07:00
GitHub pull requests. This document outlines some of the conventions on
2014-04-04 10:08:25 -07:00
development workflow, commit message formatting, contact points and other
resources to make it easier to get your contribution accepted.
2014-01-19 12:25:11 -08:00
2017-06-07 13:17:13 -07:00
## Certificate of Origin
2014-01-19 12:25:11 -08:00
By contributing to this project you agree to the Developer Certificate of
Origin (DCO). This document was created by the Linux Kernel community and is a
simple statement that you, as a contributor, have the legal right to make the
2014-04-04 10:08:25 -07:00
contribution. See the [DCO ](DCO ) file for details.
2014-01-19 12:25:11 -08:00
2018-10-24 14:22:53 -07:00
## Security Response
2017-06-07 13:17:13 -07:00
2018-10-24 14:22:53 -07:00
If you've found a security issue that you'd like to disclose confidentially, please contact Red Hat's Product Security team.
Details [here][security].
2017-06-07 13:17:13 -07:00
2014-01-19 12:25:11 -08:00
## Getting Started
- Fork the repository on GitHub
2018-09-24 14:18:29 -04:00
- Install [build dependencies ](docs/dev/dependencies.md ).
2014-04-04 10:08:25 -07:00
- Read the [README ](README.md ) for build and test instructions
- Play with the project, submit bugs, submit patches!
2014-01-19 12:25:11 -08:00
2017-06-07 13:17:13 -07:00
### Contribution Flow
2014-01-19 12:25:11 -08:00
OWNERS: Configure Prow with approver and reviewer information
Most of the folks I've listed here are under Aaron in Red Hat, with
Yifan being the installer lead. I've also included Alex and Clayton,
who are higher up in Red Hat but still members of
@openshift/installer. I'm guessing about roles, but we can always
adjust later as we see fit.
Approvers can also /lgtm [1], so there's no need to list them under
'reviewers' as well.
The docs link in OWNERS is from [2].
While updating CONTRIBUTING.md to mention OWNERS (using wording based
on [3]), I've also:
* Added a line to make it clear that filing issues is helpful to (for
folks who don't have the time or inclination to work up a PR).
* Turned the unordered list into an ordered list. These entries
happen sequentially, and an ordered list makes that more obvious.
* Made "below" a link, to make finding the referenced content more
convenient.
* Shuffled words in the commit message format title to make it
shorter.
The references to 'make structure-check' are stale since d61abd48 (*:
cleanup bazel rules, 2018-03-26, coreos/tectonic-installer#3137), but
I've left fixing that to follow-up work.
[1]: https://github.com/kubernetes/community/blob/4c0c2e9e659d2f989f3d23c3634c16bb099f3064/contributors/guide/owners.md#quirks-of-the-process
[2]: https://github.com/kubernetes/kubernetes-template-project/pull/15
[3]: https://github.com/kubernetes/kubernetes-template-project/blame/16f1588e6d4746876beb08cc64769657530d4872/CONTRIBUTING.md#L10
2018-07-25 09:53:26 -07:00
Anyone may [file issues][new-issue].
For contributors who want to work up pull requests, the workflow is roughly:
1. Create a topic branch from where you want to base your work (usually master).
2. Make commits of logical units.
3. Make sure your commit messages are in the proper format (see [below ](#commit-message-format )).
4. Push your changes to a topic branch in your fork of the repository.
5. Make sure the tests pass, and add any new tests as appropriate.
2018-07-25 10:29:16 -07:00
6. We run a number of linters and tests on each pull request.
2019-10-14 07:57:30 -07:00
You may wish to run these locally before submitting your pull request (Make sure you have [podman][podman-install] installed):
2018-07-06 13:44:51 -07:00
```sh
2018-07-25 10:29:16 -07:00
hack/go-fmt.sh .
hack/go-lint.sh $(go list -f '{{ .ImportPath }}' ./...)
hack/go-vet.sh ./...
hack/shellcheck.sh
hack/tf-fmt.sh -list -check
hack/tf-lint.sh
2018-10-22 00:10:34 -07:00
hack/yaml-lint.sh
2018-12-14 13:36:51 -05:00
hack/go-test.sh
2017-07-28 08:29:26 -05:00
```
OWNERS: Configure Prow with approver and reviewer information
Most of the folks I've listed here are under Aaron in Red Hat, with
Yifan being the installer lead. I've also included Alex and Clayton,
who are higher up in Red Hat but still members of
@openshift/installer. I'm guessing about roles, but we can always
adjust later as we see fit.
Approvers can also /lgtm [1], so there's no need to list them under
'reviewers' as well.
The docs link in OWNERS is from [2].
While updating CONTRIBUTING.md to mention OWNERS (using wording based
on [3]), I've also:
* Added a line to make it clear that filing issues is helpful to (for
folks who don't have the time or inclination to work up a PR).
* Turned the unordered list into an ordered list. These entries
happen sequentially, and an ordered list makes that more obvious.
* Made "below" a link, to make finding the referenced content more
convenient.
* Shuffled words in the commit message format title to make it
shorter.
The references to 'make structure-check' are stale since d61abd48 (*:
cleanup bazel rules, 2018-03-26, coreos/tectonic-installer#3137), but
I've left fixing that to follow-up work.
[1]: https://github.com/kubernetes/community/blob/4c0c2e9e659d2f989f3d23c3634c16bb099f3064/contributors/guide/owners.md#quirks-of-the-process
[2]: https://github.com/kubernetes/kubernetes-template-project/pull/15
[3]: https://github.com/kubernetes/kubernetes-template-project/blame/16f1588e6d4746876beb08cc64769657530d4872/CONTRIBUTING.md#L10
2018-07-25 09:53:26 -07:00
7. Submit a pull request to the original repository.
2018-08-24 15:22:12 -07:00
8. The [repo ](OWNERS ) [owners ](OWNERS_ALIASES ) will respond to your issue promptly, following [the ususal Prow workflow][prow-review].
2014-01-19 12:25:11 -08:00
2014-04-04 10:08:25 -07:00
Thanks for your contributions!
2014-01-19 12:25:11 -08:00
2017-05-19 15:06:34 -07:00
## Coding Style
2015-10-13 18:27:11 -07:00
2018-07-06 18:48:42 +02:00
The coding style suggested by the Golang community is used in installer. See the [style doc][golang-style] for details. Please follow them when working on your contributions.
2017-06-15 15:30:20 -07:00
2018-07-25 10:29:16 -07:00
Terraform has similar standards, and you can run `terraform fmt` to rewrite Terraform files to the canonical format.
2017-06-07 10:48:21 -07:00
2022-12-13 10:21:51 +01:00
### Import order
The Golang import statements are organized into 4 sections: standard, default, prefix("github.com/openshift"), and blank imports with the [gci tool][gci-tool]. To automatically sort the imports run:
```sh
hack/go-fmt.sh .
```
OWNERS: Configure Prow with approver and reviewer information
Most of the folks I've listed here are under Aaron in Red Hat, with
Yifan being the installer lead. I've also included Alex and Clayton,
who are higher up in Red Hat but still members of
@openshift/installer. I'm guessing about roles, but we can always
adjust later as we see fit.
Approvers can also /lgtm [1], so there's no need to list them under
'reviewers' as well.
The docs link in OWNERS is from [2].
While updating CONTRIBUTING.md to mention OWNERS (using wording based
on [3]), I've also:
* Added a line to make it clear that filing issues is helpful to (for
folks who don't have the time or inclination to work up a PR).
* Turned the unordered list into an ordered list. These entries
happen sequentially, and an ordered list makes that more obvious.
* Made "below" a link, to make finding the referenced content more
convenient.
* Shuffled words in the commit message format title to make it
shorter.
The references to 'make structure-check' are stale since d61abd48 (*:
cleanup bazel rules, 2018-03-26, coreos/tectonic-installer#3137), but
I've left fixing that to follow-up work.
[1]: https://github.com/kubernetes/community/blob/4c0c2e9e659d2f989f3d23c3634c16bb099f3064/contributors/guide/owners.md#quirks-of-the-process
[2]: https://github.com/kubernetes/kubernetes-template-project/pull/15
[3]: https://github.com/kubernetes/kubernetes-template-project/blame/16f1588e6d4746876beb08cc64769657530d4872/CONTRIBUTING.md#L10
2018-07-25 09:53:26 -07:00
## Commit Message Format
2014-01-19 12:25:11 -08:00
2014-06-18 18:36:00 -07:00
We follow a rough convention for commit messages that is designed to answer two
questions: what changed and why. The subject line should feature the what and
the body of the commit should describe the why.
2014-01-19 12:25:11 -08:00
```
2014-06-18 18:36:00 -07:00
scripts: add the test-cluster command
2014-01-19 12:25:11 -08:00
2017-06-07 10:48:21 -07:00
this uses tmux to set up a test cluster that you can easily kill and
2014-06-18 18:36:00 -07:00
start for debugging.
Fixes #38
2014-01-19 12:25:11 -08:00
```
2014-04-04 10:08:25 -07:00
The format can be described more formally as follows:
2014-01-19 12:25:11 -08:00
```
2014-06-18 18:36:00 -07:00
<subsystem>: <what changed>
2014-01-19 12:25:11 -08:00
<BLANK LINE>
2014-06-18 18:36:00 -07:00
<why this change was made>
2014-01-19 12:25:11 -08:00
<BLANK LINE>
<footer>
```
2014-04-04 10:08:25 -07:00
The first line is the subject and should be no longer than 70 characters, the
second line is always blank, and other lines should be wrapped at 80 characters.
This allows the message to be easier to read on GitHub as well as in various
2014-01-19 12:25:11 -08:00
git tools.
2017-05-19 15:06:34 -07:00
2018-12-14 13:36:51 -05:00
## Generating Test Mocks
Some unit tests use mocks that are generated with gomock. If the underlying interface for a mock changes, then the mock will need to be regenerated. Use the following to regenerate all of the mocks under the pkg package.
2018-12-20 14:03:14 -05:00
```sh
hack/go-genmock.sh
2018-12-14 13:36:51 -05:00
```
2022-12-13 10:21:51 +01:00
[gci-tool]: https://github.com/daixiang0/gci
2018-02-14 14:38:24 -02:00
[golang-style]: https://github.com/golang/go/wiki/CodeReviewComments
OWNERS: Configure Prow with approver and reviewer information
Most of the folks I've listed here are under Aaron in Red Hat, with
Yifan being the installer lead. I've also included Alex and Clayton,
who are higher up in Red Hat but still members of
@openshift/installer. I'm guessing about roles, but we can always
adjust later as we see fit.
Approvers can also /lgtm [1], so there's no need to list them under
'reviewers' as well.
The docs link in OWNERS is from [2].
While updating CONTRIBUTING.md to mention OWNERS (using wording based
on [3]), I've also:
* Added a line to make it clear that filing issues is helpful to (for
folks who don't have the time or inclination to work up a PR).
* Turned the unordered list into an ordered list. These entries
happen sequentially, and an ordered list makes that more obvious.
* Made "below" a link, to make finding the referenced content more
convenient.
* Shuffled words in the commit message format title to make it
shorter.
The references to 'make structure-check' are stale since d61abd48 (*:
cleanup bazel rules, 2018-03-26, coreos/tectonic-installer#3137), but
I've left fixing that to follow-up work.
[1]: https://github.com/kubernetes/community/blob/4c0c2e9e659d2f989f3d23c3634c16bb099f3064/contributors/guide/owners.md#quirks-of-the-process
[2]: https://github.com/kubernetes/kubernetes-template-project/pull/15
[3]: https://github.com/kubernetes/kubernetes-template-project/blame/16f1588e6d4746876beb08cc64769657530d4872/CONTRIBUTING.md#L10
2018-07-25 09:53:26 -07:00
[new-issue]: https://github.com/openshift/installer/issues/new
2019-10-14 07:57:30 -07:00
[podman-install]: https://podman.io/getting-started/installation
OWNERS: Configure Prow with approver and reviewer information
Most of the folks I've listed here are under Aaron in Red Hat, with
Yifan being the installer lead. I've also included Alex and Clayton,
who are higher up in Red Hat but still members of
@openshift/installer. I'm guessing about roles, but we can always
adjust later as we see fit.
Approvers can also /lgtm [1], so there's no need to list them under
'reviewers' as well.
The docs link in OWNERS is from [2].
While updating CONTRIBUTING.md to mention OWNERS (using wording based
on [3]), I've also:
* Added a line to make it clear that filing issues is helpful to (for
folks who don't have the time or inclination to work up a PR).
* Turned the unordered list into an ordered list. These entries
happen sequentially, and an ordered list makes that more obvious.
* Made "below" a link, to make finding the referenced content more
convenient.
* Shuffled words in the commit message format title to make it
shorter.
The references to 'make structure-check' are stale since d61abd48 (*:
cleanup bazel rules, 2018-03-26, coreos/tectonic-installer#3137), but
I've left fixing that to follow-up work.
[1]: https://github.com/kubernetes/community/blob/4c0c2e9e659d2f989f3d23c3634c16bb099f3064/contributors/guide/owners.md#quirks-of-the-process
[2]: https://github.com/kubernetes/kubernetes-template-project/pull/15
[3]: https://github.com/kubernetes/kubernetes-template-project/blame/16f1588e6d4746876beb08cc64769657530d4872/CONTRIBUTING.md#L10
2018-07-25 09:53:26 -07:00
[prow-review]: https://github.com/kubernetes/community/blob/master/contributors/guide/owners.md#the -code-review-process
2018-10-24 14:22:53 -07:00
[security]: https://access.redhat.com/security/team/contact