Skip to content

Commit fbe85d7

Browse files
committed
Merge
2 parents e26449f + b1ba761 commit fbe85d7

61 files changed

Lines changed: 1293 additions & 1153 deletions

Some content is hidden

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

.claude/commands/build-and-summarize

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,8 @@ echo
7272
echo "Delegating to gradle-logs-analyst agent…"
7373
# If your CLI supports non-streaming, set it here to avoid verbose output.
7474
# Example (uncomment if supported): export CLAUDE_NO_STREAM=1
75+
76+
# Sub-agents would inherit the full parent env, including CLAUDECODE, which
77+
# apparently causes problems with some versions of Claude (e.g. 4.6).
78+
unset CLAUDECODE
7579
claude "Act as the gradle-logs-analyst agent to parse the build log at: $LOG. Generate the required Gradle summary artifacts as specified in the gradle-logs-analyst agent definition."

.claude/commands/build-and-summarize.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# build-and-summarize
22

3-
Execute the bash script `~/.claude/commands/build-and-summarize` with all provided arguments.
3+
Execute the bash script `.claude/commands/build-and-summarize` with all provided arguments.
44

55
This script will:
66
- Run `./gradlew` with the specified arguments (defaults to 'build' if none provided)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
issuer: https://token.actions.githubusercontent.com
2+
3+
subject: repo:DataDog/java-profiler:ref:refs/heads/main
4+
5+
claim_pattern:
6+
event_name: schedule
7+
ref: refs/heads/main
8+
ref_protected: "true"
9+
job_workflow_ref: DataDog/java-profiler/\.github/workflows/dependabot-automerge\.yml@refs/heads/main
10+
11+
permissions:
12+
contents: write

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ updates:
77
interval: "weekly"
88
day: "monday"
99
open-pull-requests-limit: 5
10+
labels:
11+
- "dependencies"
12+
- "no-release-notes"
13+
ignore:
14+
- dependency-name: "org.junit-pioneer:junit-pioneer"
15+
versions: [">=2.0.0"]
1016
groups:
1117
gradle-minor:
1218
update-types:
@@ -20,6 +26,9 @@ updates:
2026
interval: "weekly"
2127
day: "monday"
2228
open-pull-requests-limit: 5
29+
labels:
30+
- "dependencies"
31+
- "no-release-notes"
2332
groups:
2433
gradle-minor:
2534
update-types:
@@ -33,3 +42,6 @@ updates:
3342
interval: "weekly"
3443
day: "monday"
3544
open-pull-requests-limit: 5
45+
labels:
46+
- "dependencies"
47+
- "no-release-notes"

.github/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- "no-release-notes"
5+
authors:
6+
- "dependabot"
7+
- "dependabot[bot]"
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Streaming filter for Gradle test output.
4+
5+
Compresses verbose test logs:
6+
- PASSED tests: single summary line; all buffered output (including [TEST::INFO]) discarded
7+
- FAILED tests: full context emitted: STARTED line + buffered stdout/stderr + FAILED line
8+
followed by exception/stack trace that comes after the FAILED marker
9+
- SKIPPED tests: single summary line
10+
- CRASHED tests: if the stream ends mid-test (JVM kill, OOM, sanitizer abort), the full
11+
buffer is emitted with a warning header
12+
13+
Designed for inline use with `tee` so the unfiltered raw log is preserved:
14+
15+
./gradlew ... 2>&1 \\
16+
| tee -a "${RAW_LOG}" \\
17+
| python3 -u .github/scripts/filter_gradle_log.py
18+
19+
Exit code and PIPESTATUS:
20+
The filter always exits 0 regardless of test outcomes; use ${PIPESTATUS[0]} in bash
21+
to capture the Gradle exit code:
22+
23+
./gradlew ... 2>&1 | tee -a raw.log | python3 -u filter_gradle_log.py
24+
GRADLE_EXIT=${PIPESTATUS[0]}
25+
26+
Limitations:
27+
- [TEST::INFO] lines emitted from class-level lifecycle methods (@BeforeAll, static
28+
initializers) appear before any STARTED marker and are suppressed in OUTSIDE state.
29+
They remain visible in the raw log preserved by tee.
30+
"""
31+
32+
import re
33+
import sys
34+
35+
# Matches Gradle per-test event lines emitted by the Test task:
36+
#
37+
# com.example.FooTest > testBar STARTED
38+
# com.example.FooTest > testBar[1] PASSED (0.456s)
39+
# com.example.FooTest > testBar(int) FAILED
40+
# com.example.FooTest > testBar SKIPPED
41+
#
42+
# The class name starts with a word character (not '>'), which prevents matching
43+
# "> Task :project:taskName FAILED" build-level lines.
44+
_TEST_EVENT = re.compile(
45+
r'^([\w.$][\w.$ ]* > \S.*?) (STARTED|PASSED|FAILED|SKIPPED)(\s+\([^)]+\))?\s*$'
46+
)
47+
48+
49+
def emit(line: str) -> None:
50+
print(line, flush=True)
51+
52+
53+
def main() -> None:
54+
# --- States ---
55+
OUTSIDE = 0 # between tests: pass lines through directly
56+
BUFFERING = 1 # inside a running test: accumulate output
57+
FAILING = 2 # after FAILED marker: pass lines through until next test
58+
59+
state = OUTSIDE
60+
buf: list = []
61+
62+
for raw in sys.stdin:
63+
line = raw.rstrip('\n')
64+
m = _TEST_EVENT.match(line)
65+
66+
if m:
67+
event = m.group(2)
68+
69+
if event == 'STARTED':
70+
if state == BUFFERING:
71+
# Previous test had no outcome line (shouldn't normally happen).
72+
# Emit the buffer so we don't silently discard output.
73+
for buffered_line in buf:
74+
emit(buffered_line)
75+
elif state == FAILING:
76+
emit('') # blank line to visually separate failure blocks
77+
78+
# Include the STARTED line in the buffer so it appears in failure output.
79+
buf = [line]
80+
state = BUFFERING
81+
82+
elif event == 'PASSED':
83+
buf = []
84+
emit(line)
85+
state = OUTSIDE
86+
87+
elif event == 'FAILED':
88+
# Emit everything collected since STARTED (includes [TEST::INFO] lines).
89+
for buffered_line in buf:
90+
emit(buffered_line)
91+
buf = []
92+
emit(line)
93+
state = FAILING
94+
95+
elif event == 'SKIPPED':
96+
buf = []
97+
emit(line)
98+
state = OUTSIDE
99+
100+
elif state == BUFFERING:
101+
buf.append(line)
102+
103+
else:
104+
# OUTSIDE or FAILING: pass through directly.
105+
# In FAILING state this captures exception lines, stack traces, etc.
106+
# In OUTSIDE state, suppress [TEST::INFO] lines: they originate from
107+
# class-level init (@BeforeAll, static blocks) and are noise when no
108+
# test has failed; the raw log still contains them for reference.
109+
if state == FAILING or not line.startswith('[TEST::INFO]'):
110+
emit(line)
111+
112+
# EOF handling: if still inside a test the JVM likely crashed (SIGABRT from sanitizer,
113+
# OOM kill, etc.). Emit everything so the failure is visible in the filtered log.
114+
if state == BUFFERING and buf:
115+
emit('# WARNING: stream ended inside a test (crash / OOM / sanitizer abort?)')
116+
for buffered_line in buf:
117+
emit(buffered_line)
118+
119+
120+
if __name__ == '__main__':
121+
main()

.github/scripts/prepare_reports.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
set -e
44
mkdir -p test-reports
55
mkdir -p unwinding-reports
6+
cp build/test-raw.log test-reports/ || true
67
cp /tmp/hs_err* test-reports/ || true
8+
cp /tmp/asan_*.log test-reports/ || true
9+
cp /tmp/ubsan_*.log test-reports/ || true
10+
cp /tmp/tsan_*.log test-reports/ || true
711
cp ddprof-test/javacore*.txt test-reports/ || true
812
cp ddprof-test/build/hs_err* test-reports/ || true
913
cp -r ddprof-lib/build/tmp test-reports/native_build || true

.github/scripts/release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fi
6767
if [ "$BRANCH" != "$RELEASE_BRANCH" ]; then
6868
git checkout -b $RELEASE_BRANCH
6969
if ! git diff --quiet; then
70-
git add build.gradle
70+
git add build.gradle.kts
7171
git commit -m "[Automated] Release ${BASE}"
7272
fi
7373
git push $DRYRUN --atomic --set-upstream origin $RELEASE_BRANCH
@@ -82,7 +82,7 @@ fi
8282

8383
CANDIDATE=$(./gradlew printVersion -Psnapshot=false | grep 'Version:' | cut -f2 -d' ')
8484

85-
git add build.gradle
85+
git add build.gradle.kts
8686
git commit -m "[Automated] Bump dev version to ${CANDIDATE}"
8787

8888
git push $DRYRUN --atomic --set-upstream origin $BRANCH

.github/workflows/add-milestone-to-pull-requests.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
steps:
1919
- name: Get project milestones
2020
id: milestones
21-
uses: actions/github-script@47f7cf65b5ced0830a325f705cad64f2f58dddf7 # 3.1.0
21+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # 8.0.0
2222
with:
2323
github-token: ${{secrets.GITHUB_TOKEN}}
2424
script: |
25-
const list = await github.issues.listMilestones({
25+
const list = await github.rest.issues.listMilestones({
2626
owner: context.repo.owner,
2727
repo: context.repo.repo,
2828
state: 'open'
@@ -34,12 +34,12 @@ jobs:
3434
return milestones.length == 0 ? null : milestones[0].number
3535
- name: Update Pull Request
3636
if: steps.milestones.outputs.result != null
37-
uses: actions/github-script@47f7cf65b5ced0830a325f705cad64f2f58dddf7 # 3.1.0
37+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # 8.0.0
3838
with:
3939
github-token: ${{secrets.GITHUB_TOKEN}}
4040
script: |
4141
// Confusingly, the issues api is used because pull requests are issues
42-
await github.issues.update({
42+
await github.rest.issues.update({
4343
owner: context.repo.owner,
4444
repo: context.repo.repo,
4545
issue_number: ${{ github.event.pull_request.number }},

0 commit comments

Comments
 (0)