Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .gitlab/exploration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@ build-exploration-tests-image:
- when: manual
allow_failure: true
before_script:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This proxy routing is only added to .common-exploration-tests's before_script, not to build-exploration-tests-image (the image-build job above), which still resolves dependencies directly against the public internet. That job's Dockerfile runs mvn verify -DskipTests=true (jsoup/jackson/jackson-databind) and ./gradlew dependencies (okhttp) with no proxy configured at all (dd-java-agent/agent-debugger/exploration-tests/Dockerfile.exploration-tests). If direct access to Maven Central / Gradle Plugin Portal is what motivated this PR (unreliable/blocked egress), image builds will keep failing or flaking exactly as before, while only the downstream test-execution job is fixed — an incomplete fix for the stated goal of "routing exploration builds through repository proxies."

🤖 Generated with Claude Code

- |
mkdir -p "$HOME/.m2"
cat > "$HOME/.m2/settings.xml" <<EOF
<settings>
<mirrors>
<mirror>
<id>env-proxy</id>
<mirrorOf>*</mirrorOf>
<url>${MAVEN_REPOSITORY_PROXY}</url>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated ~/.m2/settings.xml interpolates ${MAVEN_REPOSITORY_PROXY} into an XML document unescaped inside a heredoc. If MAVEN_REPOSITORY_PROXY is ever changed to a URL containing & (e.g. a query-string-based proxy endpoint) without being percent-encoded, the generated settings.xml becomes malformed XML and Maven fails to parse it, breaking every exploration-tests job silently until someone diagnoses the generated file. Currently benign only because the configured value has no &.

🤖 Generated with Claude Code

</mirror>
</mirrors>
</settings>
EOF
- export MVNW_REPOURL=${MAVEN_REPOSITORY_PROXY%/}
- export ORG_GRADLE_PROJECT_mavenRepositoryProxy="$MAVEN_REPOSITORY_PROXY"
- export ORG_GRADLE_PROJECT_gradlePluginProxy="$GRADLE_PLUGIN_PROXY"
# TODO: Centralize Gradle repository proxy initialization instead of reusing a smoke-test resource.
- mkdir -p "$HOME/.gradle/init.d"
- cp build-logic/smoke-test/src/main/resources/datadog/buildlogic/smoketest/proxy-repositories.init.gradle.kts "$HOME/.gradle/init.d/"
- cp workspace/dd-java-agent/build/libs/*.jar /exploration-tests/dd-java-agent.jar
- cp dd-java-agent/agent-debugger/exploration-tests/run-exploration-tests.sh /exploration-tests
- cp dd-java-agent/agent-debugger/exploration-tests/exclude_*.txt /exploration-tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import org.gradle.api.artifacts.repositories.MavenArtifactRepository
import org.gradle.api.initialization.Settings
import java.net.URI

// Requires Gradle 6.8+ and assumes project repositories are allowed by the target build.

gradle.beforeSettings(Action<Settings> {
val gradlePluginProxy = providers.gradleProperty("gradlePluginProxy").orNull
val mavenRepositoryProxy = providers.gradleProperty("mavenRepositoryProxy").orNull
Expand Down
Loading