Skip to content

fix(mcp): ignore default output artifacts in git - #44316

Merged
Dmitry Gozman (dgozman) merged 4 commits into
mainfrom
fix-44289-45178791894-1
Nov 24, 2026
Merged

Dmitry Gozman (dgozman) merged 4 commits into
mainfrom
fix-44289-45178791894-1

Conversation

@microsoft-playwright-automation

Copy link
Copy Markdown
Contributor

Create a local .gitignore before saving files in the default MCP output directory, so snapshots and console logs do not appear in Git status. Preserve existing ignore files and leave custom output directories and CLI mode unchanged. Only an existing ignore file is accepted without an error; other write failures are reported.

Extend the existing browser_navigate test to check saved snapshots and console logs against Git status.

Verified on Windows with Chromium, Firefox and WebKit: 111 owning and neighboring checks passed, with 3 permission checks skipped. Build and full lint passed.

Fixes #44289

Triaged on Windows by the Playwright bot - agent run

@github-actions

This comment has been minimized.

Comment on lines +604 to +607
await fs.promises.writeFile(path.join(dir, '.gitignore'), '*\n', { flag: 'wx' }).catch(error => {
if (error.code !== 'EEXIST')
throw error;
});

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.

why use .catch instead of surrounding this in a try { ... } catch (error) { ... }?

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

5257 passed, 644 skipped


Merge workflow run.

@dgozman
Dmitry Gozman (dgozman) merged commit 264e65c into main Nov 24, 2026
19 checks passed
@dgozman
Dmitry Gozman (dgozman) deleted the fix-44289-45178791894-1 branch November 24, 2026 17:04
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.

[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)

3 participants