MonkeyCanCode commented on code in PR #3759:
URL: https://github.com/apache/polaris/pull/3759#discussion_r2808425929


##########
Makefile:
##########
@@ -215,16 +215,62 @@ client-cleanup: ## Cleanup virtual environment and Python 
cache files
 
 ##@ Helm
 
+helm-install-plugins: DEPENDENCIES := helm
+.PHONY: helm-install-plugins
+helm-install-plugins: check-dependencies ## Install required Helm plugins 
(unittest, schema)
+       @echo "--- Installing Helm plugins ---"
+       # Pin unittest version to 1.0.2 due to 
https://github.com/helm-unittest/helm-unittest/issues/790
+       @if helm plugin list | grep -q "^unittest"; then \
+               echo "Plugin 'unittest' is already installed."; \
+       else \
+               echo "Installing 'unittest' plugin..."; \
+               helm plugin install 
https://github.com/helm-unittest/helm-unittest --version 1.0.2; \
+       fi
+       @if helm plugin list | grep -q "^schema"; then \
+               echo "Plugin 'schema' is already installed."; \
+       else \
+               echo "Installing 'schema' plugin..."; \
+               helm plugin install 
https://github.com/losisin/helm-values-schema-json.git; \
+       fi
+       @echo "--- Helm plugins installed ---"
+
+helm-schema-verify: DEPENDENCIES := helm git
+.PHONY: helm-schema-verify
+helm-schema-verify: helm-schema-generate ## Verify Helm chart JSON schema is 
up to date
+       @echo "--- Verifying Helm values schema is up to date ---"
+       @if ! git diff --exit-code helm/polaris/values.schema.json; then \
+               echo "ERROR: Helm schema is out of date. Please run 'make 
helm-schema-generate' and commit the changes."; \
+               exit 1; \
+       fi
+       @echo "--- Helm values schema is up to date ---"
+
+helm-schema-generate: DEPENDENCIES := helm
+.PHONY: helm-schema-generate
+helm-schema-generate: helm-install-plugins ## Generate Helm chart JSON schema 
from values.yaml
+       @echo "--- Generating Helm values schema ---"
+       @helm schema -f helm/polaris/values.yaml -o 
helm/polaris/values.schema.json --use-helm-docs --draft 7
+       @echo "--- Helm values schema generated ---"
+
 helm-doc-generate: DEPENDENCIES := helm-docs
 .PHONY: helm-doc-generate
 helm-doc-generate: check-dependencies ## Generate Helm chart documentation
        @echo "--- Generating Helm documentation ---"
        @helm-docs --chart-search-root=helm --template-files helm.md.gotmpl 
--output-file ../../site/content/in-dev/unreleased/helm.md
        @echo "--- Helm documentation generated and copied ---"
 
+helm-doc-verify: DEPENDENCIES := helm-docs git
+.PHONY: helm-doc-verify
+helm-doc-verify: helm-doc-generate ## Verify Helm chart documentation is up to 
date
+       @echo "--- Verifying Helm documentation is up to date ---"
+       @if ! git diff --exit-code helm/polaris/README.md 
site/content/in-dev/unreleased/helm.md; then \

Review Comment:
   This is no longer valid due to https://github.com/apache/polaris/pull/3738



##########
Makefile:
##########
@@ -215,16 +215,62 @@ client-cleanup: ## Cleanup virtual environment and Python 
cache files
 
 ##@ Helm
 
+helm-install-plugins: DEPENDENCIES := helm
+.PHONY: helm-install-plugins
+helm-install-plugins: check-dependencies ## Install required Helm plugins 
(unittest, schema)
+       @echo "--- Installing Helm plugins ---"
+       # Pin unittest version to 1.0.2 due to 
https://github.com/helm-unittest/helm-unittest/issues/790
+       @if helm plugin list | grep -q "^unittest"; then \

Review Comment:
   Should we check version of helm here as helm4 would fail on the install 
plugin without `--verify=false) (https://github.com/helm/helm/issues/31490)



##########
.github/workflows/ci.yml:
##########
@@ -198,6 +198,16 @@ jobs:
           version: 'v3.16.0'
       - name: Set up chart-testing
         uses: 
helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0
+      - name: Set up helm-docs
+        run: |
+          go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest
+          echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
+      - name: Install Helm plugins
+        run: make helm-install-plugins
+      - name: Verify Helm schema is up to date
+        run: make helm-schema-verify
+      - name: Verify Helm documentation is up to date

Review Comment:
   As this is longer needed, maybe we should just do `make helm-doc-generate` 
instead?



##########
site/content/in-dev/unreleased/helm.md:
##########
@@ -214,6 +214,7 @@ The following tools are required to run the tests:
 Quick installation instructions for these tools:
 ```bash
 helm plugin install https://github.com/helm-unittest/helm-unittest.git

Review Comment:
   Should we pin version to 1.0.2 here as well?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to