|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | + |
| 5 | +- Helm charts live in `charts/`: `unleash`, `unleash-proxy`, and `unleash-edge`. Each chart contains `Chart.yaml`, `values.yaml`, `templates/`, `templates/tests/`, and `examples/` for sample overrides. |
| 6 | +- Chart-specific CI values are under `charts/<chart>/ci/*.yaml`; CRDs for the main chart sit in `charts/unleash/crds/`. |
| 7 | +- Generated schema test outputs land in `results/` when running kubeconform locally or in CI. |
| 8 | + |
| 9 | +## Build, Test, and Development Commands |
| 10 | + |
| 11 | +- Lint a chart with Helm: `helm lint charts/unleash` (adjust chart path as needed). |
| 12 | +- Chart Testing (used in CI): `ct lint --config .github/ct.yaml` and `ct install --config .github/ct.yaml` (requires kind and Helm; installs changed charts listed by `ct list-changed`). |
| 13 | +- Render manifests for quick inspection: `helm template charts/unleash -f charts/unleash/ci/unleash-values.yaml`. |
| 14 | +- Schema validation (mirrors CI): `.github/kubeconform.sh` with `KUBERNETES_VERSION` set; ensures Bitnami repo is added for dependencies. |
| 15 | +- Super-linter locally (needs Docker): `docker run --rm -e RUN_LOCAL=true --env-file ".github/super-linter.env" -v "$(pwd)":/tmp/lint ghcr.io/super-linter/super-linter:latest`. |
| 16 | +- Dry-run install for smoke checks: `helm install --debug --dry-run --generate-name charts/unleash`. |
| 17 | + |
| 18 | +## Coding Style & Naming Conventions |
| 19 | + |
| 20 | +- YAML uses two-space indentation; prefer lowercase, hyphen-separated keys and filenames. |
| 21 | +- Keep Helm templates minimal and reuse existing helper templates where possible; document new values in `values.yaml` and the chart `README.md`. |
| 22 | +- Bump chart `version` (and `appVersion` if applicable) in `Chart.yaml` with chart changes; update `Chart.lock` when dependency versions change. |
| 23 | + |
| 24 | +## Testing Guidelines |
| 25 | + |
| 26 | +- Add or adjust `templates/tests/` if behavior changes require Helm tests; keep CI values in sync so `ct install` passes. |
| 27 | +- Run `ct lint` before opening a PR; use `helm template` plus `.github/kubeconform.sh` for schema confidence against supported Kubernetes versions. |
| 28 | +- If adding new values, provide a minimal example under `examples/` and ensure defaults keep templates rendering successfully without overrides. |
| 29 | + |
| 30 | +## Commit & Pull Request Guidelines |
| 31 | + |
| 32 | +- Use clear, imperative commit subjects (short scope tags like `chore(lint): …` are common but not required). |
| 33 | +- Each chart change should include a version bump, updated docs, and mention of validation commands run. |
| 34 | +- PRs should describe the change, reference related issues, and note any kubeconform/ct results or screenshots of rendered resources when relevant. |
| 35 | + |
| 36 | +## Formatting Hygiene |
| 37 | + |
| 38 | +- Keep Markdown readable: leave a blank line after every heading/section and avoid trailing spaces on any line. |
| 39 | +- Run `shfmt -w <file>` after modifying shell scripts (e.g., `.github/kubeconform.sh`, `charts/unleash/extract-cnpg-crds.sh`) to keep formatting consistent. |
0 commit comments