You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/prompts/fix-pr-ci-failures.md
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Do not stop a given execution until you have worked through all phases below.
16
16
2. Check that the branch is up-to-date with remote: `git fetch && git status` - exit and warn if behind
17
17
3. Get the current branch name using `git branch --show-current`
18
18
4. Find the PR for this branch using `gh pr list --head <branch-name> --json number,title` and extract the PR number
19
-
5. Use `gh pr view <pr-number> --json statusCheckRollup` to get the list of all failed CI jobs
19
+
5. Use `gh pr view <pr-number> --json statusCheckRollup --jq '.statusCheckRollup[] | select(.conclusion == "FAILURE") | {name: .name, detailsUrl: .detailsUrl}'` to get the list of all failed CI jobs
20
20
6. Check if there are actually CI failures to fix - if all jobs passed, exit early
21
21
22
22
## Phase 1: Gather Information
@@ -26,22 +26,22 @@ Do not stop a given execution until you have worked through all phases below.
26
26
27
27
1. Get repository info: `gh repo view --json owner,name`
28
28
2. For unique job type that failed
29
-
-**Important**: Ignore duplicate jobs that only differ by parameters inside of parenthesis. For example:
30
-
- In `abc / def (x, y, z)`, the job is `abc / def` while x, y, and z are parameters
31
-
-**Strategy**: Download logs for 1-2 representative jobs first to identify patterns (e.g., one "build" job, one "test0" job)
32
-
- Compilation failures typically repeat across all jobs, so you don't need every log file
33
-
- Retrieve logs for selected representative jobs:
34
-
- Get the job ID from the failed run by examining the PR status checks JSON
- The GitHub API responds with an HTTP 302 redirect to blob storage; `-L` (already included) ensures the download follows the redirect and saves the final log contents.
38
-
- Find all gradle tasks that failed:
39
-
- Search for failed tasks: `grep "Task.*FAILED" /tmp/<job-name>.log`
40
-
- Look for test failures: `grep "FAILED" /tmp/<job-name>.log | grep -E "(Test|test)"`
41
-
- Example output: `> Task :instrumentation:cassandra:cassandra-4.0:javaagent:test FAILED`
42
-
- Extract error context:
43
-
- For compilation errors: `grep -B 5 -A 20 "error:" /tmp/<job-name>.log`
44
-
- For task failures: `grep -B 2 -A 15 "Task.*FAILED" /tmp/<job-name>.log`
29
+
-**Important**: Ignore duplicate jobs that only differ by parameters inside of parenthesis. For example:
30
+
- In `abc / def (x, y, z)`, the job is `abc / def` while x, y, and z are parameters
31
+
-**Strategy**: Download logs for 1-2 representative jobs first to identify patterns (e.g., one "build" job, one "test0" job)
32
+
- Compilation failures typically repeat across all jobs, so you don't need every log file
33
+
- Retrieve logs for selected representative jobs:
34
+
- Get the job ID from the failed run by examining the PR status checks JSON
- The GitHub API responds with an HTTP 302 redirect to blob storage; `-L` (already included) ensures the download follows the redirect and saves the final log contents.
38
+
- Find all gradle tasks that failed:
39
+
- Search for failed tasks: `grep "Task.*FAILED" /tmp/<job-name>.log`
40
+
- Look for test failures: `grep "FAILED" /tmp/<job-name>.log | grep -E "(Test|test)"`
41
+
- Example output: `> Task :instrumentation:cassandra:cassandra-4.0:javaagent:test FAILED`
42
+
- Extract error context:
43
+
- For compilation errors: `grep -B 5 -A 20 "error:" /tmp/<job-name>.log`
44
+
- For task failures: `grep -B 2 -A 15 "Task.*FAILED" /tmp/<job-name>.log`
45
45
46
46
## Phase 2: Create CI-PLAN.md
47
47
@@ -60,7 +60,7 @@ Do not stop a given execution until you have worked through all phases below.
60
60
- [ ] Task: <gradle-task-path>
61
61
- Seen in: <job-name-1>, <job-name-2>, ...
62
62
- Log files: /tmp/<file1>.log, /tmp/<file2>.log
63
-
63
+
64
64
- [ ] Task: <gradle-task-path>
65
65
- Seen in: <job-name-1>, <job-name-2>, ...
66
66
- Log files: /tmp/<file1>.log, /tmp/<file2>.log
@@ -77,7 +77,9 @@ Do not stop a given execution until you have worked through all phases below.
77
77
- For each failed task:
78
78
- Analyze the failure
79
79
- Implement the fix
80
-
-**Test locally before committing**:
80
+
- For spotless failures: `./gradlew spotlessApply` to auto-fix formatting issues
81
+
-**Test loc
82
+
ally before committing**:
81
83
- For compilation errors: `./gradlew <failed-task-path>`
82
84
- For test failures: `./gradlew <failed-test-task>`
0 commit comments