Skip to content

Commit ef54c96

Browse files
authored
Merge branch 'main' into copilot/fix-79effdad-6d82-4980-ad08-443e4438f725
2 parents 6fd2f36 + a6cc2ba commit ef54c96

File tree

33 files changed

+340
-132
lines changed

33 files changed

+340
-132
lines changed

.github/workflows/build-common.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ jobs:
279279

280280
# vaadin 14 tests fail with node 18
281281
- name: Set up Node
282-
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
282+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
283283
with:
284284
node-version: 16
285285

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
include:
3333
- language: actions
3434
- language: java
35-
runs-on: oracle-8cpu-32gb-x86-64
35+
runs-on: oracle-vm-8cpu-32gb-x86-64
3636
steps:
3737
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3838

@@ -63,7 +63,7 @@ jobs:
6363
cache-read-only: ${{ github.event_name == 'pull_request' }}
6464

6565
- name: Initialize CodeQL
66-
uses: github/codeql-action/init@42213152a85ae7569bdb6bec7bcd74cd691bfe41 # v3.30.9
66+
uses: github/codeql-action/init@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
6767
with:
6868
languages: ${{ matrix.language }}
6969
# using "linked" helps to keep up with the linked Kotlin support
@@ -84,6 +84,6 @@ jobs:
8484
--no-build-cache --no-daemon
8585
8686
- name: Perform CodeQL analysis
87-
uses: github/codeql-action/analyze@42213152a85ae7569bdb6bec7bcd74cd691bfe41 # v3.30.9
87+
uses: github/codeql-action/analyze@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
8888
with:
8989
category: "/language:${{matrix.language}}"

.github/workflows/ossf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ jobs:
4242
# Upload the results to GitHub's code scanning dashboard (optional).
4343
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
4444
- name: "Upload to code-scanning"
45-
uses: github/codeql-action/upload-sarif@42213152a85ae7569bdb6bec7bcd74cd691bfe41 # v3.30.9
45+
uses: github/codeql-action/upload-sarif@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
4646
with:
4747
sarif_file: results.sarif

.github/workflows/pr-automation-comments.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Comment on PR
15-
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
15+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
1616
with:
1717
script: |
1818
const { data: comments } = await github.rest.issues.listComments({
@@ -64,7 +64,7 @@ jobs:
6464
runs-on: ubuntu-latest
6565
steps:
6666
- name: Comment on PR
67-
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
67+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
6868
with:
6969
script: |
7070
const { data: comments } = await github.rest.issues.listComments({

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ tasks {
155155
}
156156

157157
val generateReleaseBundle by registering(Zip::class) {
158-
dependsOn(getTasksByName("publishAllPublicationToReleaseRepoRepository", true))
158+
dependsOn(project.tasks.withType<PublishToMavenRepository>())
159159
from("releaseRepo")
160160

161161
exclude("**/maven-metadata.*")

instrumentation/executors/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/executors/ThreadPoolExecutorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import io.opentelemetry.api.baggage.Baggage;
1212
import io.opentelemetry.context.Scope;
13-
import io.opentelemetry.javaagent.bootstrap.VirtualFieldInstalledMarker;
13+
import io.opentelemetry.javaagent.bootstrap.field.VirtualFieldInstalledMarker;
1414
import java.util.concurrent.CountDownLatch;
1515
import java.util.concurrent.FutureTask;
1616
import java.util.concurrent.LinkedBlockingQueue;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins {
2+
id("otel.java-conventions")
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.javaagent.instrumentation.internal.classloader.stub;
7+
8+
import java.security.ProtectionDomain;
9+
10+
/**
11+
* A placeholder for java.lang.ClassLoader to allow compilation of advice classes that invoke
12+
* protected methods of ClassLoader (like defineClass and findLoadedClass). During the build we'll
13+
* use shadow plugin to replace reference to this class with the real java.lang.ClassLoader.
14+
*/
15+
@SuppressWarnings("JavaLangClash")
16+
public abstract class ClassLoader {
17+
public abstract Class<?> findLoadedClass(String name);
18+
19+
public abstract Class<?> defineClass(
20+
String name, byte[] b, int off, int len, ProtectionDomain protectionDomain);
21+
}

instrumentation/internal/internal-class-loader/javaagent-integration-tests/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ dependencies {
66
compileOnly("org.apache.commons:commons-lang3:3.12.0")
77
testImplementation("org.apache.commons:commons-lang3:3.12.0")
88

9-
testInstrumentation(project(":instrumentation:internal:internal-class-loader:javaagent"))
9+
testInstrumentation(project(":instrumentation:internal:internal-class-loader:javaagent", configuration = "shaded"))
1010
}

instrumentation/internal/internal-class-loader/javaagent/build.gradle.kts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+
13
plugins {
24
id("otel.javaagent-instrumentation")
35
}
46

57
dependencies {
68
compileOnly(project(":javaagent-bootstrap"))
79
compileOnly(project(":javaagent-tooling"))
10+
compileOnly(project(":instrumentation:internal:internal-class-loader:compile-stub"))
811

912
testImplementation(project(":javaagent-bootstrap"))
1013

@@ -21,3 +24,32 @@ dependencies {
2124
testImplementation("org.eclipse.platform:org.eclipse.osgi:3.13.200")
2225
testImplementation("org.apache.felix:org.apache.felix.framework:6.0.2")
2326
}
27+
28+
val shadedJar by tasks.registering(ShadowJar::class) {
29+
from(zipTree(tasks.jar.get().archiveFile))
30+
archiveClassifier.set("shaded")
31+
}
32+
33+
tasks {
34+
withType(ShadowJar::class) {
35+
relocate("io.opentelemetry.javaagent.instrumentation.internal.classloader.stub", "java.lang")
36+
}
37+
38+
assemble {
39+
dependsOn(shadedJar)
40+
}
41+
}
42+
43+
// Create a consumable configuration for the shaded jar. We can't use the "shadow" configuration
44+
// because that is taken by the agent-testing.jar
45+
configurations {
46+
consumable("shaded") {
47+
attributes {
48+
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named("shaded"))
49+
}
50+
}
51+
}
52+
53+
artifacts {
54+
add("shaded", shadedJar)
55+
}

0 commit comments

Comments
 (0)