fix(docmost): centralize template validation#659
Conversation
Standards Check (GR-079) — PASSEvery changed chart fully passes standards-check. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughHelm chart validation logic is moved from inline checks in ChangesValidation Refactor
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🟢 Security Scan:
|
| Framework | Score |
|---|---|
| MITRE + NSA + SOC2 | 87.878784% |
✅ Security posture acceptable.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
charts/docmost/templates/_helpers.tpl (1)
259-270: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winConsider guarding against an invalid
storage.modevalue.None of the four branches fail when
storage.modeis neither"local"nor"s3"(e.g. a typo). In that case,deployment.yaml's conditionals for local/s3 volumes/env vars would silently no-op rather than surfacing a clear validation error. If this isn't already enforced by a values schema, consider adding a catch-allfailfor unrecognized modes.♻️ Optional catch-all guard
{{- if and (eq .Values.storage.mode "s3") (not .Values.storage.s3.existingSecret) (or (not .Values.storage.s3.accessKey) (not .Values.storage.s3.secretKey)) -}} {{- fail "docmost: storage.mode=s3 requires storage.s3.existingSecret or both storage.s3.accessKey and storage.s3.secretKey" -}} {{- end -}} +{{- if and (ne .Values.storage.mode "local") (ne .Values.storage.mode "s3") -}} +{{- fail (printf "docmost: storage.mode must be 'local' or 's3', got %q" .Values.storage.mode) -}} +{{- end -}} {{- end -}}Please check whether
values.schema.json(or similar) already enforcesstorage.modeas an enum before applying this.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@charts/docmost/templates/_helpers.tpl` around lines 259 - 270, The Helm helper validations in _helpers.tpl do not reject unknown storage.mode values, so a typo can slip through and leave deployment.yaml with silent no-op conditionals. Add a catch-all validation in the same storage checks that fails for any storage.mode other than the supported values, and first verify whether values.schema.json already constrains storage.mode to an enum so you don’t duplicate existing validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@charts/docmost/templates/_helpers.tpl`:
- Around line 259-270: The Helm helper validations in _helpers.tpl do not reject
unknown storage.mode values, so a typo can slip through and leave
deployment.yaml with silent no-op conditionals. Add a catch-all validation in
the same storage checks that fails for any storage.mode other than the supported
values, and first verify whether values.schema.json already constrains
storage.mode to an enum so you don’t duplicate existing validation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fe2c9770-17b8-4c76-ab75-9c9457be8ad5
📒 Files selected for processing (2)
charts/docmost/templates/_helpers.tplcharts/docmost/templates/validate.yaml
1bf71b5 to
ddb70f7
Compare
|
Reviewed the CodeRabbit review-summary nitpick for Result:
Validation:
Note: this CodeRabbit item was posted in the review summary/body, not as an active review thread, so there is no thread ID to reply to or resolve for it. |
## Summary - add Docmost to the playground chart registry required by site sync ## Validation - make site-sync-check CHART=docmost - npm run lint - npm run format:check - npm run build - make release-check REPO=site - make attribution-check REPO=site Chart PR: helmforgedev/charts#659 Issue: helmforgedev/charts#633 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Expanded the playground’s chart selection to include the `docmost` chart, making it available in more filter results when browsing stable or supported charts. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
docmost.validatehelper expected by template standardstemplates/validate.yamlto the helperValidation
Site PR: helmforgedev/site#338
Issue: #633
Summary by CodeRabbit