github.com/openshift/installer@v1.4.17/CONTRIBUTING.md (about)

     1  # How to Contribute
     2  
     3  CoreOS projects are [Apache 2.0 licensed](LICENSE) and accept contributions via
     4  GitHub pull requests. This document outlines some of the conventions on
     5  development workflow, commit message formatting, contact points and other
     6  resources to make it easier to get your contribution accepted.
     7  
     8  ## Certificate of Origin
     9  
    10  By contributing to this project you agree to the Developer Certificate of
    11  Origin (DCO). This document was created by the Linux Kernel community and is a
    12  simple statement that you, as a contributor, have the legal right to make the
    13  contribution. See the [DCO](DCO) file for details.
    14  
    15  ## Security Response
    16  
    17  If you've found a security issue that you'd like to disclose confidentially, please contact Red Hat's Product Security team.
    18  Details [here][security].
    19  
    20  ## Getting Started
    21  
    22  - Fork the repository on GitHub
    23  - Install [build dependencies](docs/dev/dependencies.md).
    24  - Read the [README](README.md) for build and test instructions
    25  - Play with the project, submit bugs, submit patches!
    26  
    27  ### Contribution Flow
    28  
    29  Anyone may [file issues][new-issue].
    30  For contributors who want to work up pull requests, the workflow is roughly:
    31  
    32  1. Create a topic branch from where you want to base your work (usually master).
    33  2. Make commits of logical units.
    34  3. Make sure your commit messages are in the proper format (see [below](#commit-message-format)).
    35  4. Push your changes to a topic branch in your fork of the repository.
    36  5. Make sure the tests pass, and add any new tests as appropriate.
    37  6. We run a number of linters and tests on each pull request.
    38      You may wish to run these locally before submitting your pull request (Make sure you have [podman][podman-install] installed):
    39      ```sh
    40      hack/go-fmt.sh .
    41      hack/go-lint.sh $(go list -f '{{ .ImportPath }}' ./...)
    42      hack/go-vet.sh ./...
    43      hack/shellcheck.sh
    44      hack/tf-fmt.sh -list -check
    45      hack/tf-lint.sh
    46      hack/yaml-lint.sh
    47      hack/go-test.sh
    48      ```
    49  7. Submit a pull request to the original repository.
    50  8. The [repo](OWNERS) [owners](OWNERS_ALIASES) will respond to your issue promptly, following [the ususal Prow workflow][prow-review].
    51  
    52  Thanks for your contributions!
    53  
    54  ## Coding Style
    55  
    56  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.
    57  
    58  Terraform has similar standards, and you can run `terraform fmt` to rewrite Terraform files to the canonical format.
    59  
    60  ### Import order
    61  
    62  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:
    63  ```sh
    64  hack/go-fmt.sh .
    65  ```
    66  
    67  ## Commit Message Format
    68  
    69  We follow a rough convention for commit messages that is designed to answer two
    70  questions: what changed and why. The subject line should feature the what and
    71  the body of the commit should describe the why.
    72  
    73  ```
    74  scripts: add the test-cluster command
    75  
    76  this uses tmux to set up a test cluster that you can easily kill and
    77  start for debugging.
    78  
    79  Fixes #38
    80  ```
    81  
    82  The format can be described more formally as follows:
    83  
    84  ```
    85  <subsystem>: <what changed>
    86  <BLANK LINE>
    87  <why this change was made>
    88  <BLANK LINE>
    89  <footer>
    90  ```
    91  
    92  The first line is the subject and should be no longer than 70 characters, the
    93  second line is always blank, and other lines should be wrapped at 80 characters.
    94  This allows the message to be easier to read on GitHub as well as in various
    95  git tools.
    96  
    97  ## Generating Test Mocks
    98  
    99  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.
   100  
   101  ```sh
   102  hack/go-genmock.sh
   103  ```
   104  
   105  [gci-tool]: https://github.com/daixiang0/gci
   106  [golang-style]: https://github.com/golang/go/wiki/CodeReviewComments
   107  [new-issue]: https://github.com/openshift/installer/issues/new
   108  [podman-install]: https://podman.io/getting-started/installation
   109  [prow-review]: https://github.com/kubernetes/community/blob/master/contributors/guide/owners.md#the-code-review-process
   110  [security]: https://access.redhat.com/security/team/contact