Skip to content

Commit b1ad1e8

Browse files
authored
Merge pull request #654 from doitintl/feature/contributing
fix(contributions): Add Contributing file
2 parents 9789366 + 7f48f37 commit b1ad1e8

File tree

2 files changed

+202
-64
lines changed

2 files changed

+202
-64
lines changed

.github/CONTRIBUTING.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Contributing Guidelines
2+
3+
*Pull requests, bug reports, and all other forms of contribution are welcomed and highly encouraged!*
4+
5+
### Contents
6+
7+
- [Opening an Issue](#opening-an-issue)
8+
- [Feature Requests](#feature-requests)
9+
- [Triaging Issues](#triaging-issues)
10+
- [Submitting Pull Requests](#repeat-submitting-pull-requests)
11+
- [Branches](#branches)
12+
- [Writing Commit Messages](#writing-commit-messages)
13+
- [Signing Commits](#signing-commits)
14+
- [Code Review](#mark-code-review)
15+
- [Coding Style](#coding-style)
16+
- [Changelog](#changelog)
17+
- [Credits](#credits)
18+
19+
> **This guide serves to set clear expectations for everyone involved with the project. We are indebted to @stepanstipl for creating this project.**
20+
21+
## Opening an Issue
22+
23+
Before [creating an issue](https://help.github.com/en/github/managing-your-work-on-github/creating-an-issue), check if you are using the latest version of the project. If you are not up-to-date, see if updating fixes your issue first.
24+
25+
### Reporting Security Issues
26+
27+
File a public issue for security vulnerabilities. This way maintainers can quickly act to add a fix.
28+
29+
### Bug Reports and Other Issues
30+
31+
A great way to contribute to the project is to send a detailed issue when you encounter a problem.
32+
33+
- **Do not open a duplicate issue!** Search through existing issues to see if your issue has previously been reported. If your issue exists, comment with any additional information you have. You may simply note "I have this problem too", which helps prioritize the most common problems and requests.
34+
35+
- **Use [GitHub-flavored Markdown](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).** Especially put code blocks and console outputs in backticks (```). This improves readability.
36+
37+
## Feature Requests
38+
39+
Feature requests are welcome! While we will consider all requests, we cannot guarantee your request will be accepted. We want to avoid [feature creep](https://en.wikipedia.org/wiki/Feature_creep). Your idea may be great, but also out-of-scope for the project. If accepted, we cannot make any commitments regarding the timeline for implementation and release. However, you are welcome to submit a pull request to help!
40+
41+
- **Do not open a duplicate feature request.** Search for existing feature requests first. If you find your feature (or one very similar) previously requested, comment on that issue.
42+
43+
- Be precise about the proposed outcome of the feature and how it relates to existing features. Include implementation details if possible.
44+
45+
## Submitting Pull Requests
46+
47+
Before [forking the repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) and [creating a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/proposing-changes-to-your-work-with-pull-requests) for non-trivial changes, it is usually best to first open an issue to discuss the changes, or discuss your intended approach for solving the problem in the comments for an existing issue.
48+
49+
*Note: All contributions will be licensed under the project's license.*
50+
51+
- **Smaller is better.** Submit **one** pull request per bug fix or feature. A pull request should contain isolated changes pertaining to a single bug fix or feature implementation. **Do not** refactor or reformat code that is unrelated to your change. It is better to **submit many small pull requests** rather than a single large one. Enormous pull requests will take enormous amounts of time to review, or may be rejected altogether.
52+
53+
- **Coordinate bigger changes.** For large and non-trivial changes, open an issue to discuss a strategy with the maintainers. Otherwise, you risk doing a lot of work for nothing!
54+
55+
- **Prioritize understanding over cleverness.** Write code clearly and concisely. Remember that source code usually gets written once and read often. Ensure the code is clear to the reader. The purpose and logic should be obvious to a reasonably skilled developer, otherwise you should add a comment that explains it.
56+
57+
- **Follow existing coding style and conventions.** Keep your code consistent with the style, formatting, and conventions in the rest of the code base. When possible, these will be enforced with a linter. Consistency makes it easier to review and modify in the future.
58+
59+
- **Include test coverage.** Add unit tests or UI tests when possible. Follow existing patterns for implementing tests.
60+
61+
- **Add documentation.** Document your changes with code doc comments or in existing guides.
62+
63+
- **Use the repo's default branch.** Branch from and [submit your pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) to the repo's default branch `main`.
64+
65+
- **[Resolve any merge conflicts](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-on-github)** that occur.
66+
67+
- **Promptly address any CI failures**. If your pull request fails to build or pass tests, please ideally amend your current commit with a `git commit --amend` or create a new commit. Your welcome to squash them together.
68+
69+
## Branches
70+
71+
All PRs should be at the HEAD, that is to say we use merge commits with [semi-linear history](https://docs.gitlab.com/ee/user/project/merge_requests/methods/#merge-commit-with-semi-linear-history).
72+
73+
![](https://devblogs.microsoft.com/devops/wp-content/uploads/sites/6/2019/04/semilinear-1.gif)
74+
75+
If not they should be rebased on master, do not merge master into your branches. Do not create branches that already exist, please use a new name. Branches are deleted upon merging. Thank you.
76+
77+
```sh
78+
git fetch -v
79+
git checkout my-branch
80+
git rebase origin/master
81+
```
82+
83+
We also maintain an author merges policy. We will approve your pr then you can merge it.
84+
85+
Additionally we ask that you do not squash your prs or introduce a large number of commits per feature. If your pr becomes too large we may ask you to split the functionality out into more than one pr.
86+
87+
## Writing Commit Messages
88+
89+
We enforce [Conventional Commits][cc] for all commits in the form:
90+
91+
```
92+
<type>: <summary>
93+
94+
[optional body]
95+
96+
[optional footer(s)]
97+
```
98+
99+
Where type is one of:
100+
- **build** - Affects build and/or build system
101+
- **chore** - Other non-functional changes
102+
- **ci** - Affects CI (e.g. GitHub actions)
103+
- **dep** - Dependency update
104+
- **docs** - Documentation only change
105+
- **feat** - A new feature
106+
- **fix** - A bug fix
107+
- **ref** - Code refactoring without functionality change
108+
- **style** - Formatting changes
109+
- **test** - Adding/changing tests
110+
111+
[cc]: https://www.conventionalcommits.org/
112+
113+
Use imperative, present tense (Add, not ~Added~), capitalize first letter of summary, no dot at the and. The body and footer are optional. And are ignored by our release note process.
114+
115+
Relevant GitHub issues should be referenced in the footer in the form `fix(readme): Fixes #456`.
116+
117+
## Signing Commits
118+
119+
Please ensure any contributions are signed with a valid gpg key. We use this to validate that you have committed this and no one else. You can learn how to create a GPG key [here](https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key).
120+
121+
## Code Review
122+
123+
- **Review the code, not the author.** Look for and suggest improvements without disparaging or insulting the author. Provide actionable feedback and explain your reasoning.
124+
125+
- **You are not your code.** When your code is critiqued, questioned, or constructively criticized, remember that you are not your code. Do not take code review personally.
126+
127+
- **Take your time.** Please do not rush to generate functionality, we hold the code in this repo to a high standard taking your time to ensure a high quality result is appreciated.
128+
129+
- Kindly note any violations to the guidelines specified in this document.
130+
131+
## Coding Style
132+
133+
Consistency is the most important. Following the existing style, formatting, and naming conventions of the file you are modifying and of the overall project. Failure to do so will result in a prolonged review process that has to focus on updating the superficial aspects of your code, rather than improving its functionality and performance.
134+
135+
For example, if all private properties are prefixed with an underscore `_`, then new ones you add should be prefixed in the same way. Or, if methods are named using camelcase, like `thisIsMyNewMethod`, then do not diverge from that by writing `this_is_my_new_method`. You get the idea. If in doubt, please ask or search the codebase for something similar.
136+
137+
We use [pre-commit](https://pre-commit.com/) to validate the style of the code along with maintainer review. If you'd like to check that your code matches our style please run and/or install our [pre-commit](https://github.com/doitintl/kube-no-trouble/blob/master/.pre-commit-config.yaml). Branches with commits which do not pass the pre-commit will not be accepted.
138+
139+
```
140+
pip install pre-commit
141+
pre-commit run --all-files
142+
```
143+
144+
### Changelog
145+
146+
Changelog is generated automatically based on merged PRs using
147+
[git-cliff](https://git-cliff.org/). Template can be found in [cliff.toml](https://github.com/doitintl/kube-no-trouble/blob/master/cliff.toml).
148+
149+
PRs are categorized based on their conventional commit groups, into following sections, as seen in [git cliff toml file line 62](https://github.com/doitintl/kube-no-trouble/blob/master/cliff.toml#L62):
150+
- Features - group **feat** - A new feature
151+
- Fixes - group **fix** - A bug fix
152+
- Internal/Other - groups **chore** **build** **ci** **build** **dep** **docs** **ref** **style** **test** - all other changes
153+
154+
Additionally we will reference any new contributors between the release versions. See an example release note below:
155+
156+
```md
157+
#### Docker Image: ghcr.io/doitintl/kube-no-trouble:latest
158+
159+
## Changelog
160+
161+
### Features:
162+
163+
feat: Add rego for v1.32 deprecations b4da33a by @dark0dave
164+
feat: Fix github actions for creating release notes edd2dc3 by @dark0dave
165+
166+
### Fixes:
167+
168+
fix: Add docker image back 6de101d by @dark0dave
169+
fix: Add fix for git cliff 9d487c9 by @dark0dave
170+
171+
### Internal/Other:
172+
173+
dep: Bump lots of deps 7cdf86a by @dark0dave
174+
175+
#### Full Changelog: 1.0.0...2.0.0
176+
### New Contributors
177+
178+
@dark0dave made their first contribution in #1
179+
```
180+
181+
## Credits
182+
183+
Very heavenly influenced by https://github.com/jessesquires/.github, thank you so much for providing a baseline for this.
184+
185+
Modified and updated by [@dark0dave](https://github.com/dark0dave). Adopted by all maintainers.

README.md

Lines changed: 17 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,30 @@ Run the following command in your terminal to install `kubent` using a shell scr
3131
sh -c "$(curl -sSL https://git.io/install-kubent)"
3232
```
3333

34-
*(The script will download latest version and unpack to `/usr/local/bin`).*
34+
*(Unless specified the script will download latest version and unpack to `/usr/local/bin/`).*
35+
36+
> Note: Do not run random scripts from strangers on the internet. Read what the above script does first.
3537
3638
### Manual Installation
3739

3840
You can download the
3941
[latest release](https://github.com/doitintl/kube-no-trouble/releases/latest)
40-
for your platform and unpack manually.
42+
for your cpu architectures and operating system. You can then place it on your path.
43+
44+
We currently maintain, the following operating systems and cpu architectures:
45+
46+
- Linux amd64
47+
- Linux arm64
48+
- Darwin amd64
49+
- Darwin arm64
50+
- Windows amd64
51+
52+
*Historically Windows on arm, has not received the best support. If this changes we may add it.*
4153

4254
### Third-Party Installation
4355

4456
Please note that third-party installation methods are maintained by the community.
45-
The packages may not always be up-to-date with the latest releases of `kubent`.
57+
**The packages may not always be up-to-date with the latest releases of** `kubent`.
4658

4759
#### Homebrew
4860

@@ -216,7 +228,7 @@ The simplest way to build `kubent` is:
216228
git clone https://github.com/doitintl/kube-no-trouble.git
217229
cd kube-no-trouble/
218230
# Build
219-
go build -o bin/kubent cmd/kubent/main.go
231+
go build -o bin/kubent ./...
220232
```
221233

222234
Otherwise there's `Makefile`
@@ -231,65 +243,6 @@ release-artifacts Create release artifacts
231243
clean Clean build artifacts
232244
```
233245

234-
### Commit messages
235-
236-
We enforce simple version of [Conventional Commits][cc] in the form:
237-
238-
```
239-
<type>: <summary>
240-
241-
[optional body]
242-
243-
[optional footer(s)]
244-
```
245-
246-
Where type is one of:
247-
- **build** - Affects build and/or build system
248-
- **chore** - Other non-functional changes
249-
- **ci** - Affects CI (e.g. GitHub actions)
250-
- **dep** - Dependency update
251-
- **docs** - Documentation only change
252-
- **feat** - A new feature
253-
- **fix** - A bug fix
254-
- **ref** - Code refactoring without functionality change
255-
- **style** - Formatting changes
256-
- **test** - Adding/changing tests
257-
258-
[cc]: https://www.conventionalcommits.org/
259-
260-
Use imperative, present tense (Add, not ~Added~), capitalize first letter of
261-
summary, no dot at the and. The body and footer are optional. Relevant GitHub
262-
issues should be referenced in the footer in the form `Fixes #123, fixes #456`.
263-
264-
### Changelog
265-
266-
Changelog is generated automatically based on merged PRs using
267-
[changelog-gen][chlg-gen]. Template can be found in `scripts/changelog.tmpl`.
268-
269-
PRs are categorized based on their labels, into following sections:
270-
- Announcements - `announcement` label
271-
- Breaking Changes - `breaking-change` label
272-
- Features - `feature` label
273-
- Changes - `change` label
274-
- Fixes - `fix` label
275-
- Internal/Other - everything else
276-
277-
PR can be excluded from changelog with `no-release-note` label. PR title is
278-
used by default, however, the copy can be customized by including following
279-
block in the PR body:
280-
281-
~~~
282-
```release-note
283-
This is an example release note!
284-
```
285-
~~~
286-
287-
[chlg-gen]: https://github.com/paultyng/changelog-gen
288-
289246
## Issues and Contributions
290247

291-
Please open any issues and/or PRs against github.com/doitintl/kube-no-trouble repository.
292-
293-
Please ensure any contributions are signed with a valid gpg key. We use this to validate that you have committed this and no one else. You can learn how to create a GPG key [here](https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key).
294-
295-
Feedback and contributions are always welcome!
248+
Please open any issues and/or PRs against github.com/doitintl/kube-no-trouble repository. See our [contribution guide](.github/CONTRIBUTING.md) for more details

0 commit comments

Comments
 (0)