Skip to content

Commit 9d83ea6

Browse files
authored
Merge pull request #13698 from kiblik/helm_hit_help
feat(helm): Relocate docs/schema hints
2 parents 3d3427b + b097ced commit 9d83ea6

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
@@ -125,27 +125,25 @@ jobs:
125125
chart-search-root: "helm/defectdojo"
126126
git-push: true
127127

128-
# Documentation provided in the README file needs to contain the latest information from `values.yaml` and all other related assets.
129-
# 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.
130-
# The helm-docs documentation will be generated for you.
131128
- name: Run helm-docs (check)
132129
uses: losisin/helm-docs-github-action@a57fae5676e4c55a228ea654a1bcaec8dd3cf5b5 # v1.6.2
133130
if: ${{ !(startsWith(github.head_ref, 'renovate/') || startsWith(github.head_ref, 'dependabot/')) }}
134131
with:
135132
fail-on-diff: true
136133
chart-search-root: "helm/defectdojo"
137134

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

145-
# 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.
146-
# The chart needs to have a `values.schema.json` file that is compatible with the default `values.yaml` file.
147-
# 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.
148-
# The helm schema will be generated for you.
149147
- name: Generate values schema json
150148
uses: losisin/helm-values-schema-json-action@660c441a4a507436a294fc55227e1df54aca5407 # v2.3.1
151149
with:
@@ -154,6 +152,11 @@ jobs:
154152
useHelmDocs: true
155153
values: values.yaml
156154

155+
- name: Failed Information
156+
if: failure()
157+
run: |-
158+
echo "Your HELM chart changed but you haven't adjusted schema. Check https://github.com/defectdojo/django-DefectDojo/tree/master/helm/defectdojo#helm-schema-update for more information."
159+
157160
lint_format:
158161
name: Lint chart (format)
159162
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)