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

Remove unused api dependencies or move them to lower scope #3169

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

Dependency-analysis plugin detected that some api dependencies are unused and can be either removed or downgraded to implementation / testImplementation scopes.

Modifications:

  • Remove unused api dependencies.
  • Downgrade some to implementation / testImplementation scopes.
  • Regenerate lock files.

Result:

No more warnings from dependency-analysis plugin.

Risk for users:

Minimal. They can be broken only if they use some dependency at compile time without explicitly declaring it in their build, which is their mistake.

Highlights:

  • Most changes are related to servicetalk-* dependencies, users likely have them anyway via other modules.
  • It's safe to remove opentelemetry-api from opentelemetry-asynccontext module because in Explicitly declare transitive dependencies that we use directly #3164 we added opentelemetry-context.
  • Removal of proto-google-common-protos should not be an issue because it's already an api dependency for grpc-api module.

Motivation:

Dependency-analysis plugin detected that some `api` dependencies are
unused and can be either removed or downgraded to `implementation` /
`testImplementation` scopes.

Modifications:

- Remove unused `api` dependencies.
- Downgrade some to `implementation` / `testImplementation` scopes.
- Regenerate lock files.

Result:

No more warnings from dependency-analysis plugin.

Risk for users:

Minimal. They can be broken only if they use some dependency at compile
time without explicitly declaring it in their build, which is their
mistake.

Highlights:
- Most changes are related to `servicetalk-*` dependencies,
users likely have them anyway via other modules.
- It's safe to remove `opentelemetry-api` from
`opentelemetry-asynccontext` module because in apple#3164 we added
`opentelemetry-context`.
- Removal of `proto-google-common-protos` should not be an issue because
it's already an `api` dependency for `grpc-api` module.
Copy link
Contributor

@bryce-anderson bryce-anderson left a comment

Choose a reason for hiding this comment

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

I wonder if our API exporting could be cleaned up more generally. For example, it seems like many of -internal shouldn't be exporting dependencies. However, that seems like a task for a different time, if at all.

@idelpivnitskiy
Copy link
Member Author

The only important rule to keep in mind (we will have to implement a custom script to enforce it) is that we should never add any of our -internal dependency as api for a non-internal module. Everything else should be fine. It's not a problem that -internal modules have some dependencies as api.

@idelpivnitskiy idelpivnitskiy merged commit 46d56ea into apple:main Jan 13, 2025
11 checks passed
@idelpivnitskiy idelpivnitskiy deleted the api-deps branch January 13, 2025 17:08
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