Skip to content

fix(ci): drop redundant rrweb worker map cp in playwright workflow#59840

Merged
arnohillen merged 9 commits into
masterfrom
ahillen/drop-playwright-rrweb-cp
May 31, 2026
Merged

fix(ci): drop redundant rrweb worker map cp in playwright workflow#59840
arnohillen merged 9 commits into
masterfrom
ahillen/drop-playwright-rrweb-cp

Conversation

@arnohillen
Copy link
Copy Markdown
Contributor

Problem

After #59518 dropped @posthog/rrweb as a direct frontend dependency, the E2E Playwright job started failing at the Collect static files step:

cp frontend/node_modules/@posthog/rrweb/dist/image-bitmap-data-url-worker-*.js.map frontend/dist/

@posthog/rrweb is no longer a hoisted top-level package — pnpm only exposes it under node_modules/.pnpm/, not node_modules/@posthog/rrweb/ — so the glob matches nothing and the cp errors out before collectstatic runs.

Competing fix in #59839 keeps the cp but re-points it at posthog-js/dist with 2>/dev/null || true. This PR proposes the leaner alternative.

Changes

Remove the cp entirely. frontend/build.mjs already calls copyRRWebWorkerFiles() from common/esbuilder/utils.mjs, which (post-#59518) mirrors node_modules/posthog-js/dist/image-bitmap-data-url-worker-*.js.map into frontend/dist/ as part of pnpm --filter=@posthog/frontend build — the step immediately preceding Collect static files. The workflow-level cp was always duplicating bundler logic; #59518 just made that duplication visible by breaking the stale path.

Why this over #59839's cp … posthog-js/dist … 2>/dev/null || true:

  • Single source of truth in copyRRWebWorkerFiles(). The workflow shouldn't redo what the bundler already does.
  • || true silently swallows real failures. If the rrweb files move again, we wouldn't notice until collectstatic fails much later (or, worse, ships a broken sourcemap reference).

How did you test this code?

I'm an agent. No manual testing performed beyond local verification that:

  • frontend/node_modules/posthog-js/dist/image-bitmap-data-url-worker-*.js.map exists.
  • frontend/node_modules/@posthog/rrweb/ no longer exists (confirming the stale cp is unreachable).
  • copyRRWebWorkerFiles() is called from frontend/build.mjs and reads from node_modules/posthog-js/dist.

The real validation is CI on this PR.

Publish to changelog?

no

🤖 Agent context

Cursor agent (Claude Opus 4.7), kicked off after Mendral's alerts flagged the broken cp step.

Considered both approaches: (a) re-point the cp at posthog-js/dist and harden with || true (Mendral's PR #59839), or (b) drop the cp entirely and rely on the bundler-level mirror. Picked (b) for the reasons in the Changes section — keeping one canonical path-aware location (utils.mjs) is more robust than a defensive duplicate that masks failures.

If reviewer prefers Mendral's approach, close this PR and merge #59839 instead.

Made with Cursor

PR #59518 dropped @posthog/rrweb as a direct frontend dependency and
moved the image-bitmap worker map mirror into copyRRWebWorkerFiles()
(common/esbuilder/utils.mjs), which now copies from
node_modules/posthog-js/dist into frontend/dist/ during
`pnpm --filter=@posthog/frontend build`.

The Playwright workflow's pre-collectstatic `cp ... @posthog/rrweb/dist/
image-bitmap-data-url-worker-*.js.map ...` no longer matches anything,
because `@posthog/rrweb` is no longer a hoisted top-level package — pnpm
only exposes it under .pnpm/, not node_modules/@posthog/rrweb/. The
glob's failure broke the E2E job.

Rather than re-pointing the cp at posthog-js/dist (which would duplicate
build-time logic in YAML and silently swallow real failures via
`|| true`), drop the cp entirely. The build step right above already
mirrors the files via copyRRWebWorkerFiles(). One source of truth.

Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 24, 2026

Reviews (1): Last reviewed commit: "fix(ci): drop redundant rrweb worker map..." | Re-trigger Greptile

@arnohillen arnohillen enabled auto-merge (squash) May 24, 2026 14:15
@arnohillen
Copy link
Copy Markdown
Contributor Author

@PostHog/team-devex Could I get a review on this PR please :) It's linked to an alert and the alert is spamming me on slack

@arnohillen arnohillen requested a review from a team May 26, 2026 16:15
@arnohillen
Copy link
Copy Markdown
Contributor Author

@github-actions
Copy link
Copy Markdown
Contributor

🎭 Playwright report · View test results →

⚠️ 1 flaky test:

  • Redirect to appropriate place after login (chromium)

These issues are not necessarily caused by your changes.
Annoyed by this comment? Help fix flakies and failures and it'll disappear!

@arnohillen arnohillen merged commit a60e3e4 into master May 31, 2026
148 checks passed
@arnohillen arnohillen deleted the ahillen/drop-playwright-rrweb-cp branch May 31, 2026 01:57
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented May 31, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-05-31 02:17 UTC Run
prod-us ✅ Deployed 2026-05-31 02:30 UTC Run
prod-eu ✅ Deployed 2026-05-31 02:30 UTC Run

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.

2 participants