@@ -10,19 +10,22 @@ https://help.github.com/articles/about-pull-requests/) for contributions, subjec
10101 . [ Create a pull request] ( #create-a-pull-request )
11111 . [ Merge and release] ( #merge-and-release )
1212
13+
1314## File a GitHub issue
1415
1516Before starting any work, we recommend filing a GitHub issue in this repo. This is your chance to ask questions and
1617get feedback from the maintainers and the community before you sink a lot of time into writing (possibly the wrong)
1718code. If there is anything you're unsure about, just ask!
1819
20+
1921## Update the documentation
2022
2123We recommend updating the documentation * before* updating any code (see [ Readme Driven
2224Development] ( http://tom.preston-werner.com/2010/08/23/readme-driven-development.html ) ). This ensures the documentation
2325stays up to date and allows you to think through the problem at a high level before you get lost in the weeds of
2426coding.
2527
28+
2629## Update the tests
2730
2831We also recommend updating the automated tests * before* updating any code (see [ Test Driven
@@ -33,6 +36,7 @@ functionality you're adding in your contribution. Check out the
3336[ tests] ( https://github.com/gruntwork-io/helm-kubernetes-services/tree/master/test ) folder for instructions on running
3437the automated tests.
3538
39+
3640## Update the code
3741
3842At this point, make your code changes and use your new test case to verify that everything is working. As you work,
@@ -59,6 +63,25 @@ Bear in mind that the Helm charts in this Module are used by real companies to r
5963production, and certain types of changes could cause downtime. If downtime cannot be avoided, please make sure to call
6064that out when you submit a pull request.
6165
66+ ### Code style
67+
68+ We follow [ the official Chart best practices] ( https://docs.helm.sh/chart_best_practices/ ) documented by the community.
69+ Please read through the guidelines if you have not already.
70+
71+ Additionally, Gruntwork has a few extra guidelines not stated in the best practices guide:
72+
73+ - Chart ` values.yaml ` should separate required inputs from optional inputs. Required inputs should be documented as
74+ comments.
75+ - Provide example required inputs in a separate ` linter_values.yaml ` file so that ` helm lint ` can be used to lint the
76+ charts.
77+ - Any input value that is rendered directly in the yaml templates (using ` toYaml ` ) should be explicitly called out in
78+ the ` values.yaml ` file.
79+ - Any input value that is a map should explicitly call out the expected fields. Additionally, the fields should be
80+ labeled by type and whether or not the value is required.
81+ - Any required input that is a map, or optional input that is a map with an empty default, should have an example in the
82+ comments.
83+ - Every chart should have both helm tests and terratests. The helm tests test if the chart came up successfully in an
84+ install, while the terratest is used for integration testing of the chart before releasing the chart.
6285
6386### Formatting and pre-commit hooks
6487
@@ -70,7 +93,7 @@ using pre-commit hooks managed using [pre-commit](http://pre-commit.com/):
70931 . Make sure you have the helm client installed. See [ the official docs] ( https://docs.helm.sh/using_helm/#install-helm )
7194 for instructions.
7295
73- That's it! Now just write your code, and every time you commit, ` helm lint ` will be run on the charts that you modify.
96+ Now write your code, and every time you commit, ` helm lint ` will be run on the charts that you modify.
7497
7598
7699## Create a pull request
@@ -85,6 +108,7 @@ to include the following:
85108 test output so we can verify that everything is working.
861091 . Any notes on backwards incompatibility or downtime.
87110
111+
88112## Merge and release
89113
90114The maintainers for this repo will review your code and provide feedback. If everything looks good, they will merge the
0 commit comments