|
| 1 | +# How to Contribute |
| 2 | + |
| 3 | +*eksctl* is [Apache 2.0 licenced](LICENSE) and accepts contributions via GitHub |
| 4 | +pull requests. This document outlines some of the conventions on the development |
| 5 | +workflow, commit message formatting, contact points and other resources to make |
| 6 | +it easier to get your contribution accepted. |
| 7 | + |
| 8 | +We gratefully welcome improvements to documentation as well as to code. |
| 9 | + |
| 10 | +# Certificate of Origin |
| 11 | + |
| 12 | +By contributing to this project you agree to the Developer Certificate of |
| 13 | +Origin (DCO). This document was created by the Linux Kernel community and is a |
| 14 | +simple statement that you, as a contributor, have the legal right to make the |
| 15 | +contribution. No action from you is required, but it's a good idea to see the |
| 16 | +[DCO](DCO) file for details before you start contributing code to eksctl. |
| 17 | + |
| 18 | +# Chat |
| 19 | + |
| 20 | +The project uses Slack. If you get stuck or just have a question then you are encouraged to join the [Weave Community](https://weaveworks.github.io/community-slack/) Slack workspace and use the [#eksctl](https://weave-community.slack.com/messages/eksctl/) channel. |
| 21 | + |
| 22 | +## Getting Started |
| 23 | + |
| 24 | +- Fork the repository on GitHub |
| 25 | +- Read the [README](README.md) for getting started as a user and learn how/where to ask for help |
| 26 | +- If you want to contribute as a developer, continue reading this document for further instructions |
| 27 | +- Play with the project, submit bugs, submit pull requests! |
| 28 | + |
| 29 | +## Contribution workflow |
| 30 | + |
| 31 | +This is a rough outline of how to prepare a contribution: |
| 32 | + |
| 33 | +- Find an [issue](https://github.com/weaveworks/eksctl/issues) to work on. If you are a new contributer |
| 34 | +take a look at issues marked with [good first issue](https://github.com/weaveworks/eksctl/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). |
| 35 | +- Create a topic branch from where you want to base your work (usually branched from master). |
| 36 | +- Make commits of logical units. |
| 37 | +- Make sure your commit messages are in the proper format (see below). |
| 38 | +- Push your changes to a topic branch in your fork of the repository. |
| 39 | +- If you changed code: |
| 40 | + - add automated tests to cover your changes. See the [az](https://github.com/weaveworks/eksctl/tree/master/pkg/az) package for a good example of tests. |
| 41 | +- Submit a pull request to the original repository. |
| 42 | + |
| 43 | +If your PR is a work in progress then make sure you prefix the title with `WIP: `. This lets everyone know that this is still being worked on. Once its ready |
| 44 | +remove the `WIP: ` title prefix and where possible squash your commits. |
| 45 | + |
| 46 | +## How to build and run the project |
| 47 | + |
| 48 | +```bash |
| 49 | +make build |
| 50 | +./eksctl get clusters |
| 51 | +``` |
| 52 | + |
| 53 | +## How to run the test suite |
| 54 | + |
| 55 | +You can run the unit tests by simply doing |
| 56 | + |
| 57 | +```bash |
| 58 | +make tests |
| 59 | +``` |
| 60 | + |
| 61 | +There are integration tests for *eksctl* being developed and more details of how to run them will be included here. You can follow the progress [here](https://github.com/weaveworks/eksctl/issues/151). |
| 62 | + |
| 63 | +# Acceptance policy |
| 64 | + |
| 65 | +These things will make a PR more likely to be accepted: |
| 66 | + |
| 67 | + * a well-described requirement |
| 68 | + * tests for new code |
| 69 | + * tests for old code! |
| 70 | + * new code and tests follow the conventions in old code and tests |
| 71 | + * a good commit message (see below) |
| 72 | + |
| 73 | +In general, we will merge a PR once a maintainer has reviewed and approved it. |
| 74 | +Trivial changes (e.g., corrections to spelling) may get waved through. |
| 75 | +For substantial changes, more people may become involved, and you might get asked to resubmit the PR or divide the changes into more than one PR. |
| 76 | + |
| 77 | +### Format of the Commit Message |
| 78 | + |
| 79 | +We follow a rough convention for commit messages that is designed to answer two |
| 80 | +questions: what changed and why. The subject line should feature the what and |
| 81 | +the body of the commit should describe the why. |
| 82 | + |
| 83 | +``` |
| 84 | +Added AWS Profile Support |
| 85 | +
|
| 86 | +Changes to ensure that AWS profiles are supported. This involved making |
| 87 | +sure that the AWS config file is loaded (SharedConfigEnabled) and |
| 88 | +also making sure we have a TokenProvider set. |
| 89 | +
|
| 90 | +Added an explicit --profile flag that can be used to explicity specify |
| 91 | +which AWS profile you would like to use. This will override any profile |
| 92 | +that you have specified via AWS_PROFILE. |
| 93 | +
|
| 94 | +If endpoints are being overriden then the credentials from the initial |
| 95 | +session creation are shared with any subsequent session creation to |
| 96 | +ensure that the tokens are shared (otherwise you may get multiple MFA |
| 97 | +prompts). |
| 98 | +
|
| 99 | +Issue #57 |
| 100 | +``` |
| 101 | + |
| 102 | +The format can be described more formally as follows: |
| 103 | + |
| 104 | +``` |
| 105 | +<short title for what changed> |
| 106 | +<BLANK LINE> |
| 107 | +<why this change was made and what changed> |
| 108 | +<BLANK LINE> |
| 109 | +<footer> |
| 110 | +``` |
| 111 | + |
| 112 | +The first line is the subject and should be no longer than 70 characters, the |
| 113 | +second line is always blank, and other lines should be wrapped at 80 characters. |
| 114 | +This allows the message to be easier to read on GitHub as well as in various git tools. |
| 115 | + |
0 commit comments