Skip to content

Conversation

FinlayRJW
Copy link
Contributor

@FinlayRJW FinlayRJW commented Jul 3, 2025

Before this PR

Previously there was no mechanism for other plugins to safely modify the ConjureProductDependenciesExtension.getProductDependencies this resulted in other plugins just modifying the state of getProductDependencies on the extension directly. This used to work from dumb luck but now we are rolling configuration cache out the convertDependencies method is called before other plugins have a change to modify the state

After this PR

Fundamentally this is meant to be a light touch PR we want to unblock configuration cache without having to do a massive re-write of gradle-conjure at some point we will be force to comeback and make a lot of changes but for now I'm trying to keep it minimal

If we where to build this from the ground up we should have used the NamedDomainContainer but this forces you to change the was you set serviceDependencies in your build.gradle so instead we settled on adding a getProductDependenciesTransformers method on the extension that allows other plugins to add methods that modify the ServiceDependency as late as possible

==COMMIT_MSG==
==COMMIT_MSG==

Possible downsides?

I couldn't figure out how to get a test working in the IntegrationSpec so I've added a small java test for the extension this can be a FLUP if it is critical

This does introduce a few breaks!

  • getProductDependencies and getEndpointVersions are now SetProperties
  • ConjureProductDependenciesExtension is abstract

This should not be much of a problem we only seriously use this extension in one internal plugin -> https://pl.ntr/2v9 a PR to fix this there will follow soon

@changelog-app
Copy link

changelog-app bot commented Jul 3, 2025

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

Introduce getProductDependenciesTransformers to ConjureProductDependenciesExtension to help unblock configuration cache

Check the box to generate changelog(s)

  • Generate changelog entry

@FinlayRJW FinlayRJW changed the title Finlayw/fix minimum version issue Introduce getProductDependenciesTransformers to ConjureProductDependenciesExtension to help unblock configuration cache Jul 4, 2025
- code: "java.annotation.removed"
old: "method void com.palantir.gradle.conjure.api.ConjureProductDependenciesExtension::<init>(org.gradle.api.Project)"
new: "method void com.palantir.gradle.conjure.api.ConjureProductDependenciesExtension::<init>()"
justification: "ConjureProductDependenciesExtension has been modernised to use\
Copy link
Contributor Author

@FinlayRJW FinlayRJW Jul 4, 2025

Choose a reason for hiding this comment

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

Is this a good enough justification? should I do a separate one for each break?

@FinlayRJW FinlayRJW marked this pull request as ready for review July 4, 2025 15:01
Finlay Williams added 3 commits July 7, 2025 15:15
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.

3 participants