Skip to content

Commit 8007b9d

Browse files
authored
Merge branch 'master' into mhlidd_update_codeowners
2 parents a7bb475 + ee6947e commit 8007b9d

File tree

98 files changed

+1882
-648
lines changed

Some content is hidden

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

98 files changed

+1882
-648
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
issuer: https://token.actions.githubusercontent.com
2+
3+
subject: repo:DataDog/dd-trace-java:ref:refs/heads/master
4+
5+
claim_pattern:
6+
event_name: (schedule|workflow_dispatch)
7+
ref: refs/heads/master
8+
ref_protected: "true"
9+
job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/update-docker-build-image\.yaml@refs/heads/master
10+
11+
permissions:
12+
contents: write
13+
pull_requests: write
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
issuer: https://token.actions.githubusercontent.com
2+
3+
subject: repo:DataDog/dd-trace-java:ref:refs/heads/master
4+
5+
claim_pattern:
6+
event_name: (schedule|workflow_dispatch)
7+
ref: refs/heads/master
8+
ref_protected: "true"
9+
job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/update-gradle-dependencies\.yaml@refs/heads/master
10+
11+
permissions:
12+
contents: write
13+
pull_requests: write

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,27 @@ name: Update Docker Build Image
33
on:
44
schedule:
55
# A day after creating the tag from https://github.com/DataDog/dd-trace-java-docker-build/blob/master/.github/workflows/docker-tag.yml
6-
- cron: '0 0 1 2,5,8,11 *'
6+
- cron: "0 0 1 2,5,8,11 *"
77
workflow_dispatch:
88
inputs:
99
tag:
10-
description: 'The tag to use for the Docker build image'
10+
description: "The tag to use for the Docker build image"
1111
required: true
12-
default: 'vYY.MM'
13-
12+
default: "vYY.MM"
13+
1414
jobs:
1515
update-docker-build-image:
1616
runs-on: ubuntu-latest
1717
permissions:
18-
contents: write # Required to commit and push changes to a new branch
19-
pull-requests: write # Required to create a pull request
18+
contents: write # Required to create and push branch
19+
id-token: write # Required for OIDC token federation
2020
steps:
21+
- uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
22+
id: octo-sts
23+
with:
24+
scope: DataDog/dd-trace-java
25+
policy: self.update-docker-build-image.create-pr
26+
2127
- name: Checkout the repository
2228
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2329
- name: Download ghcommit CLI
@@ -55,12 +61,12 @@ jobs:
5561
sed -i '' -E 's|(BUILDER_IMAGE_VERSION_PREFIX:)[^#]*([#].*)|\1 "${{ steps.define-tag.outputs.tag }}-" \2|' .gitlab-ci.yml
5662
- name: Commit and push changes
5763
env:
58-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
64+
GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }}
5965
run: |
6066
ghcommit --repository ${{ github.repository }} --branch ${{ steps.define-branch.outputs.branch }} --add .gitlab-ci.yml --message "feat(ci): Update Docker build image"
6167
- name: Create pull request
6268
env:
63-
GH_TOKEN: ${{ github.token }}
69+
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
6470
run: |
6571
gh pr create --title "Update Docker build image" \
6672
--base master \

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
name: Update Gradle dependencies
22
on:
33
schedule:
4-
- cron: '0 4 * * 0'
4+
- cron: "0 4 * * 0"
55
workflow_dispatch:
66

77
jobs:
88
update-gradle-dependencies:
99
runs-on: ubuntu-latest
1010
name: Update Gradle dependencies
1111
permissions:
12-
contents: write # Required to commit and push changes to a new branch
13-
pull-requests: write # Required to create a pull request
12+
contents: write # Required to create new branch
13+
id-token: write # Required for OIDC token federation
1414
steps:
15+
- uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
16+
id: octo-sts
17+
with:
18+
scope: DataDog/dd-trace-java
19+
policy: self.update-gradle-dependencies.create-pr
20+
1521
- name: Checkout repository
1622
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
1723
with:
18-
submodules: 'recursive'
24+
submodules: "recursive"
1925
- name: Download ghcommit CLI
2026
run: |
2127
curl https://github.com/planetscale/ghcommit/releases/download/v0.1.48/ghcommit_linux_amd64 -o /usr/local/bin/ghcommit -L
@@ -37,7 +43,7 @@ jobs:
3743
./gradlew resolveAndLockAll --write-locks --parallel --stacktrace --no-daemon --max-workers=4
3844
- name: Commit changes
3945
env:
40-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
46+
GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }}
4147
run: |
4248
GH_ADD_ARGS=""
4349
COUNT=0
@@ -69,7 +75,7 @@ jobs:
6975
fi
7076
- name: Create pull request
7177
env:
72-
GH_TOKEN: ${{ github.token }}
78+
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
7379
run: |
7480
# use echo to set a multiline body for the PR
7581
echo -e "This PR updates the Gradle dependencies. ⚠️ Don't forget to squash commits before merging. ⚠️\n\n- [ ] Update PR title if a code change is needed to support one of those new dependencies" | \

build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
id("com.github.spotbugs") version "5.0.14"
99
id("de.thetaphi.forbiddenapis") version "3.8"
1010

11-
id("org.shipkit.shipkit-auto-version") version "2.1.2"
11+
id("tracer-version")
1212
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
1313

1414
id("com.gradleup.shadow") version "8.3.6" apply false
@@ -56,11 +56,8 @@ apply(from = rootDir.resolve("gradle/spotless.gradle"))
5656

5757
val compileTask = tasks.register("compile")
5858

59-
val repoVersion = version
60-
6159
allprojects {
6260
group = "com.datadoghq"
63-
version = repoVersion
6461

6562
if (isCI.isPresent) {
6663
layout.buildDirectory = providers.provider {

buildSrc/build.gradle.kts

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
groovy
33
`java-gradle-plugin`
44
`kotlin-dsl`
5+
`jvm-test-suite`
56
id("com.diffplug.spotless") version "6.13.0"
67
}
78

@@ -25,6 +26,10 @@ gradlePlugin {
2526
id = "call-site-instrumentation"
2627
implementationClass = "datadog.gradle.plugin.CallSiteInstrumentationPlugin"
2728
}
29+
create("tracer-version-plugin") {
30+
id = "tracer-version"
31+
implementationClass = "datadog.gradle.plugin.version.TracerVersionPlugin"
32+
}
2833
}
2934
}
3035

@@ -42,19 +47,46 @@ dependencies {
4247
implementation("org.eclipse.aether", "aether-transport-http", "1.1.0")
4348
implementation("org.apache.maven", "maven-aether-provider", "3.3.9")
4449

50+
implementation("com.github.zafarkhaja:java-semver:0.10.2")
51+
4552
implementation("com.google.guava", "guava", "20.0")
4653
implementation("org.ow2.asm", "asm", "9.8")
4754
implementation("org.ow2.asm", "asm-tree", "9.8")
48-
49-
testImplementation(libs.spock.core)
50-
testImplementation(libs.groovy)
5155
}
5256

5357
tasks.compileKotlin {
5458
dependsOn(":call-site-instrumentation-plugin:build")
5559
}
5660

57-
tasks.test {
58-
useJUnitPlatform()
59-
enabled = project.hasProperty("runBuildSrcTests")
61+
testing {
62+
@Suppress("UnstableApiUsage")
63+
suites {
64+
val test by getting(JvmTestSuite::class) {
65+
dependencies {
66+
implementation(libs.spock.core)
67+
implementation(libs.groovy)
68+
}
69+
targets.configureEach {
70+
testTask.configure {
71+
enabled = project.hasProperty("runBuildSrcTests")
72+
}
73+
}
74+
}
75+
76+
val integTest by registering(JvmTestSuite::class) {
77+
dependencies {
78+
implementation(gradleTestKit())
79+
implementation("org.assertj:assertj-core:3.25.3")
80+
}
81+
// Makes the gradle plugin publish its declared plugins to this source set
82+
gradlePlugin.testSourceSet(sources)
83+
}
84+
85+
withType(JvmTestSuite::class).configureEach {
86+
useJUnitJupiter(libs.versions.junit5)
87+
targets.configureEach {
88+
testTask
89+
}
90+
}
91+
}
6092
}

0 commit comments

Comments
 (0)