Skip to content

Do not check all-service endpoint if exact version requested #5737

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bmuschko
Copy link
Contributor

@bmuschko bmuschko commented Jul 9, 2025

What's changed?

The https://services.gradle.org/versions/all endpoint is really only needed to determine the latest version available if a version wildcard notation (e.g. 8.x) or null has been requested by the end user. In all other cases, we are making an unnecessary HTTPS call.

Side note: The repositoryUrl always used the null value. I removed the parameter to make the logic less confusing.

What's your motivation?

Many declarative recipes add the UpdateGradleWrapper recipe and provide a specific version as a default value. For example, the MigrateToGradle8 recipe sets the version option value to 8.x.

Within enterprises, the https://services.gradle.org endpoint is often times not exposed. Calling the endpoint simply results in a failure after running into a HTTP timeout or by not being able to resolve it. End users usually do not know that the Wrapper distribution needs to be resolved from an in-house binary repository; nevertheless they execute the recipe with the default values. For scenarios where the user provided an exact version, we'll increase the performance of the recipe execution.

Anything in particular you'd like reviewers to focus on?

No

@okundzich
Copy link
Member

how would this help given that most of our recipes have ranges

@bmuschko
Copy link
Contributor Author

bmuschko commented Jul 9, 2025

how would this help given that most of our recipes have ranges

It only helps with use cases where you request of an exact version. I know plenty of open source projects and companies that will not necessarily want to the latest if they call the UpdateGradleWrapper recipe. And as mentioned, it will also reduce the number of calls if you "accidentally" make a call to https://services.gradle.org/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants