Chore: Set up helmcov and helmdocs for charts.#232
Conversation
… docs for doc generation on charts
|
Deep Review✅ No critical issues found. This PR changes no runtime Helm templates (only 🟡 P2 — recommended
🔵 P3 nitpicks (8)
Reviewers (6): correctness, testing, maintainability, project-standards, adversarial, security. Testing gaps:
|
Replace Docker-based make coverage in CI with jordan-simonovski/helmcov@v1 so pull requests get upserted coverage summaries with threshold enforcement. Co-authored-by: Cursor <cursoragent@cursor.com>
v0.3.3 lacks --markdown-file support required by the v1 action entrypoint. Co-authored-by: Cursor <cursoragent@cursor.com>
Helm template coverage
Uncovered detailscharts/clickstack/templates/NOTES.txtUncovered lines: 1, 3, 4, 5, 6, 8, 10, 11, 12, 14, 15, 18, 21, 22, 23, 25, 26, 27, 29, 33, 34, 37 Uncovered branches: none charts/clickstack/templates/_helpers.tplUncovered lines: 6, 13, 17, 18, 19, 20, 21, 22, 31, 34, 35, 42, 54, 62, 69, 76, 83, 90, 97, 104 Uncovered branches: 12:if:true, 16:if:false, 16:if:true, 30:if:true, 50:if:false charts/clickstack/templates/additional-manifests.yamlUncovered lines: 2 Uncovered branches: none charts/clickstack/templates/clickhouse/cluster.yamlUncovered lines: 2, 3, 4, 6, 8 Uncovered branches: none charts/clickstack/templates/clickhouse/keeper.yamlUncovered lines: 2, 3, 4, 6, 8 Uncovered branches: none charts/clickstack/templates/hyperdx/configmap.yamlUncovered lines: 1, 2, 3, 4, 5, 7, 9 Uncovered branches: 8:range:empty, 8:range:non-empty charts/clickstack/templates/hyperdx/cronjob-check-alerts.yamlUncovered lines: 2, 3, 4, 5, 7, 9, 11, 12, 13, 14, 15, 16, 18, 19, 21, 24, 25, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61 Uncovered branches: 30:if:false, 30:if:true charts/clickstack/templates/hyperdx/deployment.yamlUncovered lines: 1, 2, 3, 5, 11, 13, 17, 18, 21, 22, 23, 26, 30, 32, 34, 36, 38, 40, 42, 44, 47, 50, 52, 54, 56, 58, 62, 65, 66, 68, 71, 72, 75, 76, 78, 80, 83, 84, 85, 87, 88, 89, 95, 97, 98, 99, 105, 107, 110, 111, 112, 114, 115, 117, 119, 120, 121, 124, 125, 126, 127, 130, 131, 133, 135, 137, 139, 140 Uncovered branches: 113:if:false, 132:if:false, 136:if:false, 14:if:false, 28:with:empty, 82:if:true, 9:with:empty charts/clickstack/templates/hyperdx/hpa.yamlUncovered lines: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 Uncovered branches: 1:if:true charts/clickstack/templates/hyperdx/ingress.yamlUncovered lines: 5, 6, 7, 9, 12, 13, 14, 16, 18, 20, 21, 22, 23, 25, 28, 29, 30, 31, 32, 34, 36, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 56, 57, 64, 65, 67, 69, 70, 71 Uncovered branches: 11:with:non-empty, 27:if:true, 35:if:true, 38:if:true, 54:range:empty, 58:range:empty, 59:if:false, 66:if:true charts/clickstack/templates/hyperdx/networkpolicy.yamlUncovered lines: 5, 6, 7, 9, 12, 14 Uncovered branches: none charts/clickstack/templates/hyperdx/pdb.yamlUncovered lines: 2, 3, 4, 6, 12, 14, 16, 17 Uncovered branches: 10:with:empty charts/clickstack/templates/hyperdx/secret.yamlUncovered lines: 2, 3, 5, 6, 7, 8, 9, 11, 12, 14, 15 Uncovered branches: 13:range:empty, 13:range:non-empty, 1:if:true, 4:if:false charts/clickstack/templates/hyperdx/service.yamlUncovered lines: 1, 2, 3, 5, 8, 11, 13, 15, 18, 22, 26, 27 Uncovered branches: 9:with:empty charts/clickstack/templates/hyperdx/serviceaccount.yamlUncovered lines: 2, 3, 4, 6, 9, 11 Uncovered branches: none charts/clickstack/templates/mongodb/community.yamlUncovered lines: 2, 3, 4, 6, 8 Uncovered branches: none charts/clickstack/templates/mongodb/password-secret.yamlUncovered lines: 7, 8, 9, 11, 13, 14 Uncovered branches: 6:if:false |
Deep ReviewScope: PR #232 — set up This is a well-executed tooling PR. The new helm-unittest suites are comprehensive and correctly assert against real template output (verified: init-container ordering, service port ordering, version-conditional cronjob command paths, tpl interpolation, disabled-component ✅ No critical issues found. 🟡 P2 — recommended
🔵 P3 nitpicks (12)
Reviewers (6): security, testing, maintainability, project-standards, reliability, adversarial. (The correctness reviewer did not return before synthesis; its surface — shell/Makefile/hook/template rendering correctness — was covered by orchestrator-side verification: the Makefile Testing gaps:
|
| # when org registry access is available. | ||
|
|
||
| HELM_DOCS_VERSION=v1.14.2 | ||
| HELMCOV_IMAGE=ghcr.io/jordan-simonovski/helmcov@sha256:eb659cda7f9c065d3424b33583f0ad6cd8a4eecb6a960172ba3699b1a8ac9c7e |
There was a problem hiding this comment.
This is cool, but how good is the test coverage for this library?
There was a problem hiding this comment.
Following up on this. wdyt about forking or moving this to the ClickHouse repo? I think it's mainly for testing, but I'd imagine we'd still need to go through a security audit of all the dependencies. Having it in the ClickHouse repo would likely make that process easier.
There was a problem hiding this comment.
Yeah I could do that for both this and the versioning tool I've got if you think it makes sense
There was a problem hiding this comment.
Coverage on the library is about 73% at the moment. It's pretty well tested in terms of how it handles coverage assertions. And yeah I'm open to forking this. SHA pinning there should at least stop anything potentially malicious from happening, though if it's easier to use as an internal thing I'm ok with it.
| @@ -0,0 +1,65 @@ | |||
| SHELL := /bin/bash | |||
There was a problem hiding this comment.
Thanks for adding the Makefile. Can we make sure it also includes other test commands?
We’re using changesets in the main OSS repo, and it’s been quite useful for developers to manage the changelog. We’re also using its github action to automatically create release PRs (for example: #229) and streamline the release process. Imo I don't think we need to deprecate it atm. |
P1 - .githooks/pre-commit — restore() now captures the git stash pop failure, prints a loud stderr recovery message (git stash list), and sets rc=1 instead of silently swallowing the conflict. P2 - .githooks/pre-commit — warns and exit 0 when helm is absent instead of hard-rejecting the commit (CI still enforces). - scripts/helmcov.sh — refuses to run when the threshold is 0/empty (can no longer silently neutralize the gate); --platform linux/amd64 is now conditional on non-amd64 hosts with an emulation notice. - Makefile + scripts/tool-versions.env — HELM_UNITTEST_VERSION moved into tool-versions.env; install-helm-unittest now version-checks the installed plugin and reinstalls on mismatch instead of accepting any existing version. - AGENTS.md — fixed the dead .github/workflows/helmcov.yaml reference to point at the helmcov job in helm-test.yaml. - charts/clickstack/tests/values/deployment-tpl-defaults.yaml — trimmed the ~110-line verbatim copy to the one connection + one log source the two assertions actually exercise. Verified: 204/204 unit tests pass, scripts pass bash -n, empty-array/threshold logic confirmed under bash 3.2, Makefile resolves. Not code-fixable (org infra — flagging, not doing) - scripts/tool-versions.env / helm-test.yaml — jordan-simonovski personal namespace + pull-requests: write. Mirroring the image and action into ghcr.io/clickhouse needs org registry access; the TODO is already in tool-versions.env. The pull-requests: write scope is genuinely required (posts the coverage comment). - helmcov version drift (digest vs HELMCOV_VERSION tag). The GitHub Action takes a version string, not a digest, so they can't be literally unified; tool-versions.env is the single source and already carries a "keep in step with HELMCOV_IMAGE" invariant comment. One thing surfaced during verification: helm plugin install fails on Helm 4 without --verify=false. CI pins Helm v3.12.0 so it's unaffected, but local Helm-4 users will hit it — out of scope for these findings, worth a follow-up if you want.
I might consider moving to
helmvernext instead of changesets and alleviating one more dependency in the repo in future. Open to suggestions.