Skip to content

Skip remote npm cache on VPS runners - #451

Merged
nish3451 merged 2 commits into
mainfrom
fix/self-hosted-cache
Jul 30, 2026
Merged

nish3451 merged 2 commits into
mainfrom
fix/self-hosted-cache

Conversation

@nish3451

@nish3451 nish3451 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • keep setup-node npm caching on GitHub-hosted fallback runners
  • disable the redundant 1.06 GiB Actions cache on persistent self-hosted VPS runners
  • preserve CI's no-lockfile fallback and add a workflow contract test

Why

The exact-main production preflight stalled for more than 15 minutes restoring the npm Actions cache, then hit an Azure cache authentication failure. The VPS runners already share a persistent local npm cache, so the remote archive is redundant and blocks evidence/deploy throughput.

Verification

  • workflow YAML parses
  • workflow cache contract passes via static assertion
  • git diff --check clean
  • sgscan clean
  • CodeRabbit local gate: 0 findings
  • independent code review: approved after preserving the CI no-lockfile guard

No deploy or provider mutation is included in this PR.


Note

Low Risk
Workflow-only changes to dependency caching; no application, auth, or deploy logic is modified.

Overview
Disables GitHub Actions npm caching on self-hosted runners while keeping it on github-hosted fallbacks, so VPS jobs no longer spend time restoring large remote cache archives that duplicate the machine’s persistent local npm store.

Across CI, deploy, D1 backup/restore, cross-browser matrix, and production soak workflows, actions/setup-node@v6 now sets cache and package-manager-cache only when runner.environment == 'github-hosted'. CI’s codex-node-checks job still ties caching to a present package-lock.json so the no-lockfile npm install path stays unchanged.

Adds tests/self-hosted-node-cache-workflows.test.ts to assert runner-routed jobs use the hosted-only cache expressions (including the CI lockfile guard).

Reviewed by Cursor Bugbot for commit 03fc2f9. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Updated Node.js dependency caching in CI and deployment workflows to run only on GitHub-hosted runners.
    • Disabled cache configuration on non-hosted runners to avoid unsupported caching behavior.
    • Added/standardized package-manager-cache settings alongside runner-gated cache values, with lockfile-aware caching where applicable.
  • Tests
    • Added automated coverage to verify runner-specific actions/setup-node caching configuration across selected workflows.

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

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_57ac10c0-c498-42f6-9660-60bbec790cbb)

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The workflows now enable npm caching only on GitHub-hosted runners, with lockfile-aware conditions in CI. A Vitest test parses routed workflows and verifies runner selection, setup-node cache inputs, and the expected count of configured setup-node steps.

Changes

Hosted runner cache configuration

Layer / File(s) Summary
Conditional setup-node caching
.github/workflows/*.yml
Setup-node cache and package-manager-cache inputs now use GitHub-hosted-only expressions; CI additionally requires a non-empty lockfile hash.
Workflow cache assertions
tests/self-hosted-node-cache-workflows.test.ts
Adds workflow routing, typed setup-node data, and assertions for runner expressions, cache expressions, and the nine configured setup-node steps.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • nish3451/0509#425: Modifies the same D1 workflow setup-node cache inputs with conditional npm caching.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: disabling remote npm cache usage on VPS/self-hosted runners.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/self-hosted-cache

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: 1

🤖 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 `@tests/self-hosted-node-cache-workflows.test.ts`:
- Line 55: Update the runnerRoutedJobs count assertion in the self-hosted node
cache workflow test to expect the 11 jobs produced by runnerRoutedWorkflows,
unless the missing twelfth job is intentionally required and should be added to
that workflow definition.
🪄 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 Plus

Run ID: 90e6da13-f805-44ba-9d13-915be07f30a7

📥 Commits

Reviewing files that changed from the base of the PR and between 2558ffe and c37e8ff.

📒 Files selected for processing (8)
  • .github/workflows/ci.yml
  • .github/workflows/cross-browser-matrix.yml
  • .github/workflows/d1-backup-r2.yml
  • .github/workflows/d1-backup-validate.yml
  • .github/workflows/d1-remote-restore-evidence.yml
  • .github/workflows/deploy-production.yml
  • .github/workflows/finalize-production-soak.yml
  • tests/self-hosted-node-cache-workflows.test.ts

Comment thread tests/self-hosted-node-cache-workflows.test.ts Outdated

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

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_50037e88-ce73-428e-ad23-92031c9ab954)

@nish3451
nish3451 merged commit f0062e5 into main Jul 30, 2026
3 checks passed
@nish3451
nish3451 deleted the fix/self-hosted-cache branch July 30, 2026 14:42
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