docs(charts): add kubeVersion and requirements matrix#1599
Conversation
- Add kubeVersion: ">=1.24.0-0" to all 18 chart Chart.yaml files (fetcher, flowker, go-boilerplate-ddd, matcher, midaz, otel-collector-lerian, plugin-access-manager, plugin-bc-correios, plugin-br-bank-transfer, plugin-br-payments, plugin-br-pix-direct-jd, plugin-br-pix-indirect-btg, plugin-br-pix-switch, plugin-fees, product-console, reporter, tracer, underwriter) - Create docs/requirements-matrix.md with consolidated requirements: * Minimum Kubernetes version (1.24+) * Scenario-based node sizing (core, core+console+manager, full stack) * Per-chart resource requests (CPU/memory defaults) * Storage class requirements for stateful charts * CRD requirements for optional integrations (cert-manager, prometheus) * Network requirements and validation checklist - Add validation script (.github/scripts/validate-helm-charts.sh) Ensures all charts declare kubeVersion in strict mode Note: Resource values are defaults extracted from chart templates. Production deployments should review and adjust based on actual workload patterns. See docs/requirements-matrix.md for guidance.
📝 WalkthroughWalkthroughAdds a shell validator for Helm charts, updates chart metadata to require Kubernetes ChangesHelm chart version requirements
✨ Finishing Touches✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In @.github/scripts/validate-helm-charts.sh:
- Around line 6-40: Update validate-helm-charts.sh to enforce the new Helm chart
contract instead of passing on empty or outdated results. In the script’s
ROOT/STRICT handling and the Chart.yaml loop, add support for the intended
--root/--strict invocation, fail when no charts are found, and validate that
each chart’s kubeVersion matches ">=1.24.0-0" rather than only checking for
presence. Keep the behavior centered around validate-helm-charts.sh, the chart
discovery logic, and the kubeVersion check so the workflow cannot return a false
green.
In `@charts/plugin-br-payments/Chart.yaml`:
- Line 2: The chart’s kubeVersion floor is only being checked for presence, so
the CI validator can still accept a lower minimum than the documented baseline.
Update the Helm chart validation logic in the validator script that checks
Chart.yaml to assert the exact required floor `>=1.24.0-0` rather than only
matching that a kubeVersion field exists. Use the existing chart metadata check
path around the validator’s Chart.yaml parsing so regressions in `kubeVersion`
are rejected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 05cfb081-bfcd-4c2e-bef8-a94bf8367a2f
📒 Files selected for processing (20)
.github/scripts/validate-helm-charts.shcharts/fetcher/Chart.yamlcharts/flowker/Chart.yamlcharts/go-boilerplate-ddd/Chart.yamlcharts/matcher/Chart.yamlcharts/midaz/Chart.yamlcharts/otel-collector-lerian/Chart.yamlcharts/plugin-access-manager/Chart.yamlcharts/plugin-bc-correios/Chart.yamlcharts/plugin-br-bank-transfer/Chart.yamlcharts/plugin-br-payments/Chart.yamlcharts/plugin-br-pix-direct-jd/Chart.yamlcharts/plugin-br-pix-indirect-btg/Chart.yamlcharts/plugin-br-pix-switch/Chart.yamlcharts/plugin-fees/Chart.yamlcharts/product-console/Chart.yamlcharts/reporter/Chart.yamlcharts/tracer/Chart.yamlcharts/underwriter/Chart.yamldocs/requirements-matrix.md
| ROOT="${1:-.}" | ||
| STRICT="${2:---strict}" | ||
|
|
||
| echo "🔍 Validating Helm charts..." | ||
| echo "" | ||
|
|
||
| # Find all Chart.yaml files | ||
| charts=$(find "$ROOT/charts" -name "Chart.yaml" -type f 2>/dev/null || true) | ||
| count=0 | ||
| errors=0 | ||
|
|
||
| for chart in $charts; do | ||
| count=$((count + 1)) | ||
| chart_name=$(dirname "$chart" | xargs basename) | ||
|
|
||
| # Check kubeVersion exists | ||
| if ! grep -q "^kubeVersion:" "$chart"; then | ||
| echo "❌ $chart_name: missing kubeVersion" | ||
| errors=$((errors + 1)) | ||
| else | ||
| echo "✓ $chart_name: kubeVersion present" | ||
| fi | ||
| done | ||
|
|
||
| echo "" | ||
| echo "📊 Summary: $count charts validated" | ||
|
|
||
| if [ "$errors" -gt 0 ]; then | ||
| echo "❌ $errors validation error(s) found" | ||
| if [ "$STRICT" = "--strict" ]; then | ||
| exit 1 | ||
| fi | ||
| else | ||
| echo "✅ All charts valid" | ||
| exit 0 |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
This validator can return a false green instead of enforcing the new contract.
It accepts only positional args, silently succeeds when no charts are found, and only checks that kubeVersion exists rather than that it matches ">=1.24.0-0". That means a --root ../.. --strict style invocation like the existing workflow snippet would validate 0 charts and still exit successfully, and charts with an older floor would also pass.
Proposed fix
-#!/bin/bash
+#!/bin/bash
# Validate Helm charts for kubeVersion and other quality checks
-set -e
+set -euo pipefail
-ROOT="${1:-.}"
-STRICT="${2:---strict}"
+ROOT="."
+STRICT=false
+EXPECTED_KUBE_VERSION='kubeVersion: ">=1.24.0-0"'
+
+while [ "$#" -gt 0 ]; do
+ case "$1" in
+ --root)
+ ROOT="$2"
+ shift 2
+ ;;
+ --strict)
+ STRICT=true
+ shift
+ ;;
+ *)
+ echo "Unknown argument: $1" >&2
+ exit 2
+ ;;
+ esac
+done
echo "🔍 Validating Helm charts..."
echo ""
-# Find all Chart.yaml files
-charts=$(find "$ROOT/charts" -name "Chart.yaml" -type f 2>/dev/null || true)
+mapfile -t charts < <(find "$ROOT/charts" -name "Chart.yaml" -type f 2>/dev/null)
count=0
errors=0
+
+if [ "${`#charts`[@]}" -eq 0 ]; then
+ echo "❌ No charts found under $ROOT/charts"
+ exit 1
+fi
-for chart in $charts; do
+for chart in "${charts[@]}"; do
count=$((count + 1))
- chart_name=$(dirname "$chart" | xargs basename)
+ chart_name=$(basename "$(dirname "$chart")")
- # Check kubeVersion exists
- if ! grep -q "^kubeVersion:" "$chart"; then
- echo "❌ $chart_name: missing kubeVersion"
+ if ! grep -qxF "$EXPECTED_KUBE_VERSION" "$chart"; then
+ echo "❌ $chart_name: kubeVersion must be >=1.24.0-0"
errors=$((errors + 1))
else
- echo "✓ $chart_name: kubeVersion present"
+ echo "✓ $chart_name: kubeVersion compliant"
fi
done
@@
if [ "$errors" -gt 0 ]; then
echo "❌ $errors validation error(s) found"
- if [ "$STRICT" = "--strict" ]; then
+ if [ "$STRICT" = true ]; then
exit 1
fi
else📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ROOT="${1:-.}" | |
| STRICT="${2:---strict}" | |
| echo "🔍 Validating Helm charts..." | |
| echo "" | |
| # Find all Chart.yaml files | |
| charts=$(find "$ROOT/charts" -name "Chart.yaml" -type f 2>/dev/null || true) | |
| count=0 | |
| errors=0 | |
| for chart in $charts; do | |
| count=$((count + 1)) | |
| chart_name=$(dirname "$chart" | xargs basename) | |
| # Check kubeVersion exists | |
| if ! grep -q "^kubeVersion:" "$chart"; then | |
| echo "❌ $chart_name: missing kubeVersion" | |
| errors=$((errors + 1)) | |
| else | |
| echo "✓ $chart_name: kubeVersion present" | |
| fi | |
| done | |
| echo "" | |
| echo "📊 Summary: $count charts validated" | |
| if [ "$errors" -gt 0 ]; then | |
| echo "❌ $errors validation error(s) found" | |
| if [ "$STRICT" = "--strict" ]; then | |
| exit 1 | |
| fi | |
| else | |
| echo "✅ All charts valid" | |
| exit 0 | |
| ROOT="." | |
| STRICT=false | |
| EXPECTED_KUBE_VERSION='kubeVersion: ">=1.24.0-0"' | |
| while [ "$#" -gt 0 ]; do | |
| case "$1" in | |
| --root) | |
| ROOT="$2" | |
| shift 2 | |
| ;; | |
| --strict) | |
| STRICT=true | |
| shift | |
| ;; | |
| *) | |
| echo "Unknown argument: $1" >&2 | |
| exit 2 | |
| ;; | |
| esac | |
| done | |
| echo "🔍 Validating Helm charts..." | |
| echo "" | |
| # Find all Chart.yaml files | |
| mapfile -t charts < <(find "$ROOT/charts" -name "Chart.yaml" -type f 2>/dev/null) | |
| count=0 | |
| errors=0 | |
| if [ "${`#charts`[@]}" -eq 0 ]; then | |
| echo "❌ No charts found under $ROOT/charts" | |
| exit 1 | |
| fi | |
| for chart in "${charts[@]}"; do | |
| count=$((count + 1)) | |
| chart_name=$(basename "$(dirname "$chart")") | |
| if ! grep -qxF "$EXPECTED_KUBE_VERSION" "$chart"; then | |
| echo "❌ $chart_name: kubeVersion must be >=1.24.0-0" | |
| errors=$((errors + 1)) | |
| else | |
| echo "✓ $chart_name: kubeVersion compliant" | |
| fi | |
| done | |
| echo "" | |
| echo "📊 Summary: $count charts validated" | |
| if [ "$errors" -gt 0 ]; then | |
| echo "❌ $errors validation error(s) found" | |
| if [ "$STRICT" = true ]; then | |
| exit 1 | |
| fi | |
| else | |
| echo "✅ All charts valid" | |
| exit 0 |
🤖 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 @.github/scripts/validate-helm-charts.sh around lines 6 - 40, Update
validate-helm-charts.sh to enforce the new Helm chart contract instead of
passing on empty or outdated results. In the script’s ROOT/STRICT handling and
the Chart.yaml loop, add support for the intended --root/--strict invocation,
fail when no charts are found, and validate that each chart’s kubeVersion
matches ">=1.24.0-0" rather than only checking for presence. Keep the behavior
centered around validate-helm-charts.sh, the chart discovery logic, and the
kubeVersion check so the workflow cannot return a false green.
| @@ -1,4 +1,5 @@ | |||
| apiVersion: v2 | |||
| kubeVersion: ">=1.24.0-0" | |||
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Enforce the exact kubeVersion floor in CI.
Line 2 sets the documented baseline, but the validator snippet at .github/scripts/validate-helm-charts.sh:12-28 only checks that kubeVersion: exists. A later regression to something like >=1.20.0 would still pass validation, so the >=1.24.0-0 contract is not actually enforced.
Suggested validator hardening
- if ! grep -q "^kubeVersion:" "$chart"; then
- echo "❌ $chart_name: missing kubeVersion"
+ expected='kubeVersion: ">=1.24.0-0"'
+ actual=$(grep -E '^kubeVersion:' "$chart" || true)
+ if [ -z "$actual" ]; then
+ echo "❌ $chart_name: missing kubeVersion"
+ errors=$((errors + 1))
+ elif [ "$actual" != "$expected" ]; then
+ echo "❌ $chart_name: expected $expected, found $actual"
errors=$((errors + 1))
else
- echo "✓ $chart_name: kubeVersion present"
+ echo "✓ $chart_name: kubeVersion matches $expected"
fi🤖 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/plugin-br-payments/Chart.yaml` at line 2, The chart’s kubeVersion
floor is only being checked for presence, so the CI validator can still accept a
lower minimum than the documented baseline. Update the Helm chart validation
logic in the validator script that checks Chart.yaml to assert the exact
required floor `>=1.24.0-0` rather than only matching that a kubeVersion field
exists. Use the existing chart metadata check path around the validator’s
Chart.yaml parsing so regressions in `kubeVersion` are rejected.
Summary
Changes
1. Chart Updates
Added minimum Kubernetes version requirement to chart definitions for platform consistency and security.
2. Requirements Matrix
Comprehensive documentation covering:
3. Validation Script
Bash script that audits all Chart.yaml files for kubeVersion compliance and reports pass/fail status.
Validation