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

Include the incubating dependency in the published pom as an optional dependency #7137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

trask
Copy link
Member

@trask trask commented Feb 22, 2025

Resolves #7119

The published poms for the related modules, e.g. for io.opentelemetry:opentelemetry-sdk-trace, would now include:

    <dependency>
      <groupId>io.opentelemetry</groupId>
      <artifactId>opentelemetry-api-incubator</artifactId>
      <version>1.48.0-alpha</version>
      <scope>runtime</scope>
      <optional>true</optional>
    </dependency>
  </dependencies>

Copy link

codecov bot commented Feb 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.85%. Comparing base (56941a5) to head (d1ba7c4).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #7137   +/-   ##
=========================================
  Coverage     89.85%   89.85%           
  Complexity     6610     6610           
=========================================
  Files           740      740           
  Lines         19986    19986           
  Branches       1964     1964           
=========================================
  Hits          17958    17958           
  Misses         1439     1439           
  Partials        589      589           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@trask trask marked this pull request as ready for review February 22, 2025 19:22
@trask trask requested a review from a team as a code owner February 22, 2025 19:22
Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Nice idea. Found more documentation about this capability here: https://docs.gradle.org/current/userguide/feature_variants.html

Its kind of strange. The syntax for instructing gradle to automatically include the dependencies required by the "incubating" feature would look something like:

 implementation("io.opentelemetry:opentelemetry-sdk-trace")) {
     capabilities {
         requireCapability("io.opentelemetry:opentelemetry-sdk-trace-incubating")
     }
 }

With gradle able to resolve the dependencies of the -incubating feature based on contents from the *.module file (e.g. opentelemetry-sdk-trace-1.47.0.module).

Its not a syntax I expect most gradle users would be familiar with, so I wonder if we would be better off telling users to add the required opentelemetry-api-incubator instead of using the requireCapability syntax.

If we go in this direction, here are some other places we would want this:

Seems like it could get complicated quickly.

I wonder if there's any lightweight way to instruct gradle to include the "optional" metadata in pom.xml without leveraging this gradle feature capability.

<scope>compile</scope>
      <optional>true</optional>

@jack-berg
Copy link
Member

See #7157 for a possible alternative

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.

v1.47.0 Introduces a missing link on dependencies
2 participants