Skip to content

feat(NO-JIRA): add pnpm support to shared frontend workflows#250

Open
bobobowis wants to merge 3 commits into
mainfrom
feat/pnpm-support-shared-frontend-workflows
Open

feat(NO-JIRA): add pnpm support to shared frontend workflows#250
bobobowis wants to merge 3 commits into
mainfrom
feat/pnpm-support-shared-frontend-workflows

Conversation

@bobobowis

@bobobowis bobobowis commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Overview

Jira: NOJIRA-1

Extends shared reusable frontend workflows and setup-node-with-cache to 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

  • Add package-manager input (yarn|pnpm, default: yarn) to setup-node-with-cache, frontend-pr-workflow, frontend-deploy-workflow, sonarcloud-scan, and the three run-cypress-*/run-playwright-visual shared-actions
  • Install pnpm via pnpm/action-setup@v4 (skipped when asdf manages it)
  • Branch all PM-specific logic: cache paths, cache key (pnpm-lock.yaml), integrity check (.modules.yaml vs .yarn-integrity), install command (pnpm install --frozen-lockfile), and postinstall step
  • pnpm cache key prefix pnpm- isolates from yarn caches — no cross-PM cache pollution
  • Fix asdf reshim: asdf reshim pnpm when package-manager: pnpm, asdf reshim yarn otherwise
  • Clarify cache-mode input description to "package manager cache" across all files
  • Update README and CACHE-STRATEGY-GUIDE with pnpm cache mode docs

Backward compatibility

Zero changes required from existing Yarn callers — all new inputs default to yarn.

How to use (pnpm repo)

uses: Typeform/.github/.github/workflows/frontend-pr-workflow.yml@v1
with:
  package-manager: 'pnpm'
  cache-mode: 'node_modules-only'   # or 'full' for pnpm workspaces
  build-command: 'pnpm run dist:preview'
  clean-command: 'pnpm run clean'
  deploy-command: 'pnpm run deploy:preview'
  # ... all other commands passed explicitly

@bobobowis bobobowis force-pushed the feat/pnpm-support-shared-frontend-workflows branch 2 times, most recently from a6130a9 to 88da721 Compare July 7, 2026 14:39
Comment thread .github/workflows/frontend-pr-workflow.yml Fixed
@bobobowis bobobowis force-pushed the feat/pnpm-support-shared-frontend-workflows branch from 88da721 to 9bb7563 Compare July 7, 2026 14:46
Comment thread .github/workflows/frontend-deploy-workflow.yml Fixed
Comment thread .github/workflows/frontend-deploy-workflow.yml Fixed
Comment thread .github/workflows/frontend-deploy-workflow.yml Fixed
Comment thread .github/workflows/frontend-deploy-workflow.yml Fixed
Comment thread .github/workflows/frontend-pr-workflow.yml Fixed
Comment thread .github/workflows/frontend-pr-workflow.yml Fixed
Comment thread .github/workflows/frontend-pr-workflow.yml Fixed
Comment thread .github/workflows/frontend-pr-workflow.yml Fixed
Comment thread .github/workflows/sonarcloud-scan.yml Fixed
@bobobowis bobobowis force-pushed the feat/pnpm-support-shared-frontend-workflows branch 4 times, most recently from 5165e31 to 4cfcec5 Compare July 8, 2026 12:21
Comment thread .github/workflows/frontend-deploy-workflow.yml Fixed
Comment thread .github/workflows/frontend-pr-workflow.yml Fixed
@bobobowis bobobowis force-pushed the feat/pnpm-support-shared-frontend-workflows branch 2 times, most recently from 3e44a81 to 8ea430b Compare July 8, 2026 13:56
Comment thread .github/workflows/frontend-deploy-workflow.yml Fixed
Comment thread .github/workflows/frontend-pr-workflow.yml Fixed
@bobobowis bobobowis force-pushed the feat/pnpm-support-shared-frontend-workflows branch 4 times, most recently from 4f28212 to e7eac0d Compare July 8, 2026 14:52

- 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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bobobowis bobobowis force-pushed the feat/pnpm-support-shared-frontend-workflows branch from e7eac0d to e4c0b43 Compare July 8, 2026 15:41
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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bobobowis bobobowis force-pushed the feat/pnpm-support-shared-frontend-workflows branch from e4c0b43 to ff9b7a8 Compare July 8, 2026 15:52
@bobobowis bobobowis force-pushed the feat/pnpm-support-shared-frontend-workflows branch from ff9b7a8 to 3c7315b Compare July 9, 2026 12:14

- name: Setup Jarvis
uses: Typeform/.github/shared-actions/setup-jarvis@v1
uses: Typeform/.github/shared-actions/setup-jarvis@feat/pnpm-support-shared-frontend-workflows

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bobobowis bobobowis marked this pull request as ready for review July 9, 2026 13:17
@bobobowis bobobowis requested a review from a team as a code owner July 9, 2026 13:17
Comment thread shared-actions/setup-jarvis/action.yml Outdated
# Install Jarvis dependencies
cd "$JARVIS_DIR"
yarn install --frozen-lockfile
$PM install --frozen-lockfile

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐛 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/jarvis

Or auto-detect:

cd "$JARVIS_DIR"
if [ -f "pnpm-lock.yaml" ]; then
  pnpm install --frozen-lockfile
  pnpm link
else
  yarn install --frozen-lockfile
  yarn link
fi

Same 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

@kb-typeform kb-typeform Jul 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Zero risk vs. non-zero risk — no benefit from changing yarn form.
  2. Grep-audit clarity — future readers see the exact call.
  3. Skips extra yarn exec process 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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 Unpinned pnpm — reproducibility hole.

yarn side pins to 1.22.22; pnpm side grabs latest. Asymmetric.

Failure modes:

  1. Runner-to-runner drift. Same PR yields different pnpm across reruns after any pnpm release. pnpm install --frozen-lockfile semantics evolved across v6→v7→v8→v9→v10 (lockfile v6/v9 format, workspace-protocol handling, packageExtensions). Silent behavior change without any code delta.

  2. pnpm init interactive prompt. Non-interactive default only in pnpm v7+. Older versions prompt → hangs CI or takes defaults inconsistently.

  3. Lockfile format regression. Consumer commits pnpm-lock.yaml generated with v8 (format 6.0). Runner installs v10 next month → regenerates in 9.0 format on any pnpm install without --frozen-lockfile → downstream tooling breaks.

  4. 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 repos

Better — 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
@bobobowis bobobowis force-pushed the feat/pnpm-support-shared-frontend-workflows branch from 3c7315b to 3948dd7 Compare July 10, 2026 14:26
@sonarqubecloud

Copy link
Copy Markdown


- name: Setup Jarvis
uses: Typeform/.github/shared-actions/setup-jarvis@v1
uses: Typeform/.github/shared-actions/setup-jarvis@feat/pnpm-support-shared-frontend-workflows
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.

3 participants