fix(cli): gitignore .playwright-cli on workspace install - #42314
Closed
Burak Keskin (official-burak) wants to merge 1 commit into
Closed
fix(cli): gitignore .playwright-cli on workspace install#42314Burak Keskin (official-burak) wants to merge 1 commit into
Burak Keskin (official-burak) wants to merge 1 commit into
Conversation
Traces and snapshots under that directory can include request headers and bodies. install left it untracked, so git add -A would pick it up.
Author
|
@microsoft-github-policy-service agree |
Author
|
Closing this — CONTRIBUTING requires the issue to be assigned before a PR. Thank you. |
| try { | ||
| existing = await fs.promises.readFile(gitignorePath, 'utf8'); | ||
| } catch (error) { | ||
| if ((error as NodeJS.ErrnoException).code !== 'ENOENT') |
There was a problem hiding this comment.
A failed .gitignore write now fails the whole install. Let's make it best-effort.
It writes .gitignore unconditionally, even outside a git repo. playwright-cli install runs in any directory; this creates a .gitignore where none may be wanted. Let's only add the line to existing .gitignore.
Member
|
Will be fixed by #42318 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #42307
playwright-cli installcreates.playwright/for config and later writes traces, snapshots, screenshots, and PDFs under.playwright-cli/. A trace records request headers and bodies, so an authenticated session can leave credentials in the working tree as an untracked directory thatgit add -Awill pick up.create-playwrightalready appends/playwright/.auth/to.gitignorefor the same reason. This does the equivalent for the CLI output directory:.playwright-cli/to.gitignoreon workspace install (idempotent; skips-g).gitignorecontents intact.playwright/(project config) is left alone.Test
npx playwright test --config=tests/mcp/playwright.config.ts --project=chrome -g "gitignores|appends CLI output"The rest of
cli-miscis unchanged except a check that--skills -gdoes not create a workspace.gitignore.