Repository navigation
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: none Uncovered branches: 37:default:fallback charts/clickstack/templates/_helpers.tplUncovered lines: 17 Uncovered branches: 111:or(1):true, 128:range:empty, 159:default:fallback, 160:or(1):true, 16:if:true, 176:if:false charts/clickstack/templates/additional-manifests.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/clickhouse/cluster.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/clickhouse/keeper.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/hyperdx/configmap.yamlUncovered lines: none Uncovered branches: 8:range:empty charts/clickstack/templates/hyperdx/cronjob-check-alerts.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/hyperdx/dashboard-configmap.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/hyperdx/dashboard-provisioner-rbac.yamlUncovered lines: none Uncovered branches: 40:range:empty charts/clickstack/templates/hyperdx/deployment.yamlUncovered lines: none Uncovered branches: 117:default:fallback, 127:default:fallback, 150:if:false, 169:and(2):false, 16:with:empty, 192:default:fallback, 197:with:empty, 22:default:fallback, 38:with:empty charts/clickstack/templates/hyperdx/hpa.yamlUncovered lines: none Uncovered branches: 16:with:empty charts/clickstack/templates/hyperdx/ingress.yamlUncovered lines: none Uncovered branches: 35:if:false, 40:range:empty, 45:range:empty, 48:with:empty, 54:range:empty, 58:range:empty, 59:or(2):true, 59:or(3):true charts/clickstack/templates/hyperdx/networkpolicy.yamlUncovered lines: none Uncovered branches: 11:with:empty charts/clickstack/templates/hyperdx/pdb.yamlUncovered lines: none Uncovered branches: 10:with:empty charts/clickstack/templates/hyperdx/secret.yamlUncovered lines: none Uncovered branches: 13:range:empty, 1:or(2):true, 1:or(3):true charts/clickstack/templates/hyperdx/service.yamlUncovered lines: none Uncovered branches: 14:default:fallback, 9:with:empty charts/clickstack/templates/hyperdx/serviceaccount.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/mongodb/community.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/mongodb/password-secret.yamlUncovered lines: none Uncovered branches: none charts/clickstack/templates/otel-collector/custom-config.yamlUncovered lines: none Uncovered branches: none |
Deep Review✅ No critical issues found. This PR introduces no runtime template changes — 🟡 P2 -- recommended
🔵 P3 nitpicks (3)
Reviewers (7): correctness, testing, maintainability, project-standards, security, adversarial, previous-comments. Testing gaps: the new Bash tooling ( No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. |
| # 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 92%. 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.
There was a problem hiding this comment.
| @@ -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?
There was a problem hiding this comment.
Added make integration, which runs the Kind suites the same way CI does:
- each suite gets its own test- cluster, deleted afterwards.
make integration SUITES=api-onlyruns a single suite.
The full-stack suite already runs the smoke test and the Playwright checks, so this covers every test in the repo. I've left it out of make ci since it needs Docker and kind, and would take a while to run. I can do this in a follow up PR if you like
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.
helmcov now lives in ClickHouse/helmcov. CI pins the v0.5.1 action, and make coverage runs the release binary, checked against a pinned checksum, instead of a Docker image that needs a ghcr login. make integration runs the Kind suites as CI does, one cluster per suite.
…p-helmcov # Conflicts: # .github/workflows/helm-test.yaml # .gitignore # charts/clickstack-operators/values.yaml # charts/clickstack/.helmignore # charts/clickstack/values.yaml
Templates merged from main (dashboard provisioner and others) brought line coverage to 28.38%. Hold the minimum there until tests catch up.
v0.5.2 skips packaged subchart templates, which the otel-collector suite lists, and records coverage while templates execute. Line coverage is now 66%, so the temporary 28% minimum is no longer needed.
Line coverage is 66% with helmcov v0.5.2; hold it near that level.
v0.7.0 renders each test with its own values and stops at fail, which puts the chart at 99.85% line and 91.01% branch coverage. It also adds --branch-threshold, so branch coverage now fails the job too.
…into jordansimonovski/setup-helmcov
Adds template coverage, generated chart READMEs and a Makefile for the local test loop. Before this, nothing showed which template branches the unit tests exercised, and the chart values had no reference docs.
make test,make coverage,make docsandmake integrationrun the same checks as CI.make setupinstalls the tools and a pre-commit hook that runs the tests and docs check when chart files change.charts/*/README.mdis generated from# --comments invalues.yamlby helm-docs. CI fails when the README is out of date. Only commented keys appear, so new user-facing values need a# --comment.Breaking changes: none. The installed chart is unchanged.
values.yamlonly gains comments, andtests/andREADME.md.gotmplare kept out of the packaged chart.Implementation detail
scripts/tool-versions.env.make coveragedownloads the helmcov release binary into.tools/and checks it against a pinned sha256 of the release'schecksums.txt. The CI action is pinned by commit SHA.make validaterenders everyexamples/*/values.yaml, so new examples are picked up without editing the Makefile.make integrationruns each Kind suite in its owntest-<suite>cluster and deletes it afterwards. Tested locally withapi-only.