feat(NO-JIRA): add pnpm support to shared frontend workflows#250
feat(NO-JIRA): add pnpm support to shared frontend workflows#250bobobowis wants to merge 3 commits into
Conversation
a6130a9 to
88da721
Compare
88da721 to
9bb7563
Compare
5165e31 to
4cfcec5
Compare
3e44a81 to
8ea430b
Compare
4f28212 to
e7eac0d
Compare
|
|
||
| - name: Setup Node with Cache | ||
| uses: Typeform/.github/shared-actions/setup-node-with-cache@v1 | ||
| uses: Typeform/.github/shared-actions/setup-node-with-cache@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
|
|
||
| - name: Setup Node with Cache | ||
| uses: Typeform/.github/shared-actions/setup-node-with-cache@v1 | ||
| uses: Typeform/.github/shared-actions/setup-node-with-cache@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
|
|
||
| - name: Setup Node with Cache | ||
| uses: Typeform/.github/shared-actions/setup-node-with-cache@v1 | ||
| uses: Typeform/.github/shared-actions/setup-node-with-cache@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
| steps: | ||
| - name: Run Cypress Functional Tests | ||
| uses: Typeform/.github/shared-actions/run-cypress-functional@v1 | ||
| uses: Typeform/.github/shared-actions/run-cypress-functional@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
| steps: | ||
| - name: Run Cypress Visual Tests | ||
| uses: Typeform/.github/shared-actions/run-cypress-visual@v1 | ||
| uses: Typeform/.github/shared-actions/run-cypress-visual@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
|
|
||
| - name: Setup Node with Cache | ||
| uses: Typeform/.github/shared-actions/setup-node-with-cache@v1 | ||
| uses: Typeform/.github/shared-actions/setup-node-with-cache@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
| steps: | ||
| - name: Run Cypress Functional Tests | ||
| uses: Typeform/.github/shared-actions/run-cypress-functional@v1 | ||
| uses: Typeform/.github/shared-actions/run-cypress-functional@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
| steps: | ||
| - name: Run Playwright Visual Tests | ||
| uses: Typeform/.github/shared-actions/run-playwright-visual@v1 | ||
| uses: Typeform/.github/shared-actions/run-playwright-visual@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
| steps: | ||
| - name: Run Cypress Visual Tests | ||
| uses: Typeform/.github/shared-actions/run-cypress-visual@v1 | ||
| uses: Typeform/.github/shared-actions/run-cypress-visual@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
|
|
||
| - name: Setup Node with Cache | ||
| uses: Typeform/.github/shared-actions/setup-node-with-cache@v1 | ||
| uses: Typeform/.github/shared-actions/setup-node-with-cache@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
e7eac0d to
e4c0b43
Compare
| permissions: | ||
| contents: read | ||
| uses: Typeform/.github/.github/workflows/sonarcloud-scan.yml@v1 | ||
| uses: Typeform/.github/.github/workflows/sonarcloud-scan.yml@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
| permissions: | ||
| contents: read | ||
| uses: Typeform/.github/.github/workflows/sonarcloud-scan.yml@v1 | ||
| uses: Typeform/.github/.github/workflows/sonarcloud-scan.yml@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
e4c0b43 to
ff9b7a8
Compare
ff9b7a8 to
3c7315b
Compare
|
|
||
| - name: Setup Jarvis | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@v1 | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
|
|
||
| - name: Setup Jarvis | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@v1 | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
| - name: Setup Playwright | ||
| if: inputs.integration-test-framework == 'playwright' | ||
| uses: Typeform/.github/shared-actions/setup-playwright@v1 | ||
| uses: Typeform/.github/shared-actions/setup-playwright@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
|
|
||
| - name: Setup Jarvis | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@v1 | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
|
|
||
| - name: Setup Jarvis | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@v1 | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
|
|
||
| - name: Setup Jarvis | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@v1 | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
|
|
||
| - name: Setup Jarvis | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@v1 | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
| - name: Setup Playwright | ||
| if: inputs.integration-test-framework == 'playwright' | ||
| uses: Typeform/.github/shared-actions/setup-playwright@v1 | ||
| uses: Typeform/.github/shared-actions/setup-playwright@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
|
|
||
| - name: Setup Jarvis | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@v1 | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@feat/pnpm-support-shared-frontend-workflows |
There was a problem hiding this comment.
This will be removed before merging. It was done to simplify testing scenarios in the following repos: admin-home, smart-forms-builder, paprikations, performance-analytics
| # Install Jarvis dependencies | ||
| cd "$JARVIS_DIR" | ||
| yarn install --frozen-lockfile | ||
| $PM install --frozen-lockfile |
There was a problem hiding this comment.
🐛 Bug: $PM install --frozen-lockfile runs inside the Jarvis checkout — but Typeform/jarvis has yarn.lock, no pnpm-lock.yaml.
Caller with package-manager: pnpm and a non-empty jarvis-branch will execute pnpm install --frozen-lockfile in a yarn-locked repo:
- pnpm ≥7: hard-fails with
ERR_PNPM_NO_LOCKFILE. - pnpm <7: silently generates a fresh install from
package.json→ dep tree diverges from what yarn produced → subtle version drift in linked@typeform/jarvis.
The caller's PM ≠ the linked dep source repo's PM. Coupling them assumes both share PM, but Jarvis stays yarn until separately migrated.
Suggested fix — pin Jarvis-side install to yarn regardless of caller PM; keep $PM only for the consumer-side link:
cd "$JARVIS_DIR"
yarn install --frozen-lockfile
yarn link
cd $GITHUB_WORKSPACE
$PM link @typeform/jarvisOr auto-detect:
cd "$JARVIS_DIR"
if [ -f "pnpm-lock.yaml" ]; then
pnpm install --frozen-lockfile
pnpm link
else
yarn install --frozen-lockfile
yarn link
fiSame issue applies to the ACT=true local-testing branch above (cd .../jarvis && $PM link) if the local Jarvis checkout is yarn-installed.
| echo "📦 Installing Playwright browsers directly via $PM..." | ||
| $PM exec playwright install --with-deps | ||
| fi | ||
| else |
There was a problem hiding this comment.
📝 Nit — yarn behavior change, low-risk but avoidable.
Before: yarn playwright install --with-deps — direct bin lookup via node_modules/.bin/playwright.
After: yarn exec playwright install --with-deps — Yarn 1 exec subcommand.
Existing yarn callers here are Yarn 1 classic (admin-home .tool-versions: yarn 1.22.19; workflow pins yarn@1.22.22).
Yarn 1 exec supports arg passthrough for non-yarn flags. --with-deps doesn't collide with any yarn-known flag → most likely works fine.
Still worth branching by PM:
- Zero risk vs. non-zero risk — no benefit from changing yarn form.
- Grep-audit clarity — future readers see the exact call.
- Skips extra
yarn execprocess hop.
if [ "$PM" = "pnpm" ]; then
pnpm exec playwright install --with-deps
else
yarn playwright install --with-deps
fi| apps/**/node_modules | ||
| packages/**/node_modules" | ||
| ;; | ||
| "pnpm-store-only"|"yarn-cache-only") |
There was a problem hiding this comment.
🔧 Silent alias masks user error.
When package-manager: pnpm + cache-mode: yarn-cache-only, action treats it as pnpm-store-only. Two problems:
1. User-error masking. Caller misconfigures — copied yaml from a yarn repo, forgot to swap cache-mode. Should surface loudly, not silently rewrite semantics. When same caller flips package-manager: yarn back later, cache behavior changes without them touching cache-mode → confusing.
2. Cache key drift. key-suffix=-$CACHE_MODE appended downstream produces key ...-pnpm-<hash>-yarn-cache-only — pnpm store cached under yarn-shaped key. actions/caches UI shows key that lies about content, grep-audits misleading.
3. Asymmetric hole. yarn branch at line 121 has no case for pnpm-store-only → falls to full silently. So pnpm→yarn direction fails one way (default fallthrough), yarn→pnpm direction aliases. Neither errors.
Fix — fail loud on mismatch:
"pnpm-store-only") PATHS="$PNPM_STORE" ;;
"yarn-cache-only")
echo "::error::cache-mode 'yarn-cache-only' invalid when package-manager=pnpm. Use 'pnpm-store-only' or 'full'."
exit 1
;;Mirror the guard in the yarn case for pnpm-store-only.
| - name: Install package manager | ||
| run: | | ||
| if [ "${{ inputs.package-manager }}" = "pnpm" ]; then | ||
| npm install -g pnpm |
There was a problem hiding this comment.
🔧 Unpinned pnpm — reproducibility hole.
yarn side pins to 1.22.22; pnpm side grabs latest. Asymmetric.
Failure modes:
-
Runner-to-runner drift. Same PR yields different pnpm across reruns after any pnpm release.
pnpm install --frozen-lockfilesemantics evolved across v6→v7→v8→v9→v10 (lockfile v6/v9 format, workspace-protocol handling,packageExtensions). Silent behavior change without any code delta. -
pnpm initinteractive prompt. Non-interactive default only in pnpm v7+. Older versions prompt → hangs CI or takes defaults inconsistently. -
Lockfile format regression. Consumer commits
pnpm-lock.yamlgenerated with v8 (format6.0). Runner installs v10 next month → regenerates in9.0format on anypnpm installwithout--frozen-lockfile→ downstream tooling breaks. -
Debugging noise. "Worked yesterday, fails today" with no code change — pnpm major shipped overnight.
Fix (minimum):
npm install -g pnpm@9.15.0 # match consumer reposBetter — mirror the yarn pin as a workflow input:
inputs:
pnpm-version:
default: '9.15.0'Best — reuse pnpm/action-setup@v4 like setup-node-with-cache does, so version resolution honors consumer's packageManager field in package.json. One code path, deterministic.
- Pin pnpm version via pnpm-version input (default 9.15.0) in graphql-generate-persisted-operations; mirrors yarn@1.22.22 pin - Fail loud on cross-PM cache-mode mismatch in setup-node-with-cache instead of silently aliasing yarn-cache-only → pnpm-store-only - Branch playwright install by PM; yarn uses direct bin, pnpm uses exec - Detect jarvis lockfile to pick install PM independently of caller's PM
3c7315b to
3948dd7
Compare
|
|
|
||
| - name: Setup Jarvis | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@v1 | ||
| uses: Typeform/.github/shared-actions/setup-jarvis@feat/pnpm-support-shared-frontend-workflows |



Overview
Jira: NOJIRA-1
Extends shared reusable frontend workflows and
setup-node-with-cacheto support pnpm-based repos alongside existing Yarn consumers. First consumer: admin-home.All changes are additive — Yarn behavior is untouched. Repos opt in via
package-manager: pnpm. pnpm callers pass all commands explicitly (no dynamic defaults).Changes
package-managerinput (yarn|pnpm, default:yarn) tosetup-node-with-cache,frontend-pr-workflow,frontend-deploy-workflow,sonarcloud-scan, and the threerun-cypress-*/run-playwright-visualshared-actionspnpm/action-setup@v4(skipped when asdf manages it)pnpm-lock.yaml), integrity check (.modules.yamlvs.yarn-integrity), install command (pnpm install --frozen-lockfile), and postinstall steppnpm-isolates from yarn caches — no cross-PM cache pollutionasdf reshim pnpmwhenpackage-manager: pnpm,asdf reshim yarnotherwisecache-modeinput description to "package manager cache" across all filesBackward compatibility
Zero changes required from existing Yarn callers — all new inputs default to
yarn.How to use (pnpm repo)