kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Standardize pnpm setup in CI workflows and upgrade pnpm/action-setup to v6.0.8

Open rtibbles opened this issue 6 months ago • 1 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Kolibri's GitHub Actions workflows install pnpm with actions/setup-node ordered before pnpm/action-setup (relying on the action's own cache: true), and are pinned to pnpm/[email protected]. Standardize on the canonical pnpm CI pattern — pnpm/action-setup first, then actions/setup-node with cache: 'pnpm' — and bump the action to v6.0.8, which avoids the v6.0.3 regression that installs pnpm 11 instead of the pinned version.

Complexity: Low Target branch: develop

Context

All Kolibri frontend workflows (frontend-tests, pre-commit, check_licenses, build_whl, i18n-download, i18n-upload, update_h5p) use the same setup:

- uses: actions/setup-node@v6
  with:
    node-version-file: 'package.json'   # Node 20
- uses: pnpm/[email protected]
  with:
    cache: true

pnpm/[email protected] has a regression (#225, #227) where it ignores the pinned pnpm version and installs pnpm 11, which requires Node ≥22.13. Kolibri only avoids the failure incidentally: because setup-node runs first, action-setup detects Node 20 and installs the standalone @pnpm/exe (bundles its own Node), so it works regardless.

The canonical caching pattern requires pnpm on PATH before setup-node runs (so setup-node can read the pnpm store path for cache: 'pnpm'). Adopting it means putting action-setup first — but on v6.0.3 that makes the action detect the runner's default Node (now ≥22.13) and install plain pnpm 11, which then fails on Node 20 with This version of pnpm requires at least Node.js v22.13. That is exactly what broke Studio's CI (learningequality/studio#5939). v6.0.7+ restores honoring the pinned version, removing the coupling.

The Change

Standardize the affected frontend workflows on the canonical pnpm CI pattern:

  • pnpm/action-setup runs before actions/setup-node.
  • Caching moves from action-setup's cache: true to setup-node's cache: 'pnpm'.
  • pnpm/action-setup is bumped to v6.0.8.

Target shape (the standard to converge on, matching Studio):

- uses: pnpm/[email protected]
- uses: actions/setup-node@v6
  with:
    node-version-file: 'package.json'
    cache: 'pnpm'

Out of Scope

  • npm_publish.yml — runs on Node 24 without pnpm caching, so the cache-pattern change does not apply. Not affected by the regression on Node 24; leave as-is.
  • pnpm version pins (packageManager field, volta block) — unchanged.

Acceptance Criteria

  • [ ] In all affected frontend workflows, pnpm/action-setup runs before actions/setup-node
  • [ ] pnpm/action-setup is pinned to v6.0.8 in those workflows
  • [ ] Caching is configured via setup-node's cache: 'pnpm', and action-setup's cache: true is removed
  • [ ] CI installs the packageManager-pinned pnpm version (not pnpm 11) — no job logs requires at least Node.js v22.13
  • [ ] The pnpm store cache is restored on a subsequent run (cache-hit visible in the run logs)
  • [ ] All affected workflows pass on a PR against develop

References

  • pnpm/action-setup #225, #227 — the v6 version-resolution regression
  • learningequality/studio#5939 — the same fix applied to Studio (shared root cause)

AI usage

Used Claude Code to investigate the Studio CI failure, trace it to the pnpm/action-setup v6 regression (reading the action source and upstream issues), and draft this companion task. The current Kolibri workflow setup and the v6.0.8 fix were verified directly before writing.

rtibbles avatar May 26 '26 20:05 rtibbles

Plan: Update all affected GitHub Actions frontend workflows to use the canonical pnpm CI pattern — pnpm/[email protected] running before actions/setup-node with cache: 'pnpm'.

  • [ ] Update frontend-tests.yml
  • [ ] Update pre-commit.yml
  • [ ] Update check_licenses.yml
  • [ ] Update build_whl.yml
  • [ ] Update i18n-download.yml
  • [ ] Update i18n-upload.yml
  • [ ] Update update_h5p.yml
  • [ ] Final verification and commit

status


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
  • Ran the project's full test suite and linter before committing
  • For UI changes: captured live screenshots to verify rendering
  • For backend changes: verified with example API/CLI output

rtibblesbot avatar May 26 '26 20:05 rtibblesbot