Skip to content

Commit 25c7e17

Browse files
committed
add pr rules, fix script
1 parent 63329d1 commit 25c7e17

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

CONTRIBUTING.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,39 @@ cd kustomize
7575
git push origin myfeature
7676
```
7777

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 maintainer to justify `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+
78103
### Create a Pull Request
104+
79105
1. Visit your fork at `https://github.com/<user>/kustomize`
80106
2. Click the **Compare & Pull Request** button next to your `myfeature` branch.
81107
3. Check out the pull request [process](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md) for more details and advice.
82108

83109
If you ran `git push` in the previous step, GitHub will return a useful link to create a Pull Request.
84110

85-
86111
### Build Kustomize
87112
The [Kustomize Architecture] document describes the respository organization and the kustomize build process.
88113
```bash

releasing/check-release-helper.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,21 @@ git log "${LATEST_TAG}..HEAD" --oneline | tee /tmp/release-changelogs.txt
1515

1616
count=$(cat /tmp/release-changelogs.txt | wc -l)
1717

18-
if [[ $(cat /tmp/release-changelogs.txt | grep fix) || $(cat /tmp/release-changelogs.txt | grep patch) || $(cat /tmp/release-changelogs.txt | grep chore) ]]; then
18+
if [[ $(cat /tmp/release-changelogs.txt | grep fix) || $(cat /tmp/release-changelogs.txt | grep patch) || $(cat /tmp/release-changelogs.txt | grep chore) || $(cat /tmp/release-changelogs.txt | grep docs) ]]; then
1919
PATCH=true
2020
fi
2121

2222
if [[ $(cat /tmp/release-changelogs.txt | grep feat) ]]; then
2323
MINOR=true
2424
fi
2525

26+
for commit in $(cut -d' ' -f1 /tmp/release-changelogs.txt); do
27+
git log --format=%B -n 1 $commit | grep "BREAKING CHANGE"
28+
if [ $? -eq 0 ]; then
29+
MAJOR=true
30+
fi
31+
done
32+
2633
for f in $(find api); do
2734
git diff "${LATEST_TAG}...${ORIGIN_MASTER}" --exit-code -- "${f}"
2835
if [ $? -eq 1 ]; then

0 commit comments

Comments
 (0)