Skip to content

Add platform dependency#1438

Merged
breedx-splk merged 1 commit intoopen-telemetry:mainfrom
dream-horizon-org:fixes/1434/add-bom
Dec 3, 2025
Merged

Add platform dependency#1438
breedx-splk merged 1 commit intoopen-telemetry:mainfrom
dream-horizon-org:fixes/1434/add-bom

Conversation

@atulgpt17
Copy link
Copy Markdown
Contributor

Fixes #1434

@atulgpt17 atulgpt17 requested a review from a team as a code owner December 2, 2025 15:52
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Dec 2, 2025

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: atulgpt17 / name: Atul Gupta (466503c)

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.76%. Comparing base (79309e0) to head (466503c).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1438   +/-   ##
=======================================
  Coverage   63.76%   63.76%           
=======================================
  Files         159      159           
  Lines        3146     3146           
  Branches      325      325           
=======================================
  Hits         2006     2006           
  Misses       1043     1043           
  Partials       97       97           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@breedx-splk
Copy link
Copy Markdown
Contributor

Hey @atulgpt17 it looks like you submitted this from your work account instead of your personal account (@atulgpt ) maybe? In any case, we require the CLA to be signed...so please either sign it from this account or close this PR and open it with your other account (which has already signed the CLA).

Thanks!

@breedx-splk
Copy link
Copy Markdown
Contributor

Thanks @atulgpt17. This feels like a good idea, but I can't determine if the absence of these platform test deps was actually causing problems? If so, can you please explain what you observed or what was broken? The build and tests do indeed seem fine without them, and the dependencies seem to be resolved just fine before....so?

@atulgpt17
Copy link
Copy Markdown
Contributor Author

atulgpt17 commented Dec 3, 2025

Hi @breedx-splk in our current modules, problem is not arising as for each module either we are adding api(platform(libs.opentelemetry.platform.alpha)) separately in build.gradle.kts(which is fine in itself) or adding implementation(project(":common")) which has api(platform(libs.opentelemetry.platform.alpha)) so that version is also satisfied

But let's say you create a module which doesn't have either of those, but you have added the convention plugin id("otel.android-library-conventions") then when you will run your UT then build will fail with the below error

FAILURE: Build failed with an exception.
* What went wrong:
Configuration cache state could not be cached: field `__dependencies__` of task `:testLib:generateDebugUnitTestStubRFile` of type `com.android.build.gradle.internal.res.GenerateLibraryRFileTask`: error writing value of type 'org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection'
> Could not resolve all files for configuration ':testLib:debugUnitTestRuntimeClasspath'.
   > Could not find io.opentelemetry:opentelemetry-sdk-testing:.
     Required by:
         project ':testLib'

(above note the :. this is coming as in the testLib module there is no way to get the version info)

Ideally if we are adding one dependency "opentelemetry-sdk-testing" in the convention plugin then we should either specify it's version or add some bom from where Gradle can determine it's version in that convention plugin so that plugin can become self sufficient

@breedx-splk
Copy link
Copy Markdown
Contributor

@atulgpt17 thanks for the clear explanation, that makes sense. The platform dependency declarations are spread around so much, I think that maybe consolidating them into the conventions probably makes sense, but we should do that in a separate follow-up PR. Thanks for catching this.

@breedx-splk breedx-splk merged commit 4e4249b into open-telemetry:main Dec 3, 2025
8 checks passed
@atulgpt17
Copy link
Copy Markdown
Contributor Author

Hi @breedx-splk I have added the cleanup PR at #1453

PTAL if this is why you mean by The platform dependency declarations are spread around so much, I think that maybe consolidating them into the conventions probably makes sense,

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.

we are using opentelemetry-sdk-testing in our otel plugins but we are not adding the dpendency of opentelemetry-platform-alpha

2 participants