Skip to content

fix(hoppscotch): align template standards#675

Open
mberlofa wants to merge 2 commits into
mainfrom
fix/hoppscotch-template-standards
Open

fix(hoppscotch): align template standards#675
mberlofa wants to merge 2 commits into
mainfrom
fix/hoppscotch-template-standards

Conversation

@mberlofa

@mberlofa mberlofa commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Keep the Helm test hook under templates/tests/connection-test.yaml so helm test renders and executes it, with unittest coverage for the hook pod.
  • Add networkPolicy.extraEgress while preserving legacy networkPolicy.egress.
  • Add extraManifests and unit coverage for additional rendered manifests.
  • Make dual-stack, external-db, and external-secrets CI scenarios self-contained for local k3d.
  • Add network policy unit coverage for baseline, extra egress, and legacy egress compatibility.

Related

Validation

  • helm template test charts/hoppscotch | rg -n "helm.sh/hook|test-connection|connection-test" (hook rendered from templates/tests/connection-test.yaml)
  • helm unittest charts/hoppscotch (81 tests, 14 suites)
  • make template-standards-check CHART=hoppscotch
  • node scripts/charts/validate-chart.js --chart hoppscotch --no-k3d
  • make validate-chart CHART=hoppscotch TIMEOUT=900 (FULLY VALIDATED, 18 layers)
  • make site-sync-check CHART=hoppscotch
  • make release-check REPO=charts
  • make attribution-check REPO=charts

Site Validation

  • npm run lint
  • npm run format:check
  • npm run build

Summary by CodeRabbit

  • New Features
    • Added extraManifests to render additional Kubernetes resources during the Helm release (with templating support).
    • Added optional networkPolicy.extraEgress to append extra egress rules to generated NetworkPolicies.
  • Bug Fixes
    • Updated CI chart setup to use an in-cluster PostgreSQL service and updated external-secrets sourcing for CI runs.
    • Adjusted dual-stack service behavior to prefer dual-stack addressing.
  • Tests
    • Added/updated Helm tests covering extra manifests rendering and NetworkPolicy egress ordering/appending.
  • Documentation
    • Updated chart docs and values.schema.json for extraManifests and extraEgress.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Standards Check (GR-079) — PASS

Every changed chart fully passes standards-check.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f7234cfb-1d17-4f3e-bff7-ed2d265f9b3c

📥 Commits

Reviewing files that changed from the base of the PR and between fc5f429 and c67b0a4.

📒 Files selected for processing (14)
  • charts/hoppscotch/README.md
  • charts/hoppscotch/ci/dual-stack.yaml
  • charts/hoppscotch/ci/external-db.yaml
  • charts/hoppscotch/ci/external-secrets.yaml
  • charts/hoppscotch/templates/extra-manifests.yaml
  • charts/hoppscotch/templates/networkpolicy.yaml
  • charts/hoppscotch/tests/connection_test.yaml
  • charts/hoppscotch/tests/extra-manifests-values.yaml
  • charts/hoppscotch/tests/extra_manifests_test.yaml
  • charts/hoppscotch/tests/networkpolicy-extra-egress-values.yaml
  • charts/hoppscotch/tests/networkpolicy-legacy-and-extra-egress-values.yaml
  • charts/hoppscotch/tests/networkpolicy_test.yaml
  • charts/hoppscotch/values.schema.json
  • charts/hoppscotch/values.yaml
💤 Files with no reviewable changes (1)
  • charts/hoppscotch/ci/dual-stack.yaml
✅ Files skipped from review due to trivial changes (1)
  • charts/hoppscotch/README.md
🚧 Files skipped from review as they are similar to previous changes (10)
  • charts/hoppscotch/templates/networkpolicy.yaml
  • charts/hoppscotch/tests/networkpolicy-legacy-and-extra-egress-values.yaml
  • charts/hoppscotch/tests/extra_manifests_test.yaml
  • charts/hoppscotch/tests/extra-manifests-values.yaml
  • charts/hoppscotch/tests/connection_test.yaml
  • charts/hoppscotch/values.schema.json
  • charts/hoppscotch/tests/networkpolicy-extra-egress-values.yaml
  • charts/hoppscotch/values.yaml
  • charts/hoppscotch/tests/networkpolicy_test.yaml
  • charts/hoppscotch/ci/external-db.yaml

📝 Walkthrough

Walkthrough

Adds extraEgress and extraManifests support to the Hoppscotch chart, updates values, schema, and README, adds Helm tests for the new templates and the connection hook, and rewrites CI fixtures to use an in-cluster PostgreSQL setup.

Changes

Hoppscotch chart extraEgress and extraManifests support

Layer / File(s) Summary
Values, schema, and README updates
charts/hoppscotch/values.yaml, charts/hoppscotch/values.schema.json, charts/hoppscotch/README.md
Adds networkPolicy.extraEgress and extraManifests defaults and schema entries, and documents both in the chart configuration table.
NetworkPolicy extraEgress rendering and tests
charts/hoppscotch/templates/networkpolicy.yaml, charts/hoppscotch/tests/networkpolicy*.yaml
Concatenates egress and extraEgress when rendering NetworkPolicy rules, with fixtures and Helm tests covering baseline, appended, and legacy ordering cases.
extraManifests template and tests
charts/hoppscotch/templates/extra-manifests.yaml, charts/hoppscotch/tests/extra*manifests*.yaml
Renders each extraManifests entry as YAML and verifies the output with a ConfigMap fixture and test suite.
CI fixture updates for in-cluster PostgreSQL
charts/hoppscotch/ci/dual-stack.yaml, charts/hoppscotch/ci/external-db.yaml, charts/hoppscotch/ci/external-secrets.yaml
Switches dual-stack service config to ipFamilyPolicy: PreferDualStack, replaces the external DB host, and adds in-cluster PostgreSQL manifests plus CI-specific external-secrets wiring.
Connection test suite
charts/hoppscotch/tests/connection_test.yaml
Adds a Helm test suite for the connection hook pod and checks its kind, name, and hook annotation.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • helmforgedev/charts#641: Also adds extraEgress handling by appending additional NetworkPolicy egress rules into spec.egress.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately describes the chart-wide template standards work.
Linked Issues check ✅ Passed The Hoppscotch changes address the direct no-templates-tests blocker and related standards work, including test-hook coverage and networkPolicy extraEgress.
Out of Scope Changes check ✅ Passed The added CI fixtures, extraManifests support, and network policy updates all support the stated Hoppscotch standards objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/hoppscotch-template-standards

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

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🟢 Security Scan: hoppscotch

Framework Score
MITRE + NSA + SOC2 87.62626%

✅ Security posture acceptable.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review


P2 Badge Keep the Helm test hook under templates

Because this hook manifest now lives in the chart-root tests/ directory instead of templates/tests/, Helm no longer renders it into the release manifest; I verified the previous chart emitted # Source: hoppscotch/templates/tests/connection-test.yaml, while the current chart emits no test-connection hook. In any installed release, helm test will therefore have no connection test to run, so this should stay under templates/tests/ and any helm-unittest coverage should be added as a separate *_test.yaml suite.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

🧹 Nitpick comments (1)
charts/hoppscotch/templates/extra-manifests.yaml (1)

1-5: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider tpl for templated extra manifests.

Entries under extraManifests are rendered as static YAML only; users can't reference .Release, .Values, or chart helpers inside their manifests. Wrapping with tpl is the common pattern for this feature and would let consumers parameterize their extra manifests (e.g., namespace, release name) without hardcoding values.

♻️ Suggested refactor
 {{- range .Values.extraManifests }}
 ---
-{{ toYaml . }}
+{{ tpl (toYaml .) $ }}
 {{- end }}

Not required for current CI usage (fixtures use fully static manifests), so this is optional.

🤖 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/hoppscotch/templates/extra-manifests.yaml` around lines 1 - 5, The
extra manifests in extra-manifests.yaml are rendered only with toYaml, so
templated values like .Release or .Values cannot be resolved. Update the
rendering inside the extraManifests range to pass each item through tpl before
outputting it, so consumers can parameterize manifests using chart context while
preserving the existing static-manifest behavior. Use the extraManifests loop
and the toYaml rendering as the locating symbols.
🤖 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/hoppscotch/templates/extra-manifests.yaml`:
- Around line 1-5: The extra manifests in extra-manifests.yaml are rendered only
with toYaml, so templated values like .Release or .Values cannot be resolved.
Update the rendering inside the extraManifests range to pass each item through
tpl before outputting it, so consumers can parameterize manifests using chart
context while preserving the existing static-manifest behavior. Use the
extraManifests loop and the toYaml rendering as the locating symbols.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d1943b55-ce06-44ff-96f9-11402e86ae8b

📥 Commits

Reviewing files that changed from the base of the PR and between 47bc2fc and 03bbd71.

📒 Files selected for processing (14)
  • charts/hoppscotch/README.md
  • charts/hoppscotch/ci/dual-stack.yaml
  • charts/hoppscotch/ci/external-db.yaml
  • charts/hoppscotch/ci/external-secrets.yaml
  • charts/hoppscotch/templates/extra-manifests.yaml
  • charts/hoppscotch/templates/networkpolicy.yaml
  • charts/hoppscotch/tests/connection-test.yaml
  • charts/hoppscotch/tests/extra-manifests-values.yaml
  • charts/hoppscotch/tests/extra_manifests_test.yaml
  • charts/hoppscotch/tests/networkpolicy-extra-egress-values.yaml
  • charts/hoppscotch/tests/networkpolicy-legacy-and-extra-egress-values.yaml
  • charts/hoppscotch/tests/networkpolicy_test.yaml
  • charts/hoppscotch/values.schema.json
  • charts/hoppscotch/values.yaml
💤 Files with no reviewable changes (1)
  • charts/hoppscotch/ci/dual-stack.yaml

@mberlofa mberlofa force-pushed the fix/hoppscotch-template-standards branch from 03bbd71 to fc5f429 Compare July 4, 2026 11:43

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

🧹 Nitpick comments (2)
charts/hoppscotch/tests/connection_test.yaml (1)

9-18: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider broadening assertion coverage.

The suite only validates kind, name, and the helm.sh/hook annotation. The producer template also sets helm.sh/hook-delete-policy, a wget health-check command, and container image — asserting on these would catch regressions in the hook's actual behavior, not just its shape.

♻️ Suggested additional assertions
       - equal:
           path: metadata.annotations["helm.sh/hook"]
           value: test
+      - equal:
+          path: metadata.annotations["helm.sh/hook-delete-policy"]
+          value: before-hook-creation,hook-succeeded
+      - matchRegex:
+          path: spec.containers[0].command[2]
+          pattern: /backend/health
🤖 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/hoppscotch/tests/connection_test.yaml` around lines 9 - 18, The Helm
test hook check in connection_test.yaml is too narrow and only verifies kind,
name, and helm.sh/hook. Expand the test assertions in the existing it block to
also cover the hook-delete-policy annotation, the wget health-check command, and
the container image so the connection hook’s actual behavior is validated via
the same template-generated Pod.
charts/hoppscotch/templates/extra-manifests.yaml (1)

1-5: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider tpl-rendering entries for templating support.

Currently extraManifests entries are only YAML-dumped verbatim, so users can't reference .Release.Namespace, .Chart.Name, or other chart values inside their manifests — a common convention for this kind of passthrough (e.g. Bitnami's extraDeploy).

♻️ Proposed refactor to support templating
 {{/* SPDX-License-Identifier: Apache-2.0 */}}
 {{- range .Values.extraManifests }}
 ---
-{{ toYaml . }}
+{{ tpl (toYaml .) $ }}
 {{- end }}
🤖 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/hoppscotch/templates/extra-manifests.yaml` around lines 1 - 5,
`extraManifests` is currently emitted with a plain `toYaml` dump in the `range
.Values.extraManifests` block, so chart values and release metadata cannot be
interpolated. Update the `extra-manifests.yaml` template to run each entry
through `tpl` before YAML rendering, using the chart context so fields like
`.Release.Namespace` and `.Chart.Name` can be resolved. Keep the existing
`extraManifests` loop and ensure the rendered result still emits valid YAML
documents.
🤖 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/hoppscotch/templates/extra-manifests.yaml`:
- Around line 1-5: `extraManifests` is currently emitted with a plain `toYaml`
dump in the `range .Values.extraManifests` block, so chart values and release
metadata cannot be interpolated. Update the `extra-manifests.yaml` template to
run each entry through `tpl` before YAML rendering, using the chart context so
fields like `.Release.Namespace` and `.Chart.Name` can be resolved. Keep the
existing `extraManifests` loop and ensure the rendered result still emits valid
YAML documents.

In `@charts/hoppscotch/tests/connection_test.yaml`:
- Around line 9-18: The Helm test hook check in connection_test.yaml is too
narrow and only verifies kind, name, and helm.sh/hook. Expand the test
assertions in the existing it block to also cover the hook-delete-policy
annotation, the wget health-check command, and the container image so the
connection hook’s actual behavior is validated via the same template-generated
Pod.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 706313dd-c91d-4c3b-b79c-608a4a5c9e3c

📥 Commits

Reviewing files that changed from the base of the PR and between 03bbd71 and fc5f429.

📒 Files selected for processing (14)
  • charts/hoppscotch/README.md
  • charts/hoppscotch/ci/dual-stack.yaml
  • charts/hoppscotch/ci/external-db.yaml
  • charts/hoppscotch/ci/external-secrets.yaml
  • charts/hoppscotch/templates/extra-manifests.yaml
  • charts/hoppscotch/templates/networkpolicy.yaml
  • charts/hoppscotch/tests/connection_test.yaml
  • charts/hoppscotch/tests/extra-manifests-values.yaml
  • charts/hoppscotch/tests/extra_manifests_test.yaml
  • charts/hoppscotch/tests/networkpolicy-extra-egress-values.yaml
  • charts/hoppscotch/tests/networkpolicy-legacy-and-extra-egress-values.yaml
  • charts/hoppscotch/tests/networkpolicy_test.yaml
  • charts/hoppscotch/values.schema.json
  • charts/hoppscotch/values.yaml
💤 Files with no reviewable changes (1)
  • charts/hoppscotch/ci/dual-stack.yaml
✅ Files skipped from review due to trivial changes (4)
  • charts/hoppscotch/tests/networkpolicy-legacy-and-extra-egress-values.yaml
  • charts/hoppscotch/tests/extra_manifests_test.yaml
  • charts/hoppscotch/tests/extra-manifests-values.yaml
  • charts/hoppscotch/README.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • charts/hoppscotch/tests/networkpolicy-extra-egress-values.yaml
  • charts/hoppscotch/templates/networkpolicy.yaml
  • charts/hoppscotch/tests/networkpolicy_test.yaml
  • charts/hoppscotch/ci/external-db.yaml
  • charts/hoppscotch/values.schema.json
  • charts/hoppscotch/values.yaml

@mberlofa mberlofa force-pushed the fix/hoppscotch-template-standards branch from fc5f429 to c67b0a4 Compare July 5, 2026 18:17
@mberlofa

mberlofa commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the CodeRabbit review-summary items for Hoppscotch.

What changed:

  • Rendered extraManifests entries through Helm tpl while preserving static-manifest behavior.
  • Added unit coverage proving .Release.Namespace interpolation works in an extra manifest.
  • Expanded the connection hook test to cover helm.sh/hook-delete-policy, the BusyBox image, and the /backend/health command.
  • Synced the site PR: docs(hoppscotch): sync template standards updates site#353.

Validation:

  • make validate-chart CHART=hoppscotch TIMEOUT=1200 passed end-to-end after rebasing on origin/main (hoppscotch: FULLY VALIDATED (18 layers), including all GR-027 k3d scenarios). A previous run hit a transient PostgreSQL shutdown log during cleanup; the clean rerun passed.
  • make release-check REPO=charts passed with the expected GR-077 release-publication warning.
  • make attribution-check REPO=charts passed.

These findings were present in CodeRabbit review summaries rather than unresolved review threads, so there are no thread IDs to reply to or resolve.

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.

fix: align 81 charts with template standards

1 participant