Skip to content

fix: regenerate Chart.lock, clean up .gitignore, add Chart.lock CI validation#268

Merged
nic-6443 merged 3 commits intomainfrom
fix/developer-portal-fe-chart-lock
Mar 25, 2026
Merged

fix: regenerate Chart.lock, clean up .gitignore, add Chart.lock CI validation#268
nic-6443 merged 3 commits intomainfrom
fix/developer-portal-fe-chart-lock

Conversation

@nic-6443
Copy link
Contributor

@nic-6443 nic-6443 commented Mar 25, 2026

Problem

The Release Charts CI (run #23532815477) failed after merging #266 with:

Error: the lock file (Chart.lock) is out of sync with the dependencies file (Chart.yaml). Please update the dependencies

The Chart.lock committed in #266 had a placeholder digest hash instead of a real one generated by helm dependency update.

Changes

1. Regenerate Chart.lock (commit 1)

Ran helm dependency update charts/developer-portal-fe/ to produce a valid digest.

2. Clean up .gitignore + add CI validation (commit 2)

  • .gitignore: Replaced 4 individual charts/*/charts entries (including stale ones like api7-gateway, api7-dashboard, devportal) with a single wildcard pattern charts/*/charts
  • CI: Added a Verify Chart.lock files step that runs helm dependency build on every chart with a Chart.lock, catching digest mismatches before merge

Summary by CodeRabbit

  • Chores
    • Simplified ignore rules to broadly exclude nested chart directories from version control.
  • Tests
    • Added a CI verification step that checks chart dependency lockfiles and ensures chart dependencies are built/available before deployment.

The Chart.lock had a placeholder digest hash that caused the
chart-releaser CI to fail with 'lock file out of sync' error.

Also add developer-portal-fe/charts to .gitignore to match other charts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 44987664-bd46-478f-b4d4-ad25a38e70f3

📥 Commits

Reviewing files that changed from the base of the PR and between 860071c and a32f7d7.

📒 Files selected for processing (1)
  • .github/workflows/ci.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yaml

📝 Walkthrough

Walkthrough

Replaced three explicit .gitignore entries that targeted specific chart subdirectories with a single glob charts/*/charts. Added a CI step "Verify Chart.lock files" that scans charts/*/ for Chart.lock files and runs a chart-testing container which adds Helm repos and executes helm dependency build for each matched chart.

Changes

Cohort / File(s) Summary
Git ignore
\.gitignore
Consolidated three explicit ignore entries for specific chart subdirectories into one glob pattern: charts/*/charts.
CI workflow
.github/workflows/ci.yaml
Added Verify Chart.lock files step: scans charts/*/ directories, and for each chart containing Chart.lock runs the chart-testing Docker image, adds Helm repos, and executes helm dependency build.

Sequence Diagram(s)

sequenceDiagram
  participant GH as "GitHub Actions"
  participant CT as "chart-testing Docker"
  participant Helm as "Helm (inside CT)"
  participant Charts as "charts/*/ Chart dirs"

  GH->>Charts: scan charts/*/ for Chart.lock
  alt Chart.lock exists
    GH->>CT: start container for that chart
    CT->>Helm: add required Helm repos (repo add)
    CT->>Helm: run helm dependency build in chart dir
    Helm-->>CT: return build result
    CT-->>GH: report success/failure
  else no Chart.lock
    GH-->>Charts: skip chart
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hop through charts both near and far,
One tidy rule now finds each nested jar,
Locks get checked in containers snug and bright,
Dependencies built before the night,
I twitch—CI hums with delight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: regenerating Chart.lock, cleaning up .gitignore patterns, and adding CI validation for Chart.lock files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/developer-portal-fe-chart-lock

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

.gitignore Outdated
@@ -5,3 +5,4 @@ charts/api7-dashboard/charts
charts/devportal/charts
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, charts/devportal/charts is a leftover — there's no devportal chart in the repo anymore (only api7, developer-portal-fe, gateway, ingress-controller). Similarly api7-gateway and api7-dashboard may be stale.

I'll clean up the legacy entries in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can CI be added to detect this issue in advance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. The existing Helm chart CI already runs helm lint and helm install but doesn't verify the lock file. Adding a helm dependency build step to the CI workflow would catch this — it fails when the lock digest doesn't match.

I'll add a validation step to the CI in this PR.

- Replace individual chart/*/charts entries with a single wildcard
  pattern, removing stale entries (api7-gateway, api7-dashboard, devportal)
- Add 'Verify Chart.lock files' CI step that runs helm dependency build
  on every chart with a Chart.lock, catching digest mismatches before merge

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nic-6443 nic-6443 changed the title fix: regenerate developer-portal-fe Chart.lock with valid digest fix: regenerate Chart.lock, clean up .gitignore, add Chart.lock CI validation Mar 25, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/ci.yaml (1)

39-54: Consider consolidating into a single Docker invocation for efficiency.

Spinning up a new Docker container for each chart with a Chart.lock adds overhead (container startup + repeated helm repo add operations). If multiple charts have lock files, this can noticeably slow CI. A single container running a loop internally would be more efficient.

Additionally, quoting ${chart_dir} in the inner shell command would improve robustness against edge cases.

♻️ Proposed refactor: single container with proper quoting
       - name: Verify Chart.lock files
         run: |
-          for chart_dir in charts/*/; do
-            if [ -f "${chart_dir}Chart.lock" ]; then
-              echo "Verifying ${chart_dir}Chart.lock..."
-              docker run --rm --interactive --network host \
-                  --volume $PWD:/workdir \
-                  --workdir /workdir \
-                  quay.io/helmpack/chart-testing:v3.10.1 sh -c "
-                    helm repo add bitnami https://charts.bitnami.com/bitnami && \
-                    helm repo add apisix https://charts.apiseven.com && \
-                    helm repo add jaegertracing https://jaegertracing.github.io/helm-charts && \
-                    helm dependency build ${chart_dir}
-                  "
-            fi
-          done
+          docker run --rm --interactive --network host \
+              --volume "$PWD:/workdir" \
+              --workdir /workdir \
+              quay.io/helmpack/chart-testing:v3.10.1 sh -c '
+                helm repo add bitnami https://charts.bitnami.com/bitnami && \
+                helm repo add apisix https://charts.apiseven.com && \
+                helm repo add jaegertracing https://jaegertracing.github.io/helm-charts && \
+                for chart_dir in charts/*/; do
+                  if [ -f "${chart_dir}Chart.lock" ]; then
+                    echo "Verifying ${chart_dir}Chart.lock..."
+                    helm dependency build "${chart_dir}"
+                  fi
+                done
+              '
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yaml around lines 39 - 54, The current "Verify
Chart.lock files" step spawns a new docker container per chart_dir and re-runs
helm repo adds each time; change it to invoke docker run exactly once and
perform the for-loop inside that single container (move the for chart_dir in
charts/*/ loop into the sh -c command) to avoid repeated container startups and
duplicated helm repo add calls, while preserving the existing --volume,
--workdir and --network flags; also ensure you quote "${chart_dir}" inside the
inner shell command (and in the helm dependency build invocation) to handle
paths with spaces.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yaml:
- Around line 39-54: The current "Verify Chart.lock files" step spawns a new
docker container per chart_dir and re-runs helm repo adds each time; change it
to invoke docker run exactly once and perform the for-loop inside that single
container (move the for chart_dir in charts/*/ loop into the sh -c command) to
avoid repeated container startups and duplicated helm repo add calls, while
preserving the existing --volume, --workdir and --network flags; also ensure you
quote "${chart_dir}" inside the inner shell command (and in the helm dependency
build invocation) to handle paths with spaces.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2fe0771e-c969-4b5c-b0d5-425f365fda4e

📥 Commits

Reviewing files that changed from the base of the PR and between dd13ef8 and 860071c.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml
  • .gitignore
✅ Files skipped from review due to trivial changes (1)
  • .gitignore

Move the for-loop inside the Docker container to avoid repeated container
startups and helm repo add calls. Also properly quote ${chart_dir}.

Suggested-by: CodeRabbit
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nic-6443 nic-6443 merged commit a73c426 into main Mar 25, 2026
3 checks passed
@nic-6443 nic-6443 deleted the fix/developer-portal-fe-chart-lock branch March 25, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants