Skip to content

Commit 4c4e488

Browse files
committed
Fix spotless formatting violations
1 parent 2522667 commit 4c4e488

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

.github/prompts/fix-pr-ci-failures.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Do not stop a given execution until you have worked through all phases below.
1616
2. Check that the branch is up-to-date with remote: `git fetch && git status` - exit and warn if behind
1717
3. Get the current branch name using `git branch --show-current`
1818
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
2020
6. Check if there are actually CI failures to fix - if all jobs passed, exit early
2121

2222
## Phase 1: Gather Information
@@ -26,22 +26,22 @@ Do not stop a given execution until you have worked through all phases below.
2626

2727
1. Get repository info: `gh repo view --json owner,name`
2828
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
35-
- Download logs using: `cd /tmp && gh auth token | xargs -I {} curl -sSfL -H "Authorization: token {}" -o <job-name>.log "https://api.github.com/repos/<owner>/<repo>/actions/jobs/<job-id>/logs"`
36-
- Example: `cd /tmp && gh auth token | xargs -I {} curl -sSfL -H "Authorization: token {}" -o test0-java8-indy-false.log "https://api.github.com/repos/open-telemetry/opentelemetry-java-instrumentation/actions/jobs/53713949850/logs"`
37-
- 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
35+
- Download logs using: `cd /tmp && gh auth token | xargs -I {} curl -sSfL -H "Authorization: token {}" -o <job-name>.log "https://api.github.com/repos/<owner>/<repo>/actions/jobs/<job-id>/logs"`
36+
- Example: `cd /tmp && gh auth token | xargs -I {} curl -sSfL -H "Authorization: token {}" -o test0-java8-indy-false.log "https://api.github.com/repos/open-telemetry/opentelemetry-java-instrumentation/actions/jobs/53713949850/logs"`
37+
- 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`
4545

4646
## Phase 2: Create CI-PLAN.md
4747

@@ -60,7 +60,7 @@ Do not stop a given execution until you have worked through all phases below.
6060
- [ ] Task: <gradle-task-path>
6161
- Seen in: <job-name-1>, <job-name-2>, ...
6262
- Log files: /tmp/<file1>.log, /tmp/<file2>.log
63-
63+
6464
- [ ] Task: <gradle-task-path>
6565
- Seen in: <job-name-1>, <job-name-2>, ...
6666
- 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.
7777
- For each failed task:
7878
- Analyze the failure
7979
- 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**:
8183
- For compilation errors: `./gradlew <failed-task-path>`
8284
- For test failures: `./gradlew <failed-test-task>`
8385
- Verify the fix resolves the issue

0 commit comments

Comments
 (0)