Skip to content

Conversation

@seanmcguire12
Copy link
Member

@seanmcguire12 seanmcguire12 commented Dec 23, 2025

  • temporary branch to confirm failure of user data dir on windows with chrome launcher
  • to be deleted

Summary by cubic

Run a Windows CI job to execute a Playwright test that verifies Chrome writes profile data to the provided userDataDir. This helps reproduce and diagnose Windows-specific issues in the V3 local browser launcher and gates later CI steps on this check.

  • Bug Fixes

    • Pass userDataDir to chrome-launcher via the explicit option instead of the --user-data-dir flag to ensure persistence on Windows.
  • Refactors

    • Renamed server route directories from :id to _id and updated imports/OpenAPI generation to fix Windows path compatibility during checkout.

Written for commit c741e6e. Summary will update automatically on new commits.

@changeset-bot
Copy link

changeset-bot bot commented Dec 23, 2025

⚠️ No Changeset found

Latest commit: c741e6e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 23, 2025

Greptile Summary

Added Windows CI job to test userDataDir functionality with chrome-launcher.

  • Created new run-windows-user-data-dir-test job that runs before all other CI jobs
  • Added test spec that validates Chrome creates Default profile and Local State files in specified directory
  • Test uses temporary directories with proper cleanup in afterEach hook

Confidence Score: 5/5

  • Safe temporary test branch for confirming Windows behavior
  • Clean implementation following existing test patterns with proper setup/teardown, no logical errors or security concerns
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/ci.yml Added dedicated Windows job to test userDataDir functionality with Chrome launcher, blocks all subsequent jobs
packages/core/lib/v3/tests/user-data-dir.spec.ts New test spec verifying Chrome userDataDir creation and persistence with proper cleanup

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Actions
    participant Win as Windows Runner
    participant PNPM as pnpm
    participant Test as Playwright Test
    participant V3 as V3 Instance
    participant Chrome as Chrome Launcher
    participant FS as File System

    GH->>Win: Trigger run-windows-user-data-dir-test
    Win->>Win: Checkout code
    Win->>Win: Setup Node.js & pnpm
    Win->>PNPM: pnpm install --frozen-lockfile
    PNPM-->>Win: Dependencies installed
    
    Win->>Test: Run user-data-dir.spec.ts
    Test->>FS: Create temp dir (mkdtempSync)
    FS-->>Test: testDir path
    
    Test->>V3: Initialize with userDataDir config
    V3->>Chrome: Launch with --user-data-dir flag
    Chrome->>FS: Create profile directories
    FS->>FS: Write "Default" folder
    FS->>FS: Write "Local State" file
    
    Test->>FS: Poll for "Default" directory
    FS-->>Test: Directory exists
    Test->>FS: Check "Local State" file
    FS-->>Test: File exists
    
    Test->>V3: close()
    V3->>Chrome: Kill process
    Test->>FS: rmSync(testDir)
    FS-->>Test: Cleanup complete
    
    Test-->>Win: Test passed/failed
    Win-->>GH: Job complete (blocks other jobs)
Loading

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/core/lib/v3/tests/user-data-dir.spec.ts">

<violation number="1" location="packages/core/lib/v3/tests/user-data-dir.spec.ts:46">
P2: The second file existence check should also use `expect.poll()` for consistency and to avoid flaky tests. If `Default` directory needs polling due to timing, `Local State` file likely does too.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

})
.toBe(true);

expect(fs.existsSync(path.join(testDir, "Local State"))).toBe(true);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 23, 2025

Choose a reason for hiding this comment

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

P2: The second file existence check should also use expect.poll() for consistency and to avoid flaky tests. If Default directory needs polling due to timing, Local State file likely does too.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/core/lib/v3/tests/user-data-dir.spec.ts, line 46:

<comment>The second file existence check should also use `expect.poll()` for consistency and to avoid flaky tests. If `Default` directory needs polling due to timing, `Local State` file likely does too.</comment>

<file context>
@@ -0,0 +1,48 @@
+      })
+      .toBe(true);
+
+    expect(fs.existsSync(path.join(testDir, &quot;Local State&quot;))).toBe(true);
+  });
+});
</file context>
Fix with Cubic

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