Skip to content

Conversation

alllex
Copy link
Member

@alllex alllex commented Jan 10, 2025

Annotate all BuildTree-scoped services with the appropriate service scopes, and require any new services to be properly annotated.

Follow-up for #31965

The changes are across many files but they are mostly trivial and of two types:

  • Add a missing @ServiceScope annotation to the service interface/class
  • Update service registration by exposing only the service interface, instead of the service implementation

The latter is done either by updating the returned type from a factory method or by adding an explicit service type in the registration.add() call.

@alllex alllex self-assigned this Jan 10, 2025
@alllex alllex added a:chore Minor issue without significant impact in:internal-services Internal services dependency injection labels Jan 10, 2025
Base automatically changed from alllex/gist/dv-services to master January 10, 2025 20:37
@alllex alllex force-pushed the alllex/gist/strict-build-tree-scope branch from e5889f5 to 34bd938 Compare January 10, 2025 21:46
@alllex
Copy link
Member Author

alllex commented Jan 13, 2025

@bot-gradle test without pts

@bot-gradle

This comment has been minimized.

@bot-gradle
Copy link
Collaborator

The following builds have passed:

public BuildTreeState(BuildInvocationScopeId buildInvocationScopeId, ServiceRegistry parent, BuildTreeModelControllerServices.Supplier modelServices) {
services = ServiceRegistryBuilder.builder()
.scope(Scope.BuildTree.class)
.scopeStrictly(Scope.BuildTree.class)
Copy link
Member Author

Choose a reason for hiding this comment

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

ℹ️ Ensure services in the scope are strictly annotated

@alllex alllex marked this pull request as ready for review January 13, 2025 11:54
@alllex alllex requested review from a team as code owners January 13, 2025 11:54
@alllex alllex requested a review from a team January 13, 2025 11:54
@alllex alllex requested review from a team as code owners January 13, 2025 11:54
@alllex alllex requested review from a team, abstratt, ghale, mlopatkin and reinsch82 and removed request for a team January 13, 2025 11:54
"org.gradle.cache.internal.ProducerGuard",
"org.gradle.internal.typeconversion.NotationParser",

"org.gradle.caching.internal.origin.OriginMetadataFactory",
Copy link
Member

Choose a reason for hiding this comment

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

💅 would be nice to have a comment describing the reason for suppression

Copy link
Member

@abstratt abstratt left a comment

Choose a reason for hiding this comment

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

LGTM!

@alllex alllex enabled auto-merge January 13, 2025 20:30
@alllex alllex added this pull request to the merge queue Jan 13, 2025
@bot-gradle bot-gradle added this to the 8.13 RC1 milestone Jan 13, 2025
Merged via the queue into master with commit bed5cb4 Jan 13, 2025
22 checks passed
@alllex alllex deleted the alllex/gist/strict-build-tree-scope branch January 13, 2025 23:23
alllex added a commit that referenced this pull request Jan 22, 2025
reinsch82 pushed a commit that referenced this pull request Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:chore Minor issue without significant impact in:internal-services Internal services dependency injection

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants