Skip to content

Conversation

@rekmarks
Copy link
Member

@rekmarks rekmarks commented Jan 27, 2026

Summary

This PR fixes CI failures caused by Playwright browser installation issues in different environments.

Problem

PR #743 attempted to skip Playwright browser downloads in Dependabot environments to avoid OOM failures. However, it had two issues:

  1. The GITHUB_ACTOR check didn't work in the Dependabot updater environment
  2. Adding the PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD check to the install script caused unit tests to fail because the test job actually needs Playwright browsers for the streams package tests

Solution

  1. Use DEPENDABOT env var - The Dependabot updater sets this variable, making detection reliable
  2. Remove skip flag from test job only - The CI workflow was setting PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 for all jobs including tests. Now the test job doesn't set this flag, so browsers are installed. Other jobs (lint, build, changelog, integration) still skip browser download since they don't need them.
  3. Use minimal headless browser in CI - When browsers are needed in CI, install only the headless shell (--only-shell) for faster downloads and smaller footprint. Local development still gets the full browser for debugging.

Changes

  • scripts/playwright-install.sh: Skip in Dependabot, respect PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD, use minimal browser in CI
  • scripts/rebuild-native.sh: Use DEPENDABOT instead of GITHUB_ACTOR check
  • .github/workflows/lint-build-test.yml: Remove PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD from test job only

Note

Aligns CI and install scripts to prevent Playwright-related failures while keeping tests functional.

  • scripts/playwright-install.sh: Skip in Dependabot via DEPENDABOT or GITHUB_ACTOR; honor PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD; in CI install Chromium with --with-deps, using --only-shell when PLAYWRIGHT_ONLY_SHELL=1
  • .github/workflows/lint-build-test.yml (test job): replace PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD with PLAYWRIGHT_ONLY_SHELL so browsers install minimally during tests; other jobs still skip downloads
  • scripts/rebuild-native.sh: skip native rebuilds in Dependabot using DEPENDABOT or GITHUB_ACTOR

Written by Cursor Bugbot for commit 0769b3c. This will update automatically on new commits. Configure here.

Change environment variable check from GITHUB_ACTOR (GitHub Actions only)
to DEPENDABOT (Dependabot updater environment) to properly skip postinstall
scripts during dependency resolution.

- playwright-install.sh: Check DEPENDABOT instead of GITHUB_ACTOR
- rebuild-native.sh: Check DEPENDABOT instead of GITHUB_ACTOR
- playwright-install.sh: Add secondary check for PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD

This fixes Dependabot npm package updates which were failing because:
1. GITHUB_ACTOR is only available in GitHub Actions workflows
2. Dependabot's updater runs in a separate environment where GITHUB_ACTOR is not set
3. Without skipping, playwright-install.sh runs yarn playwright install,
   which tries to download browsers and fails, corrupting the yarn state

Fixes the 'Couldn't find the node_modules state file' error in Dependabot updates.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rekmarks rekmarks requested a review from a team as a code owner January 27, 2026 22:12
@rekmarks rekmarks enabled auto-merge January 27, 2026 22:14
sirtimid
sirtimid previously approved these changes Jan 27, 2026
Copy link
Contributor

@sirtimid sirtimid left a comment

Choose a reason for hiding this comment

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

🤞

rekmarks and others added 2 commits January 27, 2026 14:41
The test job needs Playwright browsers for the streams package tests.
The env var was set to skip browser download, but it should only apply
to jobs that don't need browsers (lint, build, changelog, integration).

This fixes the Playwright cleanup error in CI unit tests.

Co-Authored-By: Claude <noreply@anthropic.com>
Install only the headless shell in CI (--only-shell) for faster downloads
and smaller footprint. Keep full browser locally for debugging.

Co-Authored-By: Claude <noreply@anthropic.com>
rekmarks and others added 3 commits January 27, 2026 14:49
The --only-shell flag only installs the headless shell, but e2e tests
need the full browser for launchPersistentContext with headless: false.

Co-Authored-By: Claude <noreply@anthropic.com>
Unit tests only need the headless shell, which is smaller and faster.
E2e tests need the full browser for launchPersistentContext.

- Add PLAYWRIGHT_ONLY_SHELL=1 to test job
- Script checks for this flag and uses --only-shell when set

Co-Authored-By: Claude <noreply@anthropic.com>
Both scripts now check for DEPENDABOT (set in updater environment) OR
GITHUB_ACTOR=dependabot[bot] (set in PR workflows) to properly skip
in all Dependabot contexts.

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 88.44%
🟰 ±0%
5765 / 6518
🔵 Statements 88.32%
🟰 ±0%
5857 / 6631
🔵 Functions 87.23%
🟰 ±0%
1504 / 1724
🔵 Branches 84.95%
🟰 ±0%
2078 / 2446
File CoverageNo changed files found.
Generated in workflow #3372 for commit 0769b3c by the Vitest Coverage Report Action

@rekmarks rekmarks disabled auto-merge January 27, 2026 23:07
@rekmarks rekmarks enabled auto-merge January 27, 2026 23:07
@rekmarks rekmarks added this pull request to the merge queue Jan 27, 2026
Merged via the queue into main with commit 6c05d8d Jan 27, 2026
33 checks passed
@rekmarks rekmarks deleted the rekm/fix-dependabot-2 branch January 27, 2026 23:33
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