Skip to content

Cache helm output#310

Merged
Sheikah45 merged 6 commits intodevelopfrom
cache-helm-output
May 7, 2026
Merged

Cache helm output#310
Sheikah45 merged 6 commits intodevelopfrom
cache-helm-output

Conversation

@Sheikah45
Copy link
Copy Markdown
Member

@Sheikah45 Sheikah45 commented May 6, 2026

Summary by CodeRabbit

  • Chores
    • Added Helm output caching to the continuous integration pipeline to improve build performance and reduce redundant operations
    • Updated development workflow configuration to intelligently detect CI environments and apply appropriate optimizations for faster, more efficient builds in both CI and local development scenarios

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Warning

Rate limit exceeded

@Sheikah45 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 35 minutes and 52 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c8dde34-9c20-4bed-bf0d-fafb1356fe1b

📥 Commits

Reviewing files that changed from the base of the PR and between b06166f and c132ee9.

📒 Files selected for processing (2)
  • .github/workflows/checks.yml
  • Tiltfile
📝 Walkthrough

Walkthrough

This PR adds Helm output caching infrastructure to the CI pipeline and adapts local build tooling to detect and handle CI execution mode differently. The workflow gains a caching step for Helm artifacts, while the local Tiltfile introduces CI environment detection to bypass resource dependency tracking and cached YAML fallback during continuous integration runs.

Changes

Helm Caching Across CI and Local Development

Layer / File(s) Summary
CI Caching Infrastructure
.github/workflows/checks.yml
GitHub Actions workflow adds a cache step for the .helm-cache directory using actions/cache@v5 with a fixed helm-cache key.
Local Tool CI Detection
Tiltfile (line 11)
Introduces is_ci boolean derived from the CI environment variable to gate conditional behavior.
Local Build Tool Helm Handling
Tiltfile (lines 106–120)
helm_with_build_cache(...) execution branches: in CI mode, runs the Helm command directly via agnostic_local(); otherwise, retains prior dependency-tracked agnostic_local_resource() with cached YAML fallback.
Cache Watch Preservation
Tiltfile (lines 121–122)
Cache file watching behavior is retained after the CI/non-CI conditional block.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A Helm of a cache, swift as can be,
In CI it sprints, in dev it runs free,
With branches for burrows and watches that stay,
Your builds now fly faster, hip-hip-hooray! 🏃‍♂️✨

🚥 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 'Cache helm output' directly and concisely summarizes the main changes: adding Helm output caching in the workflow and adjusting Tiltfile's Helm caching behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 cache-helm-output

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/checks.yml (1)

29-29: ⚡ Quick win

Static cache key helm-cache freezes the cache after the first run.

GitHub Actions cache cannot update an existing cache entry — to store new content, a new key must be used. With key: helm-cache, an exact key match is a cache hit, and only a cache miss triggers a new cache save. This means:

  • Run 1 (cold): cache miss → helm generates all outputs → cache saved as helm-cache.
  • Run 2+: cache hit → old outputs restored → helm-with-cache.sh may update local files → updated files are never re-saved to the Actions cache (key already exists).

The helm script runs correctly each time (CI outputs stay correct per-run), but the persistent GHA cache is frozen at the state from the very first run, eliminating the caching benefit whenever charts evolve.

Use a content-addressed key so cache entries are refreshed when chart definitions change:

♻️ Proposed refactor
-          key: helm-cache
+          key: helm-cache-${{ hashFiles('**/Chart.yaml', '**/Chart.lock', '**/values.yaml') }}
+          restore-keys: |
+            helm-cache-
🤖 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/workflows/checks.yml at line 29, The workflow uses a static cache
key "helm-cache" in .github/workflows/checks.yml which freezes the cache after
the first run; replace that static key with a content-addressed key that
includes a hash of the Helm chart/values files (e.g., using hashFiles on your
chart directory) and optionally runner info so the key updates when chart
sources change; ensure the cache action still provides sensible restore-keys for
fallbacks and keep references to "helm-cache" and the helm-with-cache.sh step
updated to use the new key scheme.
🤖 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/workflows/checks.yml:
- Line 25: The workflow step id contains a typo: rename the step identifier
"cache-helm-ooutput" to "cache-helm-output" so downstream references like
steps.cache-helm-output.outputs.* will resolve correctly; update any usages of
the old id (e.g., in outputs or needs) to the new "cache-helm-output" identifier
to keep references consistent.

In `@Tiltfile`:
- Around line 107-122: In the is_ci branch you call agnostic_local(command) but
never populate objects, causing a "referenced before assignment" error; after
calling agnostic_local(command) (inside the is_ci branch) read the cached YAML
into objects (objects = read_yaml_stream(cached_yaml)) and mirror the same
fallback logic used in the non-CI path (re-run agnostic_local and re-read if
objects is empty) so subsequent code can safely use the objects variable;
reference symbols: is_ci, agnostic_local(command), cached_yaml, objects,
read_yaml_stream.

---

Nitpick comments:
In @.github/workflows/checks.yml:
- Line 29: The workflow uses a static cache key "helm-cache" in
.github/workflows/checks.yml which freezes the cache after the first run;
replace that static key with a content-addressed key that includes a hash of the
Helm chart/values files (e.g., using hashFiles on your chart directory) and
optionally runner info so the key updates when chart sources change; ensure the
cache action still provides sensible restore-keys for fallbacks and keep
references to "helm-cache" and the helm-with-cache.sh step updated to use the
new key scheme.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: b046e183-7b6a-4ccf-8fab-a62acad15a8c

📥 Commits

Reviewing files that changed from the base of the PR and between 29d897f and b06166f.

📒 Files selected for processing (2)
  • .github/workflows/checks.yml
  • Tiltfile

Comment thread .github/workflows/checks.yml
Comment thread Tiltfile
@Sheikah45 Sheikah45 merged commit 6bcdbce into develop May 7, 2026
3 checks passed
Sheikah45 added a commit that referenced this pull request May 7, 2026
* Cache helm output for CI runs

* load objects in ci and fail if none

* Use more specific keys and restore_key

* Fix restore-keys and don't use reloader in ci

* Remove main from restore-keys

* Mose base_ref after develop

Fix restore keys formatting in checks.yml

Fix restore-keys value
@coderabbitai coderabbitai Bot mentioned this pull request May 7, 2026
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.

1 participant