1
1
# Contributing to kpt-functions-catalog
2
2
3
- We'd love to accept your contributions to this project. There are
4
- just a few small guidelines you need to follow.
3
+ We'd love to accept your contributions to this project. There are just a few
4
+ small guidelines you need to follow.
5
5
6
- ## Community Guidelines
7
-
8
- This project follows [ Google's Open Source Community Guidelines]
9
- and a [ Code of Conduct] .
10
-
11
- ## How to Contribute
12
-
13
- This catalog contains configuration functions to fetch, display, customize,
14
- update, validate, and apply Kubernetes configuration. Contribute functions
15
- to this catalog by making the following changes:
16
-
17
- 1 . Make the code changes implementing the function and any unit tests. The code
18
- belongs under [ functions/] in the appropriate directory.
19
- 2 . Create an example of how to run your function and put it under [ examples/] .
20
- 3 . Test running your function example imperatively and declaratively in
21
- [ e2e tests] . These tests are run regularly and help catch regressions.
22
- 4 . Document your function in the config functions catalog on the [ kpt website]
23
- by following the [ kpt contribution guidelines] .
24
- 5 . Reach out to the maintainers to publish the function.
25
-
26
- Make PRs and request reviews for these changes. You can follow the pull request
27
- changes below:
28
-
29
- * [ function implementation PR]
30
- * [ example and e2e test PR]
31
- * [ catalog documentation PR]
32
-
33
- ### Code Changes
34
-
35
- #### Contributor License Agreement
6
+ ## Contributor License Agreement
36
7
37
8
Contributions to this project must be accompanied by a Contributor License
38
9
Agreement. You (or your employer) retain the copyright to your contribution;
@@ -44,38 +15,117 @@ You generally only need to submit a CLA once, so if you've already submitted
44
15
one (even if it was for a different project), you probably don't need to do it
45
16
again.
46
17
47
- #### Code reviews
18
+ ## Code reviews
48
19
49
20
All submissions, including submissions by project members, require review. We
50
- use GitHub pull requests for this purpose. Consult
51
- [ GitHub Help] ( https://help.github.com/articles/about-pull-requests/ ) for more
21
+ use GitHub pull requests for this purpose. Consult [ GitHub Help] for more
52
22
information on using pull requests.
53
23
54
- ### Documentation Changes
24
+ ## Community Guidelines
55
25
56
- This catalog is documented on the [ kpt website ] . Follow the
57
- [ kpt contribution guidelines ] to make docs changes .
26
+ This project follows [ Google's Open Source Community Guidelines ] and
27
+ a [ Code of Conduct ] .
58
28
59
- Changes to other documentation such as examples and README files can follow the
60
- same pull request format as code changes.
29
+ ## Style Guides
30
+
31
+ Contributions are required to follow these style guides:
32
+
33
+ - [ Error Message Style Guide]
34
+ - [ Documentation Style Guide]
35
+
36
+ ## How to Contribute
37
+
38
+ ### Repo Layout
39
+
40
+ ``` shell
41
+ ├── examples: Home for all function examples
42
+ │ ├── contrib: Home for all contrib function examples
43
+ │ ├── curated_function_bar_example
44
+ │ └── curated_function_foo_example
45
+ ├── functions
46
+ │ ├── contrib: Home for all contrib function source code
47
+ │ │ └── ts: Home for all typescript-based contrib function source code
48
+ │ │ ├── Makefile
49
+ │ │ └── contrib_ts_function_foo
50
+ │ ├── go: Home for all golang-based curated function source code
51
+ │ │ ├── Makefile
52
+ │ │ ├── curated_go_function_bar
53
+ │ │ └── curated_go_function_foo
54
+ │ └── ts: Home for all typescript-based curated function source code
55
+ │ ├── Makefile
56
+ │ ├── curated_ts_function_bar
57
+ │ └── curated_ts_function_foo
58
+ ├── scripts
59
+ └── tests: Home for e2e tests
60
+ ```
61
+
62
+ For each function, its files spread in the follow places:
63
+
64
+ - ` functions/ ` directory: Each function must have its own directory in one
65
+ of ` functions/ ` sub-directory. In each function's directory, it must have
66
+ the following:
67
+ - Source code (and unit tests).
68
+ - A README.md file serving as the usage doc and will be shown in
69
+ the [ catalog website] .
70
+ - golang-based functions should follow [ this template] [ golang-template ] .
71
+ - typescript-based functions should follow [ this template] [ ts-template ] .
72
+ - A metadata.yaml file that follows the function metadata schema.
73
+ - A Dockerfile to build the docker container.
74
+ - ` examples/ ` directory: It contains examples for functions, and these examples
75
+ are also being tested as e2e tests. Each function should have at least one
76
+ example here. There must be a README.md file in each example directory, and it
77
+ should follow the [ template] [ example-template ] .
78
+ - The ` tests/ ` directory contains additional e2e tests.
79
+
80
+ ### E2E Tests
81
+
82
+ The e2e tests are the recommended way to test functions in the catalog. They are
83
+ very easy to write and set up with our [ e2e test harness] .
84
+
85
+ You can choose to put the e2e test in either the ` examples/ ` directory or in the
86
+ ` tests/ ` directory depending on if it is worthwhile to be shown as an example.
87
+
88
+ ### Change Existing Functions
89
+
90
+ You must follow the layout convention when you make changes to existing
91
+ functions.
92
+
93
+ If you implement a new feature, you must add a new example or modify existing
94
+ one to cover it.
95
+
96
+ If you fix a bug, you must add (unit or e2e) tests to cover that.
97
+
98
+ ### Contribute New Functions
99
+
100
+ You must follow the layout convention when you contribute new functions.
61
101
62
102
## Contact Us
63
103
64
- Do you need a review or release of configuration functions? We’d love to hear
65
- from you!
104
+ Do you need a review or release of functions? We’d love to hear from you!
66
105
67
106
* Message our [ Slack channel]
68
107
* Join our [ email list]
69
108
70
109
[ Google's Open Source Community Guidelines ] : https://opensource.google.com/conduct/
110
+
71
111
[ Code of Conduct ] : CODE_OF_CONDUCT.md
72
- [ kpt website ] : https://googlecontainertools.github.io/kpt/guides/consumer/function/
73
- [ kpt contribution guidelines ] : https://github.com/GoogleContainerTools/kpt/blob/master/CONTRIBUTING.md#adding-or-updating-catalog-functions
74
- [ functions/ ] : functions/
75
- [ examples/ ] : examples/
76
- [ e2e tests ] : tests/e2e.sh
77
- [ function implementation PR ] : https://github.com/GoogleContainerTools/kpt-functions-catalog/pull/61/
78
- [ example and e2e test PR ] : https://github.com/GoogleContainerTools/kpt-functions-catalog/pull/71
79
- [ catalog documentation PR ] : https://github.com/GoogleContainerTools/kpt/pull/785/
112
+
113
+ [ catalog website ] : https://catalog.kpt.dev/
114
+
115
+ [ e2e test harness ] : https://pkg.go.dev/github.com/GoogleContainerTools/kpt@v1.0.0-beta.2/pkg/test/runner
116
+
117
+ [ golang-template ] : https://raw.githubusercontent.com/GoogleContainerTools/kpt-functions-catalog/master/functions/go/_template/README.md
118
+
119
+ [ ts-template ] : https://raw.githubusercontent.com/GoogleContainerTools/kpt-functions-catalog/master/functions/ts/_template/README.md
120
+
121
+ [ example-template ] : https://raw.githubusercontent.com/GoogleContainerTools/kpt-functions-catalog/master/examples/_template/README.md
122
+
80
123
[ Slack channel ] : https://kubernetes.slack.com/channels/kpt/
124
+
81
125
[ email list ] : https://groups.google.com/forum/?oldui=1#!forum/kpt-users
126
+
127
+ [ error message style guide ] : https://github.com/GoogleContainerTools/kpt/blob/main/docs/style-guides/errors.md
128
+
129
+ [ documentation style guide ] : https://github.com/GoogleContainerTools/kpt/blob/main/docs/style-guides/docs.md
130
+
131
+ [ GitHub Help ] : https://help.github.com/articles/about-pull-requests/
0 commit comments