Debian Codegraph @

CONTRIBUTING.md

raw
1 [SIG-CLI]: https://github.com/kubernetes/community/tree/master/sig-cli
2 [Slack channel]: https://kubernetes.slack.com/messages/kustomize
3 [Mailing list]: https://groups.google.com/forum/#!forum/kubernetes-sig-cli
4
5 [OWNERS file spec]: https://github.com/kubernetes/community/blob/master/contributors/guide/owners.md
6 [Kustomize OWNERS_ALIASES]: https://github.com/kubernetes-sigs/kustomize/blob/8049f7b1af52e8a7ec26faf6cf714f560d0043c5/OWNERS_ALIASES
7 [SIG-CLI Teams]: https://github.com/kubernetes/org/blob/main/config/kubernetes-sigs/sig-cli/teams.yaml
8 [Github permissions]: https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization#repository-access-for-each-permission-level
9
10 [Contributor License Agreement]: https://git.k8s.io/community/CLA.md
11 [Kubernetes Contributor Guide]: http://git.k8s.io/community/contributors/guide
12 [Contributor Cheat Sheet]: https://git.k8s.io/community/contributors/guide/contributor-cheatsheet/README.md
13 [CNCF Code of Conduct]: https://github.com/cncf/foundation/blob/master/code-of-conduct.md
14 [Kubernetes Community Membership]: https://github.com/kubernetes/community/blob/master/community-membership.md
15
16 [Kustomize Architecture]: ARCHITECTURE.md
17 [Contribution Guide]: https://kubectl.docs.kubernetes.io/contributing/kustomize/
18 [MacOS Dev Guide]: https://kubectl.docs.kubernetes.io/contributing/kustomize/mac/
19 [Windows Dev Guide]: https://kubectl.docs.kubernetes.io/contributing/kustomize/windows/
20
21 # Contributing Guidelines
22
23 Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the [CNCF Code of Conduct]. Here is an excerpt:
24
25 _As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._
26
27 ## Getting Started
28
29 ### Forking Kustomize and Working Locally
30 The Kustomize project uses a "Fork and Pull" workflow that is standard to GitHub. In git terms, your personal fork is referred to as the "origin" and the actual project's git repository is called "upstream". To keep your personal branch (origin) up to date with the project (upstream), it must be configured within your local working copy.
31
32 ### Create a fork in GitHub
33 1. Visit https://github.com/kubernetes-sigs/kustomize
34 2. Click the `Fork` button on the top right
35
36 ### Clone the repository
37 ```bash
38 # Clone your repository fork from the previous step
39 git clone --recurse-submodules [email protected]:<your github username>/kustomize.git
40 cd kustomize
41
42 # Configure upstream
43 git remote add upstream https://github.com/kubernetes-sigs/kustomize
44 git remote set-url --push upstream no_push
45
46 # Review git configuration
47 git remote -v
48 ```
49
50 ### Create a working branch
51 ```bash
52 # Fetch changes from upstream master
53 cd kustomize
54 git fetch upstream
55 git checkout master
56 git rebase upstream/master
57
58 # Create your working branch
59 git checkout -b myfeature
60 ```
61
62 ### Sync your working branch
63 You will need to periodically fetch changes from the `upstream` repository to keep your working branch in sync.
64 ```bash
65 cd kustomize
66 git fetch upstream
67 git checkout myfeature
68 git rebase upstream/master
69 ```
70
71 ### Push to GitHub
72 When your changes are ready for review, push your working branch to your fork on GitHub.
73 ```bash
74 cd kustomize
75 git push origin myfeature
76 ```
77
78 ### Pull Request Rules
79
80 We are using [Conventional Commits v1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) as the main guideline of making PR. This guideline serves to help contributor and maintainer to classify their changes, thus providing better insight on type of release will be covered on each Kustomize release cycle.
81
82 1. Please add these keywords on your PR titles accordingly
83
84 | Keyword | Description | Example |
85 | ------------- | ------------- | ------------- |
86 | fix | Patching or fixing bugs or improvements introduction from previous release. This type of change will mark a `PATCH` release. | fix: fix null value when generating yaml |
87 | feat | New features. This change will mark a `MINOR` release. | feat: new transformer and generator for ACME API CRD. |
88 | chore | Minor improvement outside main code base | chore: add exclusion for transformer test. |
89 | ci | CI/CD related changes (e.g. github workflow, scripts, CI steps). | ci: remove blocking tests |
90 | docs | Changes related to documentation. | docs: add rules documentation for PR. |
91
92
93 2. Add `BREAKING CHANGE:` on your commit message as footer to signify breaking changes. This will help maintainers identify `MAJOR` releases.
94
95 Example:
96
97 ```
98 feat: change YAML parser from `yaml/v1` to `yaml/v2`
99
100 BREAKING CHANGE: parse() function now works with 2 arguments.
101 ```
102
103 ### Create a Pull Request
104
105 1. Visit your fork at `https://github.com/<user>/kustomize`
106 2. Click the **Compare & Pull Request** button next to your `myfeature` branch.
107 3. Check out the pull request [process](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md) for more details and advice.
108
109 If you ran `git push` in the previous step, GitHub will return a useful link to create a Pull Request.
110
111 ### Build Kustomize
112 The [Kustomize Architecture] document describes the respository organization and the kustomize build process.
113 ```bash
114 # For go version >= 1.13
115 unset GOPATH
116 unset GO111MODULES
117
118 # Build kustomize binary and install in go bin path
119 cd kustomize
120 make kustomize
121
122 # Run unit tests
123 make test-unit-all
124
125 # Run linter
126 make lint
127
128 # Test examples against HEAD
129 make test-examples-kustomize-against-HEAD
130
131 # Run your development version
132 ~/go/bin/kustomize version
133 ```
134
135 ### General resources for contributors
136
137 - [Contributor License Agreement] - Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests.
138 - [Kubernetes Contributor Guide] - Main contributor documentation.
139 - [Contributor Cheat Sheet] - Common resources for existing developers.
140
141 Here are some additional ideas to help you get started with Kustomize:
142 - Attend a Kustomize Bug Scrub. Check the [SIG-CLI] meetings list to find the next one.
143 - Help triage issues by confirming validity and applying the appropriate `kind` label (e.g. comment `/kind bug`).
144 - Pick up an issue to fix. Issues with the `help-wanted` label are a good place to start, but you can also look for any issue with the `triage/accepted` label and no assignee. Remember to `/assign` yourself to let others know you're working on it.
145 - Help confirm new issues labelled `kind/bug` by reproducing them with the latest release.
146 - Support Kustomize users by responding to questions on issues labelled `kind/support` or in the [Slack channel].
147
148 ## Mentorship
149
150 - [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers!
151
152 ## Contributor Ladder
153
154 Kustomize follows the [Kubernetes Community Membership] contributor ladder. Roles are as follows:
155
156 1. Contributor: Anyone who actively contributes code, issues or reviews to the project. All contributors must sign the [Contributor License Agreement].
157 1. Reviewer: Contributors with a history of review and authorship on Kustomize. Has LGTM rights on the Kustomize repo (as do all kubernetes-sigs org members). Active contributors are encouraged to join the reviewers list to be automatically pinged on PRs.
158 1. Approver: Highly experienced active reviewer and contributor to Kustomize. Has both LTGM and approval rights on the Kustomize repo, as well as "maintain" [Github permissions].
159 1. Owner: Approver who sets technical direction and makes or approves design decisions for the project. Has LGTM and approval rights on the Kustomize repo as well as "admin" [Github permissions].
160
161 The kyaml module within the Kustomize repo has additional owners following the same ladder.
162
163 For the kustomize project, we have defined some specific guidelines on each step of the ladder:
164
165 To reach reviewer status, you must:
166 - Have been actively involved in kustomize for 3+ months
167 - Review at least 8 PRs that have been driven through to completion (see the reviewer guide below)
168 - Author at least 5 PRs that have been approved and merged
169 - Be a member of the kubernetes-sigs org. This should not be a blocker though, as once you meet the requirements for reviewer here,
170 the existing kustomize maintainers will be happy to sponsor your request to join the kubernetes-sigs org.
171 - Once you have met the above requirements, you may submit a PR adding yourself to the kustomize reviewers list, with links to your
172 contributions in the description.
173
174 To reach approver status, you must:
175 - Meet all the requirements of a reviewer
176 - Have been actively involved in kustomize for 6+ months
177 - Review at least 15 PRs that have been driven through to completion (see the reviewer guide below)
178 - Authored PRs meeting *either* of the following requirements:
179 - 15 PRs that have been approved and merged
180 - *OR* 10 PRs that have been approved and merged where some were more difficult, required greater thought/design,
181 or built up to larger features/long-term goals.
182 - File 3 issues. This can be any number of things, including but not limited to:
183 - Bugs with kustomize usage that you've found
184 - CI or release improvements
185 - Creating subtasks of a larger feature or project that you are in charge of.
186 - Long term improvements for the health of the project
187 - Triage at least 10 untriaged issues, including at least 1 feature request. The kustomize bug scrub is a great place to get practice with doing this, but you can
188 also follow the triage guide below to get started on your own.
189 - Demonstrate deeper understanding of kustomize goals. This can take many forms and is a bit subjective, but here are a few examples:
190 - saying no to an eschewed feature, instead recommending an alternative solution that is more aligned with the declarative configuration model
191 - active participation in discussion on a feature request issue
192 - filing an issue describing a long term problem and solution aligned with kustomize goals, for example: https://github.com/kubernetes-sigs/kustomize/issues/5140
193 - writing up KEPs for features that will improve the kustomize workflow while being aligned with kustomize goals, for example: https://github.com/kubernetes-sigs/kustomize/pull/4558
194 - Regularly interact with the existing kustomize maintainers, with clear communication about what you are working on or planning to work on. The kustomize
195 maintainers should know who you are and be familiar with your contributions.
196 - If you meet *most* of the above requirements while going above and beyond in a few areas, we will still consider your request to become an approver even
197 if you are missing one or two of the requirements. Please contact the maintainers directly to ask about getting approver status if you fall into this category.
198 - Otherwise, once you meet all the above requirements, you may:
199 - request to be added to the kustomize maintainer meeting that occurs each week with the kustomize PMs.
200 - submit a PR adding yourself to the kustomize approvers list, with links to your contributions in the description.
201
202 To reach owner status, you must:
203 - Meet all the requirements of an approver
204 - Have been actively involved with kustomize for 1+ year
205 - Assisted the current owner in driving the roadmap. This can be explicit or implicit help, such as:
206 - Editing the roadmap directly
207 - Reviewing the roadmap
208 - Providing suggestions for issues or prioritization in meetings that indirectly influence the roadmap
209 - Regularly triage issues and attend the kustomize bug scrub
210 - Regularly review PRs (1-2 a week)
211 - Periodically lead the kustomize bug scrub
212 - Periodically release kustomize (ensuring that there are no release blockers and that release notes are clean)
213 - Be the primary owner or point of contact for a particular project or area of code
214 - Ideally, there should be 2-3 owners at a time. Reach out to the current owners if you are interested in ownership. These
215 requirements are not strict and evaluation is somewhat subjective.
216
217 ## Reviewer guide
218 Please watch this talk on how to review code from Tim Hockin: https://www.youtube.com/watch?v=OZVv7-o8i40
219
220 For reviewing PRs in kustomize, we have some specific guidelines:
221 - If the PR is introducing a new feature:
222 - *It must be implementing an issue that has already been triage/accepted or
223 a KEP that has been approved.* If it is not, then request the PR author to first file an issue.
224 - The PR must include thorough tests for the new feature, including unit and integration tests
225 - The code must be clean and readable, with thought given to how we will maintain the code in the future
226 - If the feature requires being broken up into multiple PRs to ease review, the feature should not be exposed to users
227 until the feature is completed in the last PR. For example, while we were building `kustomize localize`, we
228 built the feature almost entirely under the `api` module as a library with all the needed tests. There was no way
229 for users to invoke the localize code until the last PR that actually exposed the `kustomize localize` command in the
230 kustomize binary. This allowed us to continue development of `kustomize localize` without blocking kustomize releases.
231 If this type of development is not possible, then new features requiring multiple PRs should be
232 developed in their own feature branch.
233 - If the PR is introducing a bug fix:
234 - If the PR is not fixing an issue that has already been triage/accepted, follow the triage guide below on bug
235 fixes to decide if this is a PR we want to accept.
236 - The PR should have two distinct commits:
237 - The first commit should add a test demonstrating incorrect behavior
238 - The second commit should include the bug fix
239 - Some sample PRs:
240 - https://github.com/kubernetes-sigs/kustomize/pull/5263/commits
241 - https://github.com/kubernetes-sigs/kustomize/pull/3931/commits
242 - The regression test is absolutely required, and we cannot accept bug fixes without tests.
243 - If the PR is introducing a performance improvement:
244 - The PR description should give an indication of how much the performance is being improved and how we
245 can measure it - benchmark tests are fantastic.
246 - Other PRs (documentation, CI improvements, etc.) should be reviewed based on your best judgment.
247
248 ## Triage guide
249 The possible triage labels are listed here: https://github.com/kubernetes-sigs/kustomize/labels?q=triage.
250
251 Triaging a feature request means:
252 - Understand what the user is asking for, and their use case.
253 - Verify that it is not an [eschewed feature](https://kubectl.docs.kubernetes.io/faq/kustomize/eschewedfeatures/#build-time-side-effects-from-cli-args-or-env-variables)
254 - Verify that it is not a duplicate issue.
255 - Look into workarounds. Is there another way that the user can achieve their use case with existing features?
256 - If you are new to this role, prior to leaving a comment on the issue, please bring it to weekly standup
257 for group discussion to make sure that we are all on the same page.
258 - Once you feel ready, you can label it with a triage label. Here's an [example](https://github.com/kubernetes-sigs/kustomize/issues/5049). You can also
259 look at other feature request issues to see how they were triaged and resolved. There are a few different triage labels that you can use, you can see the
260 full list [here](https://github.com/kubernetes-sigs/kustomize/labels?q=triage).
261
262 Triaging a bug means:
263 - First, verify that you can reproduce the issue. If you cannot reproduce the issue or need more information to give
264 it a go, triage it accordingly.
265 - Try to understand if this is really a bug or if this is intended behavior from kustomize. If it seems like intended
266 behavior, do your best to explain to the user why this is the case.
267 - If it seems to be a genuine bug, you can /triage accept the issue. In addition, investigate if there are workarounds or
268 alternative solutions for the user that they can try until the issue gets resolved.
269
270 The triage party for kustomize is here https://cli.triage.k8s.io/s/kustomize and can be a easy way to
271 find issues that have not been triaged yet.
272
273 ## Project/Product Managers
274
275 Kustomize will have opportunities to join in a project/product manager role. You can reach out to
276 the existing kustomize maintainers if you are interested in this type of role. Project management work
277 can greatly help supplement your contributions as you climb from reviewer to approver
278 to owner.
279
280 Expectations for this role are:
281
282 - Triage 1 feature request each week, and bring it to weekly stand-up for discussion. Feature
283 requests are issues labeled kind/feature, and you can find them [here](https://github.com/kubernetes-sigs/kustomize/issues?q=is%3Aissue+is%3Aopen+kind+feature+label%3Akind%2Ffeature).
284 Please view the above triage guide for details on how to approach feature request triage.
285 - Monitor the kustomize Slack channel and try to help users if you can. It is a pretty
286 active channel, so responding to 4-5 users per week is sufficient even if some
287 questions go unanswered. If there is an interesting topic or a recurring problem that many
288 users are having, please bring it up in weekly stand-up.
289 - Keeping track of a queue of backlog issues or PRs that are not being actively looked at in any existing project board.
290 - Organizing or reorganizing project tracking boards when it makes sense.
291
292 You will also be asked to help with roadmap planning, deprecation communication, prioritization,
293 and doing research on kustomize usage when appropriate, though these responsibilities will occur less
294 frequently.
295
296 ## Administrative notes:
297
298 - The [OWNERS file spec] is a useful resources in making changes.
299 - Maintainers and admins must be added to the appropriate lists in both [Kustomize OWNERS_ALIASES] and [SIG-CLI Teams]. If this isn't done, the individual in question will lack either PR approval rights (Kustomize list) or the appropriate Github repository permissions (community list).
300
301 ## Contact Information
302
303 - [Slack channel]
304 - [Mailing list]