Skip to content

ci: cache npm downloads in frontend-heavy workflows#40744

Merged
rusackas merged 1 commit into
masterfrom
ci/npm-download-cache
Jun 4, 2026
Merged

ci: cache npm downloads in frontend-heavy workflows#40744
rusackas merged 1 commit into
masterfrom
ci/npm-download-cache

Conversation

@rusackas
Copy link
Copy Markdown
Member

@rusackas rusackas commented Jun 3, 2026

SUMMARY

The pre-commit, E2E (Cypress + Playwright), and experimental-Playwright jobs
run npm ci for the frontend with no download cacheactions/setup-node
was configured without cache:, and the cached-dependencies npm cache is
disabled (# cache-restore npm is commented out in bashlib.sh). So every one
of those jobs re-downloads the full package set from the registry, and npm
install is a large chunk of the per-job setup time that dominates these
workflows.

This enables setup-node's built-in npm cache — the lightweight option:

      - uses: actions/setup-node@… # v6
        with:
          node-version-file: './superset-frontend/.nvmrc'
          cache: 'npm'
          cache-dependency-path: 'superset-frontend/package-lock.json'

It caches the ~/.npm download cache (not node_modules), keyed on the
frontend lockfile. npm ci still does a clean install but skips re-fetching
unchanged tarballs. Deliberately avoiding full-node_modules caching, which is
large and could evict the more valuable instrumented-assets cache under the
repo's 10 GB cache budget.

TESTING INSTRUCTIONS

CI-only. First run on each workflow primes the cache; subsequent runs should
show a cache hit on the "Setup Node.js" step and a faster npm ci.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

@dosubot dosubot Bot added the github_actions Pull requests that update GitHub Actions code label Jun 3, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Jun 3, 2026

Bito Automatic Review Skipped - Files Excluded

Bito didn't auto-review this change because all changed files are in the exclusion list for automatic reviews. No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the excluded files settings here, or contact your Bito workspace admin at evan@preset.io.

@hainenber
Copy link
Copy Markdown
Contributor

@actions/setup-node actually enables caching by default in v6 so I don't think there would be behavioral change (hope I'm wrong here). This PR, however, would make that fact more visible for future maintainers :D

The pre-commit, E2E (Cypress + Playwright), and experimental-Playwright jobs
run `npm ci` for the frontend with no download cache — `actions/setup-node`
was configured without `cache:`, and the cached-dependencies npm cache is
disabled. Every one of those jobs re-downloads the full package set from the
registry, and npm install is a large part of the per-job setup time that
dominates these workflows.

Enable setup-node's built-in npm cache (the lightweight option: it caches
the ~/.npm download cache, not node_modules, keyed on the frontend
package-lock.json). `npm ci` still does a clean install but skips re-fetching
unchanged tarballs. This avoids the heavier full-node_modules caching that
can evict the more valuable instrumented-assets cache under the repo's 10 GB
cache budget.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rusackas rusackas force-pushed the ci/npm-download-cache branch from 1f795d8 to a9ac54e Compare June 4, 2026 19:12
@rusackas rusackas added the merge-if-green If approved and tests are green, please go ahead and merge it for me label Jun 4, 2026
@rusackas rusackas merged commit 79c74af into master Jun 4, 2026
66 of 67 checks passed
@rusackas rusackas deleted the ci/npm-download-cache branch June 4, 2026 20:34
@bito-code-review
Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

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

Labels

github_actions Pull requests that update GitHub Actions code merge-if-green If approved and tests are green, please go ahead and merge it for me size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants