fix(openhab): align pod template labels#674
Conversation
|
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 (6)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds a Helm helper template that rejects ChangesPod Labels Validation
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Helm
participant StatefulSetTemplate
participant ValidatePodLabelsHelper
Helm->>StatefulSetTemplate: render template
StatefulSetTemplate->>ValidatePodLabelsHelper: include openhab.validatePodLabels
ValidatePodLabelsHelper->>ValidatePodLabelsHelper: check podLabels for selector keys
alt override detected
ValidatePodLabelsHelper-->>Helm: fail with error message
else no override
ValidatePodLabelsHelper-->>StatefulSetTemplate: continue rendering
StatefulSetTemplate->>StatefulSetTemplate: apply openhab.selectorLabels
end
Related PRs: None found. Suggested labels: enhancement, helm-chart, tests Suggested reviewers: None identified. Poem 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Standards Check (GR-079) — PASSEvery changed chart fully passes standards-check. |
🟢 Security Scan:
|
| Framework | Score |
|---|---|
| MITRE + NSA + SOC2 | 87.878784% |
✅ Security posture acceptable.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
charts/openhab/tests/validation_test.yaml (1)
44-57: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider adding a combined-override test case.
Both new tests cover a single overridden key at a time. A test where
podLabelssets bothapp.kubernetes.io/nameandapp.kubernetes.io/instancewould confirm the helper fails fast on the first check (name) rather than silently passing due to ordering issues in future refactors.🤖 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/openhab/tests/validation_test.yaml` around lines 44 - 57, Add a combined override validation case for podLabels in validation_test.yaml, since the current tests only cover app.kubernetes.io/name and app.kubernetes.io/instance separately. Create a test alongside the existing should fail when podLabels override selector name/instance cases that uses a values file setting both selector labels at once, and assert the failure message from the validation helper still trips on the first check in the relevant template validation path.
🤖 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/openhab/tests/validation_test.yaml`:
- Around line 44-57: Add a combined override validation case for podLabels in
validation_test.yaml, since the current tests only cover app.kubernetes.io/name
and app.kubernetes.io/instance separately. Create a test alongside the existing
should fail when podLabels override selector name/instance cases that uses a
values file setting both selector labels at once, and assert the failure message
from the validation helper still trips on the first check in the relevant
template validation path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c8d827d1-587b-4fbe-8bab-cc8c03105ea0
📒 Files selected for processing (5)
charts/openhab/templates/_helpers.tplcharts/openhab/templates/statefulset.yamlcharts/openhab/tests/podlabels-selector-instance-values.yamlcharts/openhab/tests/podlabels-selector-name-values.yamlcharts/openhab/tests/validation_test.yaml
aeff7ad to
3203b40
Compare
|
Addressed the CodeRabbit nitpick from the review body. What changed:
Validation:
This CodeRabbit item was posted in the review body/top-level summary, not as an unresolved review thread, so there is no thread ID to reply to or resolve. |
Summary
podLabels.podLabelsfrom overriding selector labels.Validation
helm unittest charts/openhab: 118 tests passedhelm lint --strict charts/openhab: passedmake template-standards-check CHART=openhab: passedmake standards-check CHART=openhab: passedmake standards-guard CHART=openhab: passednode scripts/charts/validate-chart.js --chart openhab --no-k3d: static layers passed, including kubeconform and ah lintk3d-helmforge-tests-wsl: default plus everyci/*.yamlpassed sequentiallymake site-sync-check CHART=openhab: passednpm run lint,npm run format:check,npm run build: passedmake release-check REPO=charts: passed with expected post-merge release warningmake attribution-check REPO=charts: passedSite Sync
Site PR: helmforgedev/site#352
Summary by CodeRabbit