Skip to content

Commit 925dc31

Browse files
Merged with master. Replaced grrovySpock plugin with direct imports.
2 parents ba933b1 + fef9d16 commit 925dc31

File tree

98 files changed

+3228
-3228
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

+3228
-3228
lines changed

.github/chainguard/self.pin-system-tests.create-pr.sts.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
issuer: https://token.actions.githubusercontent.com
22

3-
subject_pattern: repo:DataDog/dd-trace-java:ref:refs/heads/.+
3+
subject_pattern: repo:DataDog/dd-trace-java:ref:refs/heads/(master|release/v.+)
44

55
claim_pattern:
6-
event_name: (push|workflow_dispatch)
7-
ref: refs/heads/.+
8-
job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/pin-system-tests\.yaml@.+
6+
event_name: (create|workflow_dispatch)
7+
ref: refs/heads/(master|release/v.+)
8+
job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/pin-system-tests\.yaml@refs/heads/(master|release/v.+)
99

1010
permissions:
1111
contents: write
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Pin system tests
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release-branch-name:
7+
description: 'The minor release branch name (e.g. release/v1.54.x)'
8+
required: true
9+
type: string
10+
# run workflow when a release branch is created
11+
create:
12+
13+
jobs:
14+
pin-system-tests:
15+
name: "Pin system tests"
16+
if: github.event_name != 'create' || startsWith(github.ref, 'refs/heads/release/v')
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
id-token: write # required for OIDC token federation
21+
steps:
22+
- uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
23+
id: octo-sts
24+
with:
25+
scope: DataDog/dd-trace-java
26+
policy: self.pin-system-tests.create-pr
27+
28+
- name: Define base branch
29+
id: define-base-branch
30+
run: |
31+
if [[ -n "${{ github.event.inputs.release-branch-name }}" ]]; then
32+
BASE_BRANCH=${{ github.event.inputs.release-branch-name }}
33+
else
34+
BASE_BRANCH=${GITHUB_REF#refs/heads/}
35+
fi
36+
echo "base_branch=${BASE_BRANCH}" >> $GITHUB_OUTPUT
37+
38+
- name: Checkout the repository
39+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
40+
with:
41+
ref: ${{ steps.define-base-branch.outputs.base_branch }}
42+
43+
- name: Get latest commit SHA of base branch
44+
id: get-latest-commit-sha
45+
run: |
46+
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
47+
48+
- name: Define branch name
49+
id: define-branch
50+
run: echo "branch=ci/pin-system-tests-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
51+
52+
- name: Check if branch already exists
53+
id: check-branch
54+
run: |
55+
BRANCH=${{ steps.define-branch.outputs.branch }}
56+
if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
57+
echo "ERROR: Branch $BRANCH already exists - please delete it and re-run the workflow."
58+
exit 1
59+
else
60+
echo "Branch $BRANCH does not exist - creating it now."
61+
fi
62+
63+
- name: Update system-tests references to latest commit SHA on main
64+
run: ./tooling/update_system_test_reference.sh
65+
66+
- name: Check if changes should be committed
67+
id: check-changes
68+
run: |
69+
if [[ -z "$(git status -s)" ]]; then
70+
echo "ERROR: No changes to commit - the system-tests reference was not updated."
71+
exit 1
72+
else
73+
echo "Changes to commit:"
74+
git status -s
75+
fi
76+
77+
- name: Commit changes
78+
id: create-commit
79+
run: |
80+
git config user.name "github-actions[bot]"
81+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
82+
git commit -m "chore: Pin system-tests for release branch" .github/workflows/run-system-tests.yaml
83+
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
84+
85+
- name: Push changes
86+
uses: DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
87+
with:
88+
token: "${{ steps.octo-sts.outputs.token }}"
89+
branch: "${{ steps.define-branch.outputs.branch }}"
90+
head-sha: "${{ steps.get-latest-commit-sha.outputs.sha }}"
91+
create-branch: true
92+
command: push
93+
commits: "${{ steps.create-commit.outputs.commit }}"
94+
95+
- name: Create pull request
96+
env:
97+
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
98+
run: |
99+
gh pr create --title "Pin system tests for release branch" \
100+
--base ${{ steps.define-base-branch.outputs.base_branch }} \
101+
--head ${{ steps.define-branch.outputs.branch }} \
102+
--label "tag: dependencies" \
103+
--label "tag: no release notes" \
104+
--body "This PR pins the system-tests reference for the release branch." \

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ validate_supported_configurations_v2_local_file:
10051005
extends: .validate_supported_configurations_v2_local_file
10061006
variables:
10071007
LOCAL_JSON_PATH: "metadata/supported-configurations.json"
1008-
BACKFILLED: "false"
1008+
BACKFILLED: "true"
10091009

10101010
update_central_configurations_version_range_v2:
10111011
extends: .update_central_configurations_version_range_v2

.gitlab/one-pipeline.locked.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# DO NOT EDIT THIS FILE MANUALLY
22
# This file is auto-generated by automation.
33
include:
4-
- remote: https://gitlab-templates.ddbuild.io/libdatadog/one-pipeline/ca/04f6a88e3db67cb88821632d138a2a5c3105ba59760bd3dfc60b54733501ecc3/one-pipeline.yml
4+
- remote: https://gitlab-templates.ddbuild.io/libdatadog/one-pipeline/ca/58b2e8d06c714848c8577c8ac9b460b7413823d75ee96d068ebff547d109f5d0/one-pipeline.yml

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import com.diffplug.gradle.spotless.SpotlessExtension
22
import datadog.gradle.plugin.ci.testAggregate
33

44
plugins {
5+
kotlin("jvm") version libs.versions.kotlin.plugin apply false
6+
57
id("dd-trace-java.gradle-debug")
68
id("dd-trace-java.dependency-locking")
79
id("dd-trace-java.tracer-version")
810
id("dd-trace-java.dump-hanged-test")
911
id("dd-trace-java.config-inversion-linter")
1012
id("dd-trace-java.ci-jobs")
11-
id("datadog.groovy-spock")
1213

1314
id("com.diffplug.spotless") version "8.1.0"
1415
id("com.github.spotbugs") version "6.4.7"
@@ -17,7 +18,6 @@ plugins {
1718
id("com.gradleup.shadow") version "8.3.6" apply false
1819
id("me.champeau.jmh") version "0.7.3" apply false
1920
id("org.gradle.playframework") version "0.13" apply false
20-
kotlin("jvm") version libs.versions.kotlin.plugin apply false
2121
}
2222

2323
description = "dd-trace-java"

buildSrc/build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ gradlePlugin {
1818
id = "dd-trace-java.instrument"
1919
implementationClass = "InstrumentPlugin"
2020
}
21+
2122
create("muzzle-plugin") {
2223
id = "dd-trace-java.muzzle"
2324
implementationClass = "datadog.gradle.plugin.muzzle.MuzzlePlugin"
@@ -26,26 +27,26 @@ gradlePlugin {
2627
id = "dd-trace-java.call-site-instrumentation"
2728
implementationClass = "datadog.gradle.plugin.csi.CallSiteInstrumentationPlugin"
2829
}
30+
2931
create("tracer-version-plugin") {
3032
id = "dd-trace-java.tracer-version"
3133
implementationClass = "datadog.gradle.plugin.version.TracerVersionPlugin"
3234
}
35+
3336
create("dump-hanged-test-plugin") {
3437
id = "dd-trace-java.dump-hanged-test"
3538
implementationClass = "datadog.gradle.plugin.dump.DumpHangedTestPlugin"
3639
}
40+
3741
create("supported-config-generation") {
3842
id = "dd-trace-java.supported-config-generator"
3943
implementationClass = "datadog.gradle.plugin.config.SupportedConfigPlugin"
4044
}
45+
4146
create("supported-config-linter") {
4247
id = "dd-trace-java.config-inversion-linter"
4348
implementationClass = "datadog.gradle.plugin.config.ConfigInversionLinter"
4449
}
45-
create("groovy-spock-plugin") {
46-
id = "datadog.groovy-spock"
47-
implementationClass = "datadog.gradle.plugin.config.groovy.GroovySpockConventionPlugin"
48-
}
4950
}
5051
}
5152

buildSrc/call-site-instrumentation-plugin/build.gradle.kts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ dependencies {
3131
implementation("org.freemarker", "freemarker", "2.3.30")
3232
implementation(libs.asm)
3333
implementation(libs.asm.tree)
34-
implementation(libs.javaparser.solver)
34+
implementation(libs.javaparser.symbol.solver)
3535

3636
testImplementation(libs.bytebuddy)
37-
testImplementation(libs.groovy4)
38-
testImplementation(libs.spock.core.groovy4)
39-
testImplementation(libs.objenesis)
37+
testImplementation(libs.bundles.groovy)
38+
testImplementation(libs.bundles.spock)
4039
testImplementation("javax.servlet", "javax.servlet-api", "3.0.1")
4140
testImplementation(libs.spotbugs.annotations)
4241
}

buildSrc/call-site-instrumentation-plugin/src/test/groovy/datadog/trace/plugin/csi/impl/AdviceGeneratorTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ final class AdviceGeneratorTest extends BaseCsiPluginTest {
5959
class AroundAdvice {
6060
@CallSite.Around('java.lang.String java.lang.String.replaceAll(java.lang.String, java.lang.String)')
6161
static String around(@CallSite.This final String self, @CallSite.Argument final String regexp, @CallSite.Argument final String replacement) {
62-
return self.replaceAll(regexp, replacement);
62+
return self.replaceAll(regexp, replacement)
6363
}
6464
}
6565

@@ -228,7 +228,7 @@ final class AdviceGeneratorTest extends BaseCsiPluginTest {
228228
@CallSite.Argument final MethodType concatType,
229229
@CallSite.Argument final String recipe,
230230
@CallSite.Argument final Object... constants) {
231-
return null;
231+
return null
232232
}
233233
}
234234

@@ -270,7 +270,7 @@ final class AdviceGeneratorTest extends BaseCsiPluginTest {
270270
static String after(@CallSite.AllArguments final Object[] arguments,
271271
@CallSite.Return final String result,
272272
@CallSite.InvokeDynamicConstants final Object[] constants) {
273-
return result;
273+
return result
274274
}
275275
}
276276

buildSrc/call-site-instrumentation-plugin/src/test/groovy/datadog/trace/plugin/csi/impl/AdviceSpecificationTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ class AdviceSpecificationTest extends BaseCsiPluginTest {
548548
class AfterWithVoidWrongAdvice {
549549
@CallSite.After("void java.lang.String.getChars(int, int, char[], int)")
550550
static String after(@CallSite.AllArguments final Object[] args, @CallSite.Return final String result) {
551-
return result;
551+
return result
552552
}
553553
}
554554

buildSrc/call-site-instrumentation-plugin/src/test/groovy/datadog/trace/plugin/csi/impl/AsmSpecificationBuilderTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import datadog.trace.plugin.csi.impl.CallSiteSpecification.AfterSpecification
77
import datadog.trace.plugin.csi.impl.CallSiteSpecification.AroundSpecification
88
import datadog.trace.plugin.csi.impl.CallSiteSpecification.BeforeSpecification
99
import datadog.trace.plugin.csi.util.Types
10-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
10+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
1111
import groovy.transform.CompileDynamic
1212
import org.objectweb.asm.Type
1313

0 commit comments

Comments
 (0)