Skip to content

Commit 082abbf

Browse files
Merge branch 'master' into daniel.mohedano/java26-support-module-redefinition
2 parents c30dfe5 + 7cff994 commit 082abbf

File tree

67 files changed

+255
-61
lines changed

Some content is hidden

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

67 files changed

+255
-61
lines changed

.github/workflows/update-smoke-test-latest-versions.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
METADATA=$(curl -sf https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/maven-metadata.xml)
4545
# Get all versions, filter out alpha/beta/rc, take the latest
4646
VERSION=$(echo "$METADATA" \
47-
| xmllint --xpath '//versions/version/text()' - 2>/dev/null \
48-
| tr ' ' '\n' \
47+
| grep -o '<version>[^<]*</version>' \
48+
| sed 's/<[^>]*>//g' \
4949
| grep -v -E '(alpha|beta|rc)' \
5050
| sort -V \
5151
| tail -1)
@@ -62,8 +62,8 @@ jobs:
6262
METADATA=$(curl -sf https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xml)
6363
# Get all versions, filter out alpha/beta, take the latest
6464
VERSION=$(echo "$METADATA" \
65-
| xmllint --xpath '//versions/version/text()' - 2>/dev/null \
66-
| tr ' ' '\n' \
65+
| grep -o '<version>[^<]*</version>' \
66+
| sed 's/<[^>]*>//g' \
6767
| grep -v -E '(alpha|beta)' \
6868
| sort -V \
6969
| tail -1)
@@ -80,6 +80,11 @@ jobs:
8080
MAVEN_VERSION: ${{ steps.maven.outputs.version }}
8181
SUREFIRE_VERSION: ${{ steps.surefire.outputs.version }}
8282
run: |
83+
echo "Writing resolved versions to properties files:"
84+
echo " Gradle: ${GRADLE_VERSION}"
85+
echo " Maven: ${MAVEN_VERSION}"
86+
echo " Maven Surefire: ${SUREFIRE_VERSION}"
87+
8388
printf '%s\n' \
8489
"# Pinned \"latest\" versions for CI Visibility Gradle smoke tests." \
8590
"# Updated automatically by the update-smoke-test-latest-versions workflow." \
@@ -97,9 +102,14 @@ jobs:
97102
id: check-changes
98103
run: |
99104
if [[ -z "$(git status -s)" ]]; then
100-
echo "No changes to commit."
105+
echo "No changes detected — pinned versions are already up to date."
101106
echo "has_changes=false" >> "$GITHUB_OUTPUT"
102107
else
108+
echo "Changes detected in the following files:"
109+
git status -s
110+
echo ""
111+
echo "Diff:"
112+
git diff
103113
echo "has_changes=true" >> "$GITHUB_OUTPUT"
104114
fi
105115

dd-java-agent/agent-aiguard/src/main/java/com/datadog/aiguard/AIGuardInternal.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ private static String getToolName(final Message current, final List<Message> mes
205205
}
206206

207207
private boolean isBlockingEnabled(final Options options, final Object isBlockingEnabled) {
208+
if (isBlockingEnabled == null) {
209+
return false;
210+
}
208211
return options.block() && "true".equalsIgnoreCase(isBlockingEnabled.toString());
209212
}
210213

dd-java-agent/agent-aiguard/src/test/groovy/com/datadog/aiguard/AIGuardInternalTests.groovy

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,51 @@ class AIGuardInternalTests extends DDSpecification {
222222
suite << TestSuite.build()
223223
}
224224

225+
void 'test evaluate block defaults to remote is_blocking_enabled'() {
226+
given:
227+
def request
228+
final call = Mock(Call) {
229+
execute() >> {
230+
return mockResponse(
231+
request,
232+
200,
233+
[data: [attributes: [action: 'DENY', reason: 'Nope', tags: ['deny_everything'], is_blocking_enabled: remoteBlocking]]]
234+
)
235+
}
236+
}
237+
final client = Mock(OkHttpClient) {
238+
newCall(_ as Request) >> {
239+
request = (Request) it[0]
240+
return call
241+
}
242+
}
243+
final aiguard = new AIGuardInternal(URL, HEADERS, client)
244+
245+
when:
246+
Throwable error = null
247+
AIGuard.Evaluation eval = null
248+
try {
249+
eval = aiguard.evaluate(TOOL_CALL, options)
250+
} catch (Throwable e) {
251+
error = e
252+
}
253+
254+
then:
255+
if (shouldBlock) {
256+
error instanceof AIGuard.AIGuardAbortError
257+
error.action == DENY
258+
} else {
259+
error == null
260+
eval.action == DENY
261+
}
262+
263+
where:
264+
options | remoteBlocking | shouldBlock
265+
AIGuard.Options.DEFAULT | true | true
266+
AIGuard.Options.DEFAULT | false | false
267+
new AIGuard.Options().block(false) | true | false
268+
}
269+
225270
void 'test evaluate with API errors'() {
226271
given:
227272
final errors = [[status: 400, title: 'Bad request']]

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ DBInfo.Builder doParse(final String jdbcUrl, final DBInfo.Builder builder) {
7373
String instanceName = null;
7474
final int hostIndex = jdbcUrl.indexOf("://");
7575

76-
if (hostIndex <= 0) {
76+
if (hostIndex <= 0 || jdbcUrl.length() == 3 + hostIndex) {
7777
return builder;
7878
}
7979

dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/git/tree/GitClientTest.groovy

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ class GitClientTest extends Specification {
8787
8888
def "test is shallow"() {
8989
given:
90-
givenGitRepo("ci/git/shallow/git")
90+
givenGitRepos(["ci/git/shallow_with_origin/origin", "ci/git/shallow_with_origin/repo"])
9191
9292
when:
93-
def gitClient = givenGitClient()
93+
def gitClient = givenGitClient("repo")
9494
def shallow = gitClient.isShallow()
9595
9696
then:
@@ -111,22 +111,22 @@ class GitClientTest extends Specification {
111111
112112
def "test get upstream branch SHA"() {
113113
given:
114-
givenGitRepo("ci/git/shallow/git")
114+
givenGitRepos(["ci/git/shallow_with_origin/origin", "ci/git/shallow_with_origin/repo"])
115115
116116
when:
117-
def gitClient = givenGitClient()
117+
def gitClient = givenGitClient("repo")
118118
def upstreamBranch = gitClient.getUpstreamBranchSha()
119119
120120
then:
121-
upstreamBranch == "98b944cc44f18bfb78e3021de2999cdcda8efdf6"
121+
upstreamBranch == "c76ef954d23f8fdb42dcf2fe956d6af5a31fe7bd"
122122
}
123123
124124
def "test unshallow: sha-#remoteSha"() {
125125
given:
126-
givenGitRepo("ci/git/shallow/git")
126+
givenGitRepos(["ci/git/shallow_with_origin/origin", "ci/git/shallow_with_origin/repo"])
127127
128128
when:
129-
def gitClient = givenGitClient()
129+
def gitClient = givenGitClient("repo")
130130
def shallow = gitClient.isShallow()
131131
def commits = gitClient.getLatestCommits()
132132
@@ -209,11 +209,11 @@ class GitClientTest extends Specification {
209209

210210
def "test get commit info with fetching"() {
211211
given:
212-
givenGitRepo("ci/git/shallow/git")
212+
givenGitRepos(["ci/git/shallow_with_origin/origin", "ci/git/shallow_with_origin/repo"])
213213

214214
when:
215-
def commit = "f4377e97f10c2d58696192b170b2fef2a8464b04"
216-
def gitClient = givenGitClient()
215+
def commit = "6e55a15a35ad46f74e4203dd42f7797173a6edcb"
216+
def gitClient = givenGitClient("repo")
217217
def commitInfo = gitClient.getCommitInfo(commit, false)
218218

219219
then:
@@ -224,13 +224,13 @@ class GitClientTest extends Specification {
224224

225225
then:
226226
commitInfo.sha == commit
227-
commitInfo.author.name == "sullis"
228-
commitInfo.author.email == "github@seansullivan.com"
229-
commitInfo.author.iso8601Date == "2023-05-30T07:07:35-07:00"
230-
commitInfo.committer.name == "GitHub"
231-
commitInfo.committer.email == "noreply@github.com"
232-
commitInfo.committer.iso8601Date == "2023-05-30T07:07:35-07:00"
233-
commitInfo.fullMessage == "brotli4j 1.12.0 (#1592)"
227+
commitInfo.author.name == "Test Author"
228+
commitInfo.author.email == "test-author@example.com"
229+
commitInfo.author.iso8601Date == "2026-03-12T17:02:46+01:00"
230+
commitInfo.committer.name == "Test Author"
231+
commitInfo.committer.email == "test-author@example.com"
232+
commitInfo.committer.iso8601Date == "2026-03-12T17:02:46+01:00"
233+
commitInfo.fullMessage == "Commit message 0"
234234
}
235235

236236
def "test get latest commits"() {

dd-java-agent/agent-ci-visibility/src/test/resources/ci/git/shallow/dummy.txt

Whitespace-only changes.

dd-java-agent/agent-ci-visibility/src/test/resources/ci/git/shallow/git/description

Lines changed: 0 additions & 1 deletion
This file was deleted.
Binary file not shown.

dd-java-agent/agent-ci-visibility/src/test/resources/ci/git/shallow/git/info/exclude

Lines changed: 0 additions & 6 deletions
This file was deleted.

dd-java-agent/agent-ci-visibility/src/test/resources/ci/git/shallow/git/logs/HEAD

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)