Contributions to this Package are very welcome! We follow a fairly standard pull request process for contributions, subject to the following guidelines:
- File a GitHub issue
- Update the documentation
- Update the tests
- Update the code
- Create a pull request
- Merge and release
Before starting any work, we recommend filing a GitHub issue in this repo. This is your chance to ask questions and get feedback from the maintainers and the community before you sink a lot of time into writing (possibly the wrong) code. If there is anything you're unsure about, just ask!
We recommend updating the documentation before updating any code (see Readme Driven Development). This ensures the documentation stays up to date and allows you to think through the problem at a high level before you get lost in the weeds of coding.
We also recommend updating the automated tests before updating any code (see Test Driven Development). That means you add or update a test case, verify that it's failing with a clear error message, and then make the code changes to get that test to pass. This ensures the tests stay up to date and verify all the functionality in this Module, including whatever new functionality you're adding in your contribution. Check out the tests folder for instructions on running the automated tests.
At this point, make your code changes and use your new test case to verify that everything is working. As you work, keep in mind two things:
- Backwards compatibility
- Downtime
Please make every effort to avoid unnecessary backwards incompatible changes. With Helm charts, this means:
- Do not delete, rename, or change the type of input variables.
- If you add an input variable, set a default in
values.yaml
. - Do not delete, rename, or change the type of output variables.
- Do not delete or rename a chart in the
charts
folder.
If a backwards incompatible change cannot be avoided, please make sure to call that out when you submit a pull request, explaining why the change is absolutely necessary.
Bear in mind that the Helm charts in this Module are used by real companies to run real infrastructure in production, and certain types of changes could cause downtime. If downtime cannot be avoided, please make sure to call that out when you submit a pull request.
We follow the official Chart best practices documented by the community. Please read through the guidelines if you have not already.
Additionally, Gruntwork has a few extra guidelines not stated in the best practices guide:
- Chart
values.yaml
should separate required inputs from optional inputs. Required inputs should be documented as comments. - Provide example required inputs in a separate
linter_values.yaml
file so thathelm lint
can be used to lint the charts. - Any input value that is rendered directly in the yaml templates (using
toYaml
) should be explicitly called out in thevalues.yaml
file. - Any input value that is a map should explicitly call out the expected fields. Additionally, the fields should be labeled by type and whether or not the value is required.
- Any required input that is a map, or optional input that is a map with an empty default, should have an example in the comments.
- Every chart should have both helm tests and terratests. The helm tests test if the chart came up successfully in an install, while the terratest is used for integration testing of the chart before releasing the chart.
You must run helm lint
on the code before committing. You can configure your computer to do this automatically
using pre-commit hooks managed using pre-commit:
- Install pre-commit. E.g.:
brew install pre-commit
. - Install the hooks:
pre-commit install
. - Make sure you have the helm client installed. See the official docs for instructions.
Now write your code, and every time you commit, helm lint
will be run on the charts that you modify.
Create a pull request with your changes. Please make sure to include the following:
- A description of the change, including a link to your GitHub issue.
- The output of your automated test run, preferably in a GitHub Gist. We cannot run automated tests for pull requests automatically due to security concerns, so we need you to manually provide this test output so we can verify that everything is working.
- Any notes on backwards incompatibility or downtime.
The maintainers for this repo will review your code and provide feedback. If everything looks good, they will merge the code and release a new version, which you'll be able to find in the releases page.