Unverified 提交 71812e65 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Prettier claude commands md (#2278)

#skip-bb
上级 5894cc77
...@@ -7,34 +7,41 @@ Rebase E2E test snapshots based on failed tests from the PR comments. ...@@ -7,34 +7,41 @@ Rebase E2E test snapshots based on failed tests from the PR comments.
1. Get the current PR number using `gh pr view --json number --jq '.number'` 1. Get the current PR number using `gh pr view --json number --jq '.number'`
2. Fetch PR comments and look for the Playwright test results comment. Parse out the failed test filenames from either: 2. Fetch PR comments and look for the Playwright test results comment. Parse out the failed test filenames from either:
- The "Failed Tests" section (lines starting with `- \`filename.spec.ts`) - The "Failed Tests" section (lines starting with `- \`filename.spec.ts`)
- The "Update Snapshot Commands" section (contains `npm run e2e e2e-tests/filename.spec.ts`) - The "Update Snapshot Commands" section (contains `npm run e2e e2e-tests/filename.spec.ts`)
3. If no failed tests are found in the PR comments, inform the user and stop. 3. If no failed tests are found in the PR comments, inform the user and stop.
4. Run the pre-e2e setup: 4. Run the pre-e2e setup:
``` ```
npm run pre:e2e npm run pre:e2e
``` ```
5. For each failed test file, run the e2e test with snapshot update: 5. For each failed test file, run the e2e test with snapshot update:
``` ```
npm run e2e e2e-tests/<testFilename>.spec.ts -- --update-snapshots npm run e2e e2e-tests/<testFilename>.spec.ts -- --update-snapshots
``` ```
6. After updating snapshots, re-run the same tests WITHOUT `--update-snapshots` to verify they pass consistently: 6. After updating snapshots, re-run the same tests WITHOUT `--update-snapshots` to verify they pass consistently:
``` ```
npm run e2e e2e-tests/<testFilename>.spec.ts npm run e2e e2e-tests/<testFilename>.spec.ts
``` ```
If any test fails on this verification run, inform the user that the snapshots may be flaky and stop. If any test fails on this verification run, inform the user that the snapshots may be flaky and stop.
7. Show the user which snapshots were updated using `git diff` on the snapshot files. 7. Show the user which snapshots were updated using `git diff` on the snapshot files.
8. Review the snapshot changes to ensure they look reasonable and are consistent with the PR's purpose. Consider: 8. Review the snapshot changes to ensure they look reasonable and are consistent with the PR's purpose. Consider:
- Do the changes align with what the PR is trying to accomplish? - Do the changes align with what the PR is trying to accomplish?
- Are there any unexpected or suspicious changes? - Are there any unexpected or suspicious changes?
9. If the snapshots look reasonable, commit and push the changes: 9. If the snapshots look reasonable, commit and push the changes:
``` ```
git add e2e-tests/snapshots/ git add e2e-tests/snapshots/
git commit -m "Update E2E snapshots" git commit -m "Update E2E snapshots"
......
...@@ -9,17 +9,20 @@ Address review comments and failing checks on a GitHub Pull Request. ...@@ -9,17 +9,20 @@ Address review comments and failing checks on a GitHub Pull Request.
## Instructions ## Instructions
1. **Determine the PR to work on:** 1. **Determine the PR to work on:**
- If `$ARGUMENTS` contains a PR number or URL, use that - If `$ARGUMENTS` contains a PR number or URL, use that
- Otherwise, get the current branch's PR using `gh pr view --json number,url,title,body --jq '.'` - Otherwise, get the current branch's PR using `gh pr view --json number,url,title,body --jq '.'`
- If no PR is found, inform the user and stop - If no PR is found, inform the user and stop
2. **Fetch all PR review comments:** 2. **Fetch all PR review comments:**
``` ```
gh pr view <PR_NUMBER> --json reviews,comments --jq '.' gh pr view <PR_NUMBER> --json reviews,comments --jq '.'
gh api repos/{owner}/{repo}/pulls/<PR_NUMBER>/comments gh api repos/{owner}/{repo}/pulls/<PR_NUMBER>/comments
``` ```
3. **Analyze the PR comments and identify actionable items:** 3. **Analyze the PR comments and identify actionable items:**
- Look for code review comments that request changes - Look for code review comments that request changes
- Look for general review comments with feedback - Look for general review comments with feedback
- Prioritize comments from reviewers that are: - Prioritize comments from reviewers that are:
...@@ -32,37 +35,46 @@ Address review comments and failing checks on a GitHub Pull Request. ...@@ -32,37 +35,46 @@ Address review comments and failing checks on a GitHub Pull Request.
- Nitpicks explicitly marked as optional - Nitpicks explicitly marked as optional
4. **Check for failing CI checks:** 4. **Check for failing CI checks:**
``` ```
gh pr checks <PR_NUMBER> gh pr checks <PR_NUMBER>
``` ```
Note which checks are failing, particularly Playwright/E2E tests. Note which checks are failing, particularly Playwright/E2E tests.
5. **For each actionable review comment:** 5. **For each actionable review comment:**
- Read the relevant file(s) mentioned in the comment - Read the relevant file(s) mentioned in the comment
- Understand the context and the requested change - Understand the context and the requested change
- Make the necessary code changes to address the feedback - Make the necessary code changes to address the feedback
- Keep track of what was changed - Keep track of what was changed
6. **If there are failing Playwright/E2E tests:** 6. **If there are failing Playwright/E2E tests:**
- Check if the failures are snapshot-related by examining the PR comments for Playwright test results - Check if the failures are snapshot-related by examining the PR comments for Playwright test results
- If snapshots need updating, run the `/e2e-rebase` skill to fix them - If snapshots need updating, run the `/e2e-rebase` skill to fix them
- If the failures are not snapshot-related, investigate and fix the underlying test issues - If the failures are not snapshot-related, investigate and fix the underlying test issues
7. **After making all changes, verify the fixes:** 7. **After making all changes, verify the fixes:**
- Run relevant linters: `npm run lint:fix` - Run relevant linters: `npm run lint:fix`
- Run type checks if TypeScript files were modified: `npm run typecheck` - Run type checks if TypeScript files were modified: `npm run typecheck`
- Run any relevant unit tests for modified code - Run any relevant unit tests for modified code
8. **Review all changes made:** 8. **Review all changes made:**
``` ```
git diff git diff
git status git status
``` ```
Ensure the changes are reasonable and address the review feedback appropriately. Ensure the changes are reasonable and address the review feedback appropriately.
9. **Commit and push the changes:** 9. **Commit and push the changes:**
- Stage all modified files - Stage all modified files
- Create a commit with a descriptive message summarizing what was addressed: - Create a commit with a descriptive message summarizing what was addressed:
``` ```
git add -A git add -A
git commit -m "Address PR review feedback git commit -m "Address PR review feedback
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论