Skip to content

ci: cache npm downloads in the translations workflow#40779

Merged
rusackas merged 1 commit into
masterfrom
ci/npm-cache-translations
Jun 5, 2026
Merged

ci: cache npm downloads in the translations workflow#40779
rusackas merged 1 commit into
masterfrom
ci/npm-cache-translations

Conversation

@rusackas
Copy link
Copy Markdown
Member

@rusackas rusackas commented Jun 4, 2026

SUMMARY

The frontend-check-translations job in superset-translations.yml runs an
uncached npm install via the cached-dependencies action — actions/setup-node
is configured without cache:, and the npm download cache is otherwise disabled
(# cache-restore npm is commented out in bashlib.sh). So it re-downloads the
full package set from the registry on every run.

Besides being slow, an uncached install is prone to transient registry failures.
This was observed concretely on #40744, where this exact job failed with
npm error code ECONNRESET / network aborted mid-download — unrelated to that
PR's changes.

This enables setup-node's built-in npm download cache, keyed on the
frontend lockfile, matching the pattern applied to the other frontend-heavy
workflows in #40744 (pre-commit, E2E, Playwright):

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

npm ci still does a clean install but skips re-fetching unchanged tarballs.
It caches only ~/.npm (not node_modules), keeping it lightweight under the
repo's cache budget.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — CI configuration only.

TESTING INSTRUCTIONS

CI-only. The first run on this 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

Split out from #40744 so the translations workflow can be assessed separately.

🤖 Generated with Claude Code

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

bito-code-review Bot commented Jun 4, 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.

@sadpandajoe sadpandajoe force-pushed the ci/npm-cache-translations branch from fe22bf1 to ca2a760 Compare June 5, 2026 17:24
@rusackas rusackas added the merge-if-green If approved and tests are green, please go ahead and merge it for me label Jun 5, 2026
The frontend-check-translations job in superset-translations.yml runs an
uncached npm install via cached-dependencies — actions/setup-node has no
`cache:` and the npm download cache is otherwise disabled — so it re-fetches
the full package set from the registry on every run. Besides being slow, that
makes the job prone to transient registry failures (e.g. ECONNRESET mid-
download).

Enable setup-node's built-in npm download cache, keyed on the frontend
lockfile, matching the pattern applied to the other frontend-heavy workflows
(pre-commit, E2E, Playwright). `npm ci` still does a clean install but skips
re-downloading unchanged tarballs. This caches only ~/.npm (not node_modules),
keeping it lightweight under the repo's cache budget.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rusackas rusackas force-pushed the ci/npm-cache-translations branch from ca2a760 to e085d2b Compare June 5, 2026 20:18
@rusackas rusackas merged commit 7eaaffd into master Jun 5, 2026
49 checks passed
@rusackas rusackas deleted the ci/npm-cache-translations branch June 5, 2026 20:22
@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