Skip to content

Commit 77cb613

Browse files
committed
feat(helm): Relocate docs/schema hints
Signed-off-by: kiblik <5609770+kiblik@users.noreply.github.com>
1 parent 038cf16 commit 77cb613

4 files changed

Lines changed: 46 additions & 8 deletions

File tree

.github/workflows/test-helm-chart.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,27 +123,25 @@ jobs:
123123
chart-search-root: "helm/defectdojo"
124124
git-push: true
125125

126-
# Documentation provided in the README file needs to contain the latest information from `values.yaml` and all other related assets.
127-
# If this step fails, install https://github.com/norwoodj/helm-docs and run locally `helm-docs --chart-search-root helm/defectdojo` before committing your changes.
128-
# The helm-docs documentation will be generated for you.
129126
- name: Run helm-docs (check)
130127
uses: losisin/helm-docs-github-action@a57fae5676e4c55a228ea654a1bcaec8dd3cf5b5 # v1.6.2
131128
if: ! startsWith(github.head_ref, 'renovate/') || startsWith(github.head_ref, 'dependabot/')
132129
with:
133130
fail-on-diff: true
134131
chart-search-root: "helm/defectdojo"
135132

133+
- name: Failed Information
134+
if: failure()
135+
run: |-
136+
echo "Your HELM chart changed but you haven't adjusted documentation. Check https://github.com/defectdojo/django-DefectDojo/tree/master/helm/defectdojo#general-information-about-chart-values for more information."
137+
136138
generate_schema:
137139
name: Update schema
138140
runs-on: ubuntu-latest
139141
steps:
140142
- name: Checkout
141143
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
142144

143-
# The HELM structure supports the existence of a `values.schema.json` file. This file is used to validate all values provided by the user before Helm starts rendering templates.
144-
# The chart needs to have a `values.schema.json` file that is compatible with the default `values.yaml` file.
145-
# If this step fails, install https://github.com/losisin/helm-values-schema-json and run locally `helm schema --use-helm-docs` in `helm/defectdojo` before committing your changes.
146-
# The helm schema will be generated for you.
147145
- name: Generate values schema json
148146
uses: losisin/helm-values-schema-json-action@660c441a4a507436a294fc55227e1df54aca5407 # v2.3.1
149147
with:
@@ -152,6 +150,11 @@ jobs:
152150
useHelmDocs: true
153151
values: values.yaml
154152

153+
- name: Failed Information
154+
if: failure()
155+
run: |-
156+
echo "Your HELM chart changed but you haven't adjusted schema. Check https://github.com/defectdojo/django-DefectDojo/tree/master/helm/defectdojo#general-information-about-chart-values for more information."
157+
155158
lint_format:
156159
name: Lint chart (format)
157160
runs-on: ubuntu-latest

helm/defectdojo/Chart.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ dependencies:
3434
# description: Critical bug
3535
annotations:
3636
artifacthub.io/prerelease: "true"
37-
artifacthub.io/changes: ""
37+
artifacthub.io/changes: |
38+
- kind: changed
39+
description: Location of HELM development hints has been changed

helm/defectdojo/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,23 @@ kubectl delete serviceAccount defectdojo
493493
kubectl delete pvc data-defectdojo-redis-0 data-defectdojo-postgresql-0
494494
```
495495
496+
## Development/contribution
497+
498+
In case you decide to help with the improvement of the HELM chart, keep in mind that values/descriptions might need to be adjusted in multiple places (see below).
499+
500+
### HELM Docs update
501+
502+
Documentation provided in the README file needs to contain the latest information from `values.yaml` and all other related assets.
503+
If GitHub Action _Lint Helm chart / Update documentation_ step fails, install https://github.com/norwoodj/helm-docs and run locally `helm-docs --chart-search-root helm/deeefectdojo` before committing your changes.
504+
The helm-docs documentation will be generated for you.
505+
506+
### HELM Schema update
507+
508+
The HELM structure supports the existence of a `values.schema.json` file. This file is used to validate all values provided by the user before Helm starts rendering templates.
509+
The chart needs to have a `values.schema.json` file that is compatible with the default `values.yaml` file.
510+
If GitHub Action _Lint Helm chart / Update schema_ step fails, install https://github.com/losisin/helm-values-schema-json and run locally `helm schema --use-helm-docs` in `helm/defectdojo` before committing your changes.
511+
The HELM schema will be generated for you.
512+
496513
# General information about chart values
497514
498515
![Version: 1.8.2-dev](https://img.shields.io/badge/Version-1.8.2--dev-informational?style=flat-square) ![AppVersion: 2.53.0-dev](https://img.shields.io/badge/AppVersion-2.53.0--dev-informational?style=flat-square)

helm/defectdojo/README.md.gotmpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,22 @@ kubectl delete serviceAccount defectdojo
495495
kubectl delete pvc data-defectdojo-redis-0 data-defectdojo-postgresql-0
496496
```
497497

498+
## Development/contribution
499+
500+
In case you decide to help with the improvement of the HELM chart, keep in mind that values/descriptions might need to be adjusted in multiple places (see below).
501+
502+
### HELM Docs update
503+
504+
Documentation provided in the README file needs to contain the latest information from `values.yaml` and all other related assets.
505+
If GitHub Action _Lint Helm chart / Update documentation_ step fails, install https://github.com/norwoodj/helm-docs and run locally `helm-docs --chart-search-root helm/deeefectdojo` before committing your changes.
506+
The helm-docs documentation will be generated for you.
507+
508+
### HELM Schema update
509+
510+
The HELM structure supports the existence of a `values.schema.json` file. This file is used to validate all values provided by the user before Helm starts rendering templates.
511+
The chart needs to have a `values.schema.json` file that is compatible with the default `values.yaml` file.
512+
If GitHub Action _Lint Helm chart / Update schema_ step fails, install https://github.com/losisin/helm-values-schema-json and run locally `helm schema --use-helm-docs` in `helm/defectdojo` before committing your changes.
513+
The HELM schema will be generated for you.
498514

499515
# General information about chart values
500516

0 commit comments

Comments
 (0)