Skip to content

docs(charts): add kubeVersion and requirements matrix#1599

Open
juliocimador wants to merge 1 commit into
mainfrom
feat/helm-quality-gates
Open

docs(charts): add kubeVersion and requirements matrix#1599
juliocimador wants to merge 1 commit into
mainfrom
feat/helm-quality-gates

Conversation

@juliocimador

Copy link
Copy Markdown

Summary

  • Add kubeVersion: ">=1.24.0-0" to all 18 charts (19 total with notifications)
  • Create docs/requirements-matrix.md with consolidated Kubernetes & infrastructure requirements
  • Add .github/scripts/validate-helm-charts.sh validation script
  • All charts pass validation - 19/19 with kubeVersion

Changes

1. Chart Updates

Added minimum Kubernetes version requirement to chart definitions for platform consistency and security.

2. Requirements Matrix

Comprehensive documentation covering:

  • Minimum Kubernetes 1.24+ requirements
  • Scenario-based node sizing (small/medium/large deployments)
  • Per-chart CPU/Memory resource defaults
  • Storage class requirements for stateful charts
  • Optional CRD dependencies (cert-manager, prometheus)
  • Network requirements and validation checklist

3. Validation Script

Bash script that audits all Chart.yaml files for kubeVersion compliance and reports pass/fail status.

Validation

./github/scripts/validate-helm-charts.sh --strict
Result: 19/19 charts have kubeVersion ✅

- 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.
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a shell validator for Helm charts, updates chart metadata to require Kubernetes >=1.24.0-0, and adds a requirements matrix document covering cluster, storage, network, and sizing details.

Changes

Helm chart version requirements

Layer / File(s) Summary
Validator script
.github/scripts/validate-helm-charts.sh
Adds a Bash script that scans chart metadata files, checks for kubeVersion, and reports validation counts and errors.
Chart kubeVersion updates
charts/*/Chart.yaml
Updates the listed Helm chart metadata files to declare kubeVersion: ">=1.24.0-0".
Requirements matrix
docs/requirements-matrix.md
Adds a requirements matrix document covering cluster version, sizing, storage, CRDs, network expectations, validation, and override guidance.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/helm-quality-gates

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2f6616e and 64501ed.

📒 Files selected for processing (20)
  • .github/scripts/validate-helm-charts.sh
  • charts/fetcher/Chart.yaml
  • charts/flowker/Chart.yaml
  • charts/go-boilerplate-ddd/Chart.yaml
  • charts/matcher/Chart.yaml
  • charts/midaz/Chart.yaml
  • charts/otel-collector-lerian/Chart.yaml
  • charts/plugin-access-manager/Chart.yaml
  • charts/plugin-bc-correios/Chart.yaml
  • charts/plugin-br-bank-transfer/Chart.yaml
  • charts/plugin-br-payments/Chart.yaml
  • charts/plugin-br-pix-direct-jd/Chart.yaml
  • charts/plugin-br-pix-indirect-btg/Chart.yaml
  • charts/plugin-br-pix-switch/Chart.yaml
  • charts/plugin-fees/Chart.yaml
  • charts/product-console/Chart.yaml
  • charts/reporter/Chart.yaml
  • charts/tracer/Chart.yaml
  • charts/underwriter/Chart.yaml
  • docs/requirements-matrix.md

Comment on lines +6 to +40
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Suggested change
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant