Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce library instrumentation package names matching their module names #12957

Merged
merged 11 commits into from
Mar 12, 2025

Conversation

trask
Copy link
Member

@trask trask commented Dec 23, 2024

Related to #932

@trask trask closed this Feb 20, 2025
@trask trask deleted the check-package-names branch February 20, 2025 02:54
@trask trask restored the check-package-names branch February 20, 2025 02:54
@trask trask reopened this Feb 20, 2025
@trask trask force-pushed the check-package-names branch from 1e73636 to 12de48e Compare February 20, 2025 03:55
@@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.instrumentation.netty.v4.common;
package io.opentelemetry.instrumentation.netty.common.v4_0;
Copy link
Member Author

@trask trask Feb 20, 2025

Choose a reason for hiding this comment

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

I think this is the only public class that is affected

I'm not sure if we can gracefully deprecate since it's used inside of generics in other public classes (that haven't changed)

@trask trask changed the title [work in progress] Validate package names Enforce library instrumentation package names matching their module names Feb 20, 2025
@trask trask marked this pull request as ready for review February 20, 2025 04:06
@trask trask requested a review from a team as a code owner February 20, 2025 04:06
@@ -5,7 +5,7 @@ plugins {
dependencies {
library("org.elasticsearch.client:elasticsearch-rest-client:7.0.0")
implementation("net.bytebuddy:byte-buddy")
implementation(project(":instrumentation:elasticsearch:elasticsearch-rest-common:library"))
implementation(project(":instrumentation:elasticsearch:elasticsearch-rest-common-5.0:library"))
Copy link
Member

Choose a reason for hiding this comment

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

is the idea with common modules that we would always add a version suffix for the lowest version number that it is used by?

Copy link
Member Author

Choose a reason for hiding this comment

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

that was my first idea, but then I thought the more consistent strategy is

the common module version would match the version used in its build.gradle.kts

there are two common modules (lettuce-common and netty-common) that don't have a dependency on the instrumented library, in which case I didn't add any base version

Copy link
Member

@jaydeluca jaydeluca left a comment

Choose a reason for hiding this comment

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

@trask
Copy link
Member Author

trask commented Mar 12, 2025

what do you think of adding a small blurb to https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/writing-instrumentation.md explaining the naming convention?

sorry didn't get to this, but going to merge to get the CI check in

@trask trask merged commit f11d176 into open-telemetry:main Mar 12, 2025
62 checks passed
@trask trask deleted the check-package-names branch March 12, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants