Skip to content

Commit 6554cc9

Browse files
authored
[auto-label, documentation] Automatically add labels parsed from PR titles & Add commit signing section to 'Development Setup' in CONTRIBUTING.md (CloudPirates-io#307)
[documentation, auto-label] Add commit signing section to 'Development Setup' in CONTRIBUTING.md & Automatically add labels contained in PR titles
1 parent 07101fe commit 6554cc9

File tree

5 files changed

+75
-14
lines changed

5 files changed

+75
-14
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ body:
5656
- universal
5757
- clusterpirate
5858
- common
59+
- etcd
5960
- ghost
6061
- keycloak
6162
- mariadb
@@ -68,6 +69,7 @@ body:
6869
- redis
6970
- timescaledb
7071
- valkey
72+
- wordpress
7173
- zookeeper
7274
validations:
7375
required: true

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ body:
4545
- universal
4646
- clusterpirate
4747
- common
48+
- etcd
4849
- ghost
4950
- keycloak
5051
- mariadb
@@ -57,4 +58,5 @@ body:
5758
- redis
5859
- timescaledb
5960
- valkey
61+
- wordpress
6062
- zookeeper

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
- Describe the scope of your change - i.e. what the change does.
55
- Describe any known limitations with your change.
66
- Please run any tests or examples that can exercise your modified code.
7+
- Labels are automatically applied when they are inside the square brackets of your PR title on opening. Examples:
8+
- [redis]: adds `redis` label
9+
- [redis, valkey] Adds `redis` and `valkey` labels
710
811
Thank you for contributing! We will try to test and integrate the change as soon as we can.
912
-->
@@ -23,6 +26,7 @@
2326
### Applicable issues
2427

2528
<!-- Enter any applicable Issues here (You can reference an issue using #) -->
29+
2630
- fixes #
2731

2832
### Additional information
@@ -33,6 +37,6 @@
3337

3438
<!-- [Place an '[X]' (no spaces) in all applicable fields. Please remove unrelated fields.] -->
3539

36-
- [ ] Chart version bumped in `Chart.yaml` according to [semver](http://semver.org/). This is *not necessary* when the changes only affect README.md files.
40+
- [ ] Chart version bumped in `Chart.yaml` according to [semver](http://semver.org/). This is _not necessary_ when the changes only affect README.md files.
3741
- [ ] Variables are documented in the values.yaml and added to the `README.md`
3842
- [ ] Title of the pull request follows this pattern [<name_of_the_chart>] Descriptive title

.github/workflows/auto-label.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,39 @@ name: Auto-label issues
22
on:
33
issues:
44
types: [opened]
5+
pull_request:
6+
types: [opened]
57

68
jobs:
79
label:
810
runs-on: ubuntu-latest
911
permissions:
1012
issues: write
13+
pull-requests: write
1114
steps:
1215
- name: Apply labels
1316
uses: actions/github-script@v7
1417
with:
1518
script: |
16-
const labels = (context.payload.issue.body.split(/### Affected Helm charts/)[1] || "")
19+
let content = "";
20+
if (context.payload.pull_request) {
21+
const parsedTitle = context.payload.pull_request.title.match(/^\[([a-z_-]+(?:, [a-z_-]+)*)\].+$/);
22+
content = parsedTitle ? parsedTitle[1] : "";
23+
} else {
24+
content = context.payload.issue.body.split(/### Affected Helm charts/)[1] || "";
25+
}
26+
const { data } = await github.rest.issues.listLabelsForRepo({
27+
...context.repo,
28+
per_page: 100,
29+
});
30+
const existingLabels = new Set(data.map((label) => label.name));
31+
const labels = content
1732
.trim()
1833
.split(",")
1934
.map((s) => s.trim())
20-
.filter((s) => s && s !== "_No response_");
35+
.filter((s) => s && existingLabels.has(s));
2136
if (labels.length) {
37+
console.log(`Adding ${labels.length} labels: ${labels.join(', ')}`)
2238
await github.rest.issues.addLabels({
2339
...context.repo,
2440
issue_number: context.issue.number,

CONTRIBUTING.md

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,23 @@ Hi there! We are thrilled that you'd like to contribute to this project. It's pe
66

77
- [Code of Conduct](#code-of-conduct)
88
- [How Can I Contribute?](#how-can-i-contribute)
9+
- [Reporting Bugs](#reporting-bugs)
10+
- [Suggesting Enhancements](#suggesting-enhancements)
11+
- [Types of Contributions We're Looking For](#types-of-contributions-were-looking-for)
912
- [Development Setup](#development-setup)
13+
- [Prerequisites](#prerequisites)
14+
- [Setting Up Your Development Environment](#setting-up-your-development-environment)
1015
- [Contributing Guidelines](#contributing-guidelines)
11-
- [Chart Development Standards](#chart-development-standards)
16+
- [Chart Development Standards](#chart-development-standards)
17+
- [Chart Structure](#chart-structure)
18+
- [Documentation Requirements](#documentation-requirements)
19+
- [Versioning](#versioning)
1220
- [Testing](#testing)
21+
- [Running Tests](#running-tests)
22+
- [Test Requirements](#test-requirements)
23+
- [Manual Testing](#manual-testing)
1324
- [Pull Request Process](#pull-request-process)
25+
- [Pull Request Checklist](#pull-request-checklist)
1426

1527
## Code of Conduct
1628

@@ -22,21 +34,21 @@ This project and everyone participating in it is governed by our [Code of Conduc
2234

2335
Before creating bug reports, please check the existing issues as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
2436

25-
- **Use a clear and descriptive title**
26-
- **Describe the exact steps to reproduce the problem**
27-
- **Provide specific examples to demonstrate the steps**
28-
- **Describe the behavior you observed and what behavior you expected**
29-
- **Include details about your configuration and environment**
37+
- Use a **clear and descriptive title**
38+
- Describe the **exact steps to reproduce** the problem
39+
- Provide **specific examples** to demonstrate the steps
40+
- Describe the **behavior you observed** and what **behavior you expected**
41+
- Include details about **your configuration and environment**
3042

3143
### Suggesting Enhancements
3244

3345
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
3446

35-
- **Use a clear and descriptive title**
36-
- **Provide a step-by-step description of the suggested enhancement**
37-
- **Provide specific examples to demonstrate the steps**
38-
- **Describe the current behavior and explain which behavior you expected to see**
39-
- **Explain why this enhancement would be useful**
47+
- Use a **clear and descriptive title**
48+
- Provide a **step-by-step description** of the suggested enhancement
49+
- Provide **specific examples** to demonstrate the steps
50+
- Describe the **current behavior** and explain which **behavior you expected** to see
51+
- Explain **why this enhancement would be useful**
4052

4153
### Types of Contributions We're Looking For
4254

@@ -52,40 +64,61 @@ Enhancement suggestions are tracked as GitHub issues. When creating an enhanceme
5264
- Kubernetes 1.24+
5365
- Helm 3.2.0+
5466
- [helm-unittest](https://github.com/helm-unittest/helm-unittest) plugin
67+
- Commits verified by signature
5568

5669
### Setting Up Your Development Environment
5770

5871
1. Fork the repository on GitHub
5972
2. Clone your fork locally:
73+
6074
```bash
6175
git clone https://github.com/your-username/helm-charts.git
6276
cd helm-charts
6377
```
6478

6579
3. Install the helm-unittest plugin:
80+
6681
```bash
6782
helm plugin install https://github.com/helm-unittest/helm-unittest
6883
```
6984

85+
4. Make sure to sign your commits
86+
87+
```bash
88+
git config gpg.format ssh
89+
git config user.signingkey <filePath>
90+
git config commit.gpgsign true
91+
git config tag.gpgsign true
92+
```
93+
94+
Replace `<filePath>` with the path to your public ssh key file, e.g. `~/.ssh/id_ed25519.pub`, wich you use to push to GitHub.
95+
Alternatively, a signing ssh key can be used instead.
96+
If you want to sign commits in every repository, not just this one, add the `--global` parameter.
97+
98+
> More information: [GitHub docs](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
99+
70100
## Contributing Guidelines
71101

72102
### Chart Development Standards
73103

74104
All charts in this repository must follow these standards:
75105

76106
#### Security First
107+
77108
- Implement read-only root filesystems where possible
78109
- Drop unnecessary Linux capabilities
79110
- Configure security contexts properly
80111
- Never hardcode credentials
81112

82113
#### Production Ready
114+
83115
- Include comprehensive health checks (liveness, readiness, startup probes)
84116
- Support resource requests and limits
85117
- Provide persistent storage configurations
86118
- Include health check endpoints
87119

88120
#### Highly Configurable
121+
89122
- Provide extensive `values.yaml` with detailed documentation
90123
- Support existing secrets and ConfigMaps
91124
- Offer flexible ingress configurations
@@ -154,6 +187,7 @@ helm unittest charts/your-chart
154187
### Test Requirements
155188

156189
Your tests should cover:
190+
157191
- Template rendering with default values
158192
- Template rendering with custom values
159193
- Required value validation
@@ -181,13 +215,15 @@ kubectl get all -n test
181215
## Pull Request Process
182216

183217
1. **Branch**: Create a feature branch from `main`
218+
184219
```bash
185220
git checkout -b feature/your-chart-improvement
186221
```
187222

188223
2. **Development**: Make your changes following the guidelines above
189224

190225
3. **Testing**: Run all tests and ensure they pass
226+
191227
```bash
192228
./test-all-charts.sh
193229
helm lint ./charts/your-chart
@@ -196,6 +232,7 @@ kubectl get all -n test
196232
4. **Documentation**: Update documentation as needed
197233

198234
5. **Commit**: Use clear, descriptive commit messages
235+
199236
```bash
200237
git commit -m "[chart-name] Add support for custom annotations"
201238
```

0 commit comments

Comments
 (0)