Skip to content

Commit 69e3d7a

Browse files
authored
Merge branch 'master' into mhlidd/config_inversion
2 parents 82f2551 + ee43e5f commit 69e3d7a

File tree

592 files changed

+6640
-5637
lines changed

Some content is hidden

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

592 files changed

+6640
-5637
lines changed

.circleci/config.yml

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

.github/workflows/add-release-to-cloudfoundry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout "cloudfoundry" branch
13-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
13+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
1414
with:
1515
ref: cloudfoundry
1616
- name: Get release version

.github/workflows/analyze-changes.yaml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: Analyze changes
33
on:
44
push:
55
branches: [ master ]
6-
pull_request:
7-
# The branches below must be a subset of the branches above
8-
branches: [ master ]
96

107
# Cancel long-running jobs when a new commit is pushed
118
concurrency:
@@ -15,8 +12,6 @@ concurrency:
1512
jobs:
1613
codeql:
1714
name: Analyze changes with GitHub CodeQL
18-
# Don’t run on PR, only when pushing to master
19-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
2015
runs-on: ubuntu-latest
2116
permissions:
2217
actions: read
@@ -25,12 +20,12 @@ jobs:
2520

2621
steps:
2722
- name: Checkout repository
28-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
23+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
2924
with:
3025
submodules: 'recursive'
3126

3227
- name: Cache Gradle dependencies
33-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
28+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
3429
with:
3530
path: |
3631
~/.gradle/caches
@@ -40,7 +35,7 @@ jobs:
4035
${{ runner.os }}-gradle-
4136
4237
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
38+
uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
4439
with:
4540
languages: 'java'
4641
build-mode: 'manual'
@@ -57,12 +52,10 @@ jobs:
5752
--build-cache --parallel --stacktrace --no-daemon --max-workers=4
5853
5954
- name: Perform CodeQL Analysis and upload results to GitHub Security tab
60-
uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
55+
uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
6156

6257
trivy:
6358
name: Analyze changes with Trivy
64-
# Don’t run on PR, only when pushing to master
65-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
6659
runs-on: ubuntu-latest
6760
permissions:
6861
actions: read
@@ -71,12 +64,12 @@ jobs:
7164

7265
steps:
7366
- name: Checkout repository
74-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
67+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
7568
with:
7669
submodules: 'recursive'
7770

7871
- name: Cache Gradle dependencies
79-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
72+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
8073
with:
8174
path: |
8275
~/.gradle/caches
@@ -122,7 +115,7 @@ jobs:
122115
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
123116

124117
- name: Upload Trivy scan results to GitHub Security tab
125-
uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
118+
uses: github/codeql-action/upload-sarif@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
126119
if: always()
127120
with:
128121
sarif_file: 'trivy-results.sarif'

.github/workflows/run-system-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
group: APM Larger Runners
1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
18+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
1919
with:
2020
submodules: 'recursive'
2121
fetch-depth: 0
2222

2323
- name: Cache Gradle dependencies
24-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
24+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
2525
with:
2626
path: |
2727
~/.gradle/caches

.github/workflows/update-docker-build-image.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
policy: self.update-docker-build-image.create-pr
2626

2727
- name: Checkout the repository
28-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2929
- name: Define the Docker build image tag to use
3030
id: define-tag
3131
run: |

.github/workflows/update-gradle-dependencies.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
policy: self.update-gradle-dependencies.create-pr
2020

2121
- name: Checkout repository
22-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
2323
with:
2424
submodules: "recursive"
2525
- name: Download ghcommit CLI

.github/workflows/update-jmxfetch-submodule.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
policy: self.update-jmxfetch-submodule.create-pr
2020

2121
- name: Checkout repository
22-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
2323

2424
- name: Update Submodule
2525
run: |

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ variables:
2626
DEPENDENCY_CACHE_POLICY: pull
2727
BUILD_CACHE_POLICY: pull
2828
GRADLE_VERSION: "8.14.3" # must match gradle-wrapper.properties
29-
MAVEN_REPOSITORY_PROXY: "http://artifactual.artifactual.all-clusters.local-dc.fabric.dog:8081/repository/maven-central/"
30-
GRADLE_PLUGIN_PROXY: "http://artifactual.artifactual.all-clusters.local-dc.fabric.dog:8081/repository/gradle-plugin-portal-proxy/"
29+
MAVEN_REPOSITORY_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/"
30+
GRADLE_PLUGIN_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/"
3131
BUILDER_IMAGE_VERSION_PREFIX: "v25.07-" # use either an empty string (e.g. "") for latest images or a version followed by a hyphen (e.g. "v25.05-")
3232
REPO_NOTIFICATION_CHANNEL: "#apm-java-escalations"
3333
DEFAULT_TEST_JVMS: /^(8|11|17|21|stable)$/

buildSrc/src/integTest/kotlin/datadog/gradle/plugin/version/TracerVersionIntegrationTest.kt

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package datadog.gradle.plugin.version
22

33
import org.assertj.core.api.Assertions.assertThat
44
import org.gradle.testkit.runner.GradleRunner
5+
import org.junit.jupiter.api.Disabled
56
import org.junit.jupiter.api.Test
67
import org.junit.jupiter.api.io.CleanupMode
78
import org.junit.jupiter.api.io.TempDir
89
import java.io.File
910
import java.io.IOException
1011

11-
1212
class TracerVersionIntegrationTest {
1313

1414
@Test
@@ -89,41 +89,25 @@ class TracerVersionIntegrationTest {
8989
projectDir,
9090
"1.53.0-SNAPSHOT-DIRTY",
9191
beforeGradle = {
92-
exec(projectDir, "git", "init", "--initial-branch", "main")
93-
exec(projectDir, "git", "config", "user.email", "[email protected]")
94-
exec(projectDir, "git", "config", "user.name", "Test")
95-
exec(projectDir, "git", "add", "-A")
96-
exec(projectDir, "git", "commit", "-m", "A commit")
97-
exec(projectDir, "git", "tag", "v1.52.0", "-m", "")
98-
99-
File(projectDir, "settings.gradle.kts").appendText("""
100-
101-
// uncommitted change this file,
102-
""".trimIndent())
103-
}
104-
)
105-
}
92+
println("Setting up git repository in $projectDir")
93+
File(projectDir, "gradle.properties").writeText(
94+
"""
95+
tracerVersion.dirtiness=true
96+
""".trimIndent()
97+
)
10698

107-
@Test
108-
fun `should ignore dirtiness if CI env`(@TempDir projectDir: File) { // CI patch some tracked files
109-
assertTracerVersion(
110-
projectDir,
111-
"1.52.0",
112-
beforeGradle = {
11399
exec(projectDir, "git", "init", "--initial-branch", "main")
114100
exec(projectDir, "git", "config", "user.email", "[email protected]")
115101
exec(projectDir, "git", "config", "user.name", "Test")
116102
exec(projectDir, "git", "add", "-A")
117103
exec(projectDir, "git", "commit", "-m", "A commit")
118104
exec(projectDir, "git", "tag", "v1.52.0", "-m", "")
119105

120-
// dirty file ignored
121106
File(projectDir, "settings.gradle.kts").appendText("""
122107
123108
// uncommitted change this file,
124109
""".trimIndent())
125-
},
126-
additionalEnv = mapOf("CI" to "true")
110+
}
127111
)
128112
}
129113

@@ -157,6 +141,12 @@ class TracerVersionIntegrationTest {
157141
projectDir,
158142
"1.53.0-SNAPSHOT-DIRTY",
159143
beforeGradle = {
144+
File(projectDir, "gradle.properties").writeText(
145+
"""
146+
tracerVersion.dirtiness=true
147+
""".trimIndent()
148+
)
149+
160150
exec(projectDir, "git", "init", "--initial-branch", "main")
161151
exec(projectDir, "git", "config", "user.email", "[email protected]")
162152
exec(projectDir, "git", "config", "user.name", "Test")
@@ -268,7 +258,6 @@ class TracerVersionIntegrationTest {
268258
expectedVersion: String,
269259
beforeGradle: () -> Unit = {},
270260
workingDirectory: File = projectDir,
271-
additionalEnv: Map<String, String> = mapOf("CI" to "false"),
272261
) {
273262
File(projectDir, "settings.gradle.kts").writeText(
274263
"""
@@ -296,7 +285,6 @@ class TracerVersionIntegrationTest {
296285
// .withGradleVersion(gradleVersion) // Use current gradle version
297286
.withPluginClasspath()
298287
.withArguments("printVersion", "--quiet")
299-
.withEnvironment(System.getenv() + additionalEnv)
300288
.withProjectDir(workingDirectory)
301289
// .withDebug(true)
302290
.build()

buildSrc/src/main/kotlin/datadog/gradle/plugin/version/TracerVersionPlugin.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class TracerVersionPlugin @Inject constructor(
2323
val extension = targetProject.extensions.getByType(TracerVersionExtension::class.java)
2424

2525
extension.detectDirty.set(
26-
providerFactory.environmentVariable("CI").map { it != "true" }.orElse(true)
26+
providerFactory.gradleProperty("tracerVersion.dirtiness")
27+
.map { it.trim().toBoolean() }
28+
.orElse(false)
2729
)
2830

2931
val versionProvider = versionProvider(targetProject, extension)

0 commit comments

Comments
 (0)