Skip to content

Conversation

@exoego
Copy link
Contributor

@exoego exoego commented Jul 5, 2025

Closes #1594

Move all definition of dependencies into Gradle version catalogs.
This will reduce duplicates of same dependency update in multiple sub projects such as:
image

Mostly auto-generated by the tool I wrote

@exoego exoego requested a review from a team as a code owner July 5, 2025 13:13
@exoego
Copy link
Contributor Author

exoego commented Jul 5, 2025

@microsoft-github-policy-service agree

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2025

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

@baywet
Copy link
Member

baywet commented Jul 7, 2025

Hi @exoego
Thanks for the contribution!

We're receiving multiple pull requests per dependency update because:

  • dependencies are used across packages
  • dependencies are used both android and the "regular" project

I believe that as long as we don't update the dependabot configuration to contain a single entry, we'll still get multiple PRs per dependency, which will all target the new file you're introducing.

What do you think?

@exoego
Copy link
Contributor Author

exoego commented Jul 7, 2025

I prefer getting multiple PRs per dependency.
Because it is easier to identify which update cause build error.

@baywet
Copy link
Member

baywet commented Jul 7, 2025

Thank you for the additional information.

Then, if the intent of this pull request is not to solve the multiple pull requests per dependency, what are you looking to achieve beyond having all the versions at the same place?

@exoego
Copy link
Contributor Author

exoego commented Jul 7, 2025

Then, if the intent of this pull request is not to solve the multiple pull requests per dependency, what are you looking to achieve beyond having all the versions at the same place?

It's not MY intention. This PR just solves #1594 which is kept open since 2024 Sep, so I guessed maintainers have wish to implement it.
If you think version catalog is not good to have, then you should close this PR and #1594.


Another benefit of version catalog is having version variable in [versions] section.
It helps updating some group of relevant dependency at once, which reduce dependabot PRs at some extent.

There is two examples in this PR

  • okhttp
  • opentelemetry
[versions]
okhttp = "4.12.0"
opentelemetry = "1.51.0"

[libraries]
...
com-squareup-okhttp3-logging-interceptor = { group = "com.squareup.okhttp3", name = "logging-interceptor", version.ref = "okhttp" }
com-squareup-okhttp3-mockwebserver = { group = "com.squareup.okhttp3", name = "mockwebserver", version.ref = "okhttp" }
com-squareup-okhttp3-okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" }
...
io-opentelemetry-opentelemetry-api = { group = "io.opentelemetry", name = "opentelemetry-api", version.ref = "opentelemetry" }
io-opentelemetry-opentelemetry-context = { group = "io.opentelemetry", name = "opentelemetry-context", version.ref = "opentelemetry" }

version.ref refers to variables defined in [versions].

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

Thank you for the additional information.

Even if this dos not reduce the number of PRs, it should make their review faster through reduced duplication and improved readability.

@baywet baywet enabled auto-merge July 8, 2025 13:25
@github-project-automation github-project-automation bot moved this to In Progress 🚧 in Kiota Jul 8, 2025
@baywet baywet merged commit b756691 into microsoft:main Jul 8, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from In Progress 🚧 to Done ✔️ in Kiota Jul 8, 2025
@exoego exoego deleted the catalog branch July 8, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Use Gradle version catalogs to have a single source of truth for dependency versions

3 participants