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

Allow attributes to be defined on plugin dependencies #28981

Merged
merged 1 commit into from May 8, 2024

Conversation

jvandort
Copy link
Member

Fixes #28933

Reviewing cheatsheet

Before merging the PR, comments starting with

  • ❌ ❓must be fixed
  • 🤔 💅 should be fixed
  • 💭 may be fixed
  • 🎉 celebrate happy things

@jvandort jvandort added this to the 8.9 RC1 milestone Apr 26, 2024
@jvandort jvandort force-pushed the jvandort/iss/28933 branch 2 times, most recently from 61b0ead to 66d072c Compare May 8, 2024 12:17
@jvandort jvandort self-assigned this May 8, 2024
@jvandort jvandort marked this pull request as ready for review May 8, 2024 12:18
@jvandort jvandort requested review from a team as code owners May 8, 2024 12:18
@jvandort jvandort requested a review from octylFractal May 8, 2024 12:18
Use a DependencyFactory to instantiate dependency instances generated by plugin requests so that they
have their services properly injected. Previously, they were instantiated directly and did not have
their services.

Also remove the ArtifactRepositoriesPluginResovlerTest, as it relied heavily on mocks and therefore
did not reflect the actual environment that the class-under-test was operating under. The tests it
performed were already addressed by existing integ tests.
@gradle gradle deleted a comment from jvandort May 8, 2024
@bot-gradle
Copy link
Collaborator

I've triggered the following builds for you. Click here to see all build failures.

}
}

private String getNotation(Dependency dependency) {
return Joiner.on(':').join(dependency.getGroup(), dependency.getName(), dependency.getVersion());
}

private DependencyFactory getDependencyFactory() {
Copy link
Member

Choose a reason for hiding this comment

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

🤔 I think it would be better to story the DependencyFactory as a field in the constructor, rather than having to call this private getter everytime. That would also remove the need for the resolutionServices field.

Copy link
Member Author

@jvandort jvandort May 8, 2024

Choose a reason for hiding this comment

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

ResolutionServices is already used elsewhere in this class. Do you recommend pulling out the other two used services as well?

Copy link
Member

Choose a reason for hiding this comment

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

I missed it being used in the folded unchanged section. Probably not worth removing removing the one field to add two others then. Still, I think you can avoid the getter.

@@ -648,6 +649,11 @@ public AttributesSchema getAttributesSchema() {
public ObjectFactory getObjectFactory() {
return services.get(ObjectFactory.class);
}

@Override
public DependencyFactory getDependencyFactory() {
Copy link
Member

Choose a reason for hiding this comment

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

💭 Kind of odd this wasn't already present here.

}
}

private String getNotation(Dependency dependency) {
return Joiner.on(':').join(dependency.getGroup(), dependency.getName(), dependency.getVersion());
}

private DependencyFactory getDependencyFactory() {
Copy link
Member

Choose a reason for hiding this comment

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

I missed it being used in the folded unchanged section. Probably not worth removing removing the one field to add two others then. Still, I think you can avoid the getter.

@jvandort jvandort added this pull request to the merge queue May 8, 2024
@bot-gradle
Copy link
Collaborator

WARN: Based on labels, this pull request addresses notable issue but no changes to release note found.

@jvandort jvandort removed this pull request from the merge queue due to a manual request May 8, 2024
@big-guy big-guy modified the milestones: 8.9 RC1, 8.8 RC2 May 8, 2024
@jvandort jvandort changed the base branch from master to release May 8, 2024 16:18
@jvandort
Copy link
Member Author

jvandort commented May 8, 2024

@bot-gradle test this

@gradle gradle deleted a comment from jvandort May 8, 2024
@gradle gradle deleted a comment from jvandort May 8, 2024
@bot-gradle
Copy link
Collaborator

I've triggered the following builds for you. Click here to see all build failures.

@jvandort jvandort added this pull request to the merge queue May 8, 2024
@bot-gradle
Copy link
Collaborator

WARN: Based on labels, this pull request addresses notable issue but no changes to release note found.

Merged via the queue into release with commit cd664f8 May 8, 2024
47 of 57 checks passed
@jvandort jvandort deleted the jvandort/iss/28933 branch May 8, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gradle is not honoring status attribute for buildscript classpath dependencies when using plugin markers
4 participants