Skip to content

Commit 40e8366

Browse files
authored
Merge branch 'main' into spring-cloud-update
2 parents 0c0e37f + 82942c2 commit 40e8366

File tree

228 files changed

+5373
-1568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+5373
-1568
lines changed

.github/graal-native-docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ services:
55
- "27017:27017"
66

77
zookeeper:
8-
image: confluentinc/cp-zookeeper:6.2.10
8+
image: confluentinc/cp-zookeeper:7.7.7
99
environment:
1010
ZOOKEEPER_CLIENT_PORT: 2181
1111
ZOOKEEPER_TICK_TIME: 2000
1212
ports:
1313
- "22181:2181"
1414

1515
kafka:
16-
image: confluentinc/cp-kafka:6.2.10
16+
image: confluentinc/cp-kafka:7.7.7
1717
ports:
1818
- 9094:9094
1919
depends_on:
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
mode: agent
3+
---
4+
5+
# Fix PR CI failures
6+
7+
Analyze the CI failures in the PR for the current branch and fix them, following the structured plan below.
8+
9+
Each time this prompt is triggered, assume you are starting fresh from the beginning of the process.
10+
11+
Do not stop a given execution until you have worked through all phases below.
12+
13+
## Phase 0: Validate
14+
15+
1. Verify we're not on a protected branch: `git branch --show-current` should not be `main`
16+
2. Check that the branch is up-to-date with remote: `git fetch && git status` - exit and warn if behind
17+
3. Get the current branch name using `git branch --show-current`
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 --jq '.statusCheckRollup[] | select(.conclusion == "FAILURE") | {name: .name, detailsUrl: .detailsUrl}'` to get the list of all failed CI jobs
20+
6. Check if there are actually CI failures to fix - if all jobs passed, exit early
21+
22+
## Phase 1: Gather Information
23+
24+
**Phase 1 is for gathering information ONLY. Do NOT analyze failures or look at any code during this phase.**
25+
**Your only goal in Phase 1 is to collect: job names, job IDs, log files, and failed task names.**
26+
27+
1. Get repository info: `gh repo view --json owner,name`
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
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`
45+
46+
## Phase 2: Create CI-PLAN.md
47+
48+
**ONLY:** Create the CI-PLAN.md file in the repository root with the following structure:
49+
50+
```markdown
51+
# CI Failure Analysis Plan
52+
53+
## Failed Jobs Summary
54+
- Job 1: <job-name> (job ID: <id>)
55+
- Job 2: <job-name> (job ID: <id>)
56+
...
57+
58+
## Unique Failed Gradle Tasks
59+
60+
- [ ] Task: <gradle-task-path>
61+
- Seen in: <job-name-1>, <job-name-2>, ...
62+
- Log files: /tmp/<file1>.log, /tmp/<file2>.log
63+
64+
- [ ] Task: <gradle-task-path>
65+
- Seen in: <job-name-1>, <job-name-2>, ...
66+
- Log files: /tmp/<file1>.log, /tmp/<file2>.log
67+
68+
## Notes
69+
[Any patterns or observations about the failures]
70+
```
71+
72+
## Phase 3: Fix Issues
73+
74+
**Important**: Do not commit CI-PLAN.md - it's only for tracking work during the session
75+
76+
- Work through the CI-PLAN.md, checking items off as you complete them
77+
- For each failed task:
78+
- Analyze the failure
79+
- Implement the fix
80+
- To fix spotless failures: Run `./gradlew :<failed-module-path>:spotlessApply`
81+
- **Test locally before committing**:
82+
- For markdown lint failures: `mise run lint:markdown`
83+
- For compilation errors: `./gradlew <failed-task-path>`
84+
- For test failures: `./gradlew <failed-test-task>`
85+
- Verify the fix resolves the issue
86+
- Update the checkbox in CI-PLAN.md
87+
- Commit each logical fix as a separate commit
88+
- Reminder: do not commit CI-PLAN.md
89+
- Do not git push in this phase
90+
91+
## Phase 4: Validate and Push
92+
93+
- Once all fixes are committed, push the changes: `git push` (or `git push -f` if needed)
94+
- Provide a summary of:
95+
- What failures were found
96+
- What fixes were applied
97+
- Which commits were created

.github/repository-settings.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ private admin repo.
2929
### Organization variables
3030

3131
- `OTELBOT_APP_ID`
32+
- `OTELBOT_JAVA_INSTRUMENTATION_APP_ID` (scoped only to this repo)

.github/workflows/auto-license-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
if: steps.check-patch.outputs.exists == 'true'
7272
id: otelbot-token
7373
with:
74-
app-id: ${{ secrets.OTELBOT_JAVA_INSTRUMENTATION_APP_ID }}
74+
app-id: ${{ vars.OTELBOT_JAVA_INSTRUMENTATION_APP_ID }}
7575
private-key: ${{ secrets.OTELBOT_JAVA_INSTRUMENTATION_PRIVATE_KEY }}
7676

7777
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

.github/workflows/auto-update-otel-sdk.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ jobs:
7575
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
7676

7777
- name: Update license report
78-
run: ./gradlew generateLicenseReport
78+
# with the build cache enabled occasionally produces outdated results
79+
run: ./gradlew generateLicenseReport --no-build-cache
7980

8081
- name: Undo license report clean
8182
if: failure()

.github/workflows/codeql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080
./gradlew assemble -x javadoc
8181
-x :smoke-tests-otel-starter:spring-boot-3:collectReachabilityMetadata
8282
-x :smoke-tests-otel-starter:spring-boot-3.2:collectReachabilityMetadata
83+
-x :smoke-tests-otel-starter:spring-boot-4:collectReachabilityMetadata
8384
-x :smoke-tests-otel-starter:spring-boot-reactive-3:collectReachabilityMetadata
8485
--no-build-cache --no-daemon
8586

.github/workflows/metadata-update.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ jobs:
2121
pull-requests: write # for adding label and assignee to PR
2222

2323
steps:
24+
- uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
25+
id: otelbot-token
26+
with:
27+
app-id: ${{ vars.OTELBOT_JAVA_INSTRUMENTATION_APP_ID }}
28+
private-key: ${{ secrets.OTELBOT_JAVA_INSTRUMENTATION_PRIVATE_KEY }}
29+
2430
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
31+
with:
32+
token: ${{ steps.otelbot-token.outputs.token }}
2533

2634
- name: Free disk space
2735
run: .github/scripts/gha-free-disk-space.sh
@@ -55,27 +63,16 @@ jobs:
5563
if: steps.diffcheck.outputs.has_diff == 'true'
5664
run: .github/scripts/use-cla-approved-bot.sh
5765

58-
- uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
59-
if: steps.diffcheck.outputs.has_diff == 'true'
60-
id: otelbot-token
61-
with:
62-
app-id: ${{ vars.OTELBOT_APP_ID }}
63-
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
64-
6566
- name: Find or create metadata update branch
6667
if: steps.diffcheck.outputs.has_diff == 'true'
6768
id: findbranch
68-
env:
69-
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
7069
run: |
7170
BRANCH_NAME="otelbot/metadata-update-main"
7271
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
7372
git checkout -B "$BRANCH_NAME"
7473
7574
- name: Commit and push changes
7675
if: steps.diffcheck.outputs.has_diff == 'true'
77-
env:
78-
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
7976
run: |
8077
BRANCH_NAME="${{ steps.findbranch.outputs.branch }}"
8178
git commit -m "chore: update instrumentation list [automated]" || echo "No changes to commit."
@@ -104,7 +101,7 @@ jobs:
104101
- name: Add label to PR
105102
if: steps.createpr.outputs.new_pr == 'true'
106103
env:
107-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
108105
run: |
109106
BRANCH_NAME="${{ steps.findbranch.outputs.branch }}"
110107
PR_URL=$(gh pr list --state open --head "$BRANCH_NAME" --json url -q '.[0].url')

.github/workflows/pr-automation-comments.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ jobs:
4141
"- Code examples showing before/after usage",
4242
"",
4343
"### Checklist",
44-
"- [ ] Migration notes added to the PR description",
45-
"- [ ] Breaking change is documented in the "Unreleased" section of the [Changelog](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/CHANGELOG.md), preferably as part of this PR.",
46-
"- [ ] Consider if this change requires a major version bump",
44+
"- Migration notes added to the PR description",
45+
"- Breaking change is documented in the \"Unreleased\" section of the [Changelog](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/CHANGELOG.md), preferably as part of this PR.",
46+
"- Consider if this change requires a major version bump",
4747
"",
4848
"Your migration notes will be included in the release notes to help users upgrade smoothly. The more detailed and helpful they are, the better the user experience will be.",
4949
"",

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,4 @@ replay_pid*
6161
.telemetry*
6262
.lycheecache
6363

64-
!java-agent/benchmark/releases/*.jar
65-
64+
build-scan.txt

conventions/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dependencies {
5656
// When updating, update above in plugins too
5757
implementation("com.diffplug.spotless:spotless-plugin-gradle:8.1.0")
5858
implementation("com.google.guava:guava:33.5.0-jre")
59-
implementation("com.gradleup.shadow:shadow-gradle-plugin:9.2.2")
59+
implementation("com.gradleup.shadow:shadow-gradle-plugin:9.3.0")
6060
implementation("org.apache.httpcomponents:httpclient:4.5.14")
6161
implementation("com.gradle.develocity:com.gradle.develocity.gradle.plugin:4.2.2")
6262
implementation("org.owasp:dependency-check-gradle:12.1.9")

0 commit comments

Comments
 (0)