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

Wrapper upgrade plugin #61

Closed
wants to merge 2 commits into from
Closed

Conversation

StefMa
Copy link
Contributor

@StefMa StefMa commented Jan 28, 2024

fixes #59

The GH aciton workflow was more or less copied from the gradle-wrapper-upgrade project itself.
👉 Link to their workflow file

Please notice that I removed the commit signing part here.
I'm not sure if this is/was a requirement for you. But to make this PR easy and straightforward I left them out.
Let me know if you want to include it.
If so, add the key and password to this repository (if not already added via the Gradle GitHub organisation) and I will add the respective code parts.

To note is also that the pull request create by this workflow does not run any tests❗
This is due to the fact that we are using the secrets.GITHUB_TOKEN.
Any PR that were created by an action can't trigger other actions by design.

So in case we want to run tests also on wrapper upgrade PRs (which make sense IMHO), you have to provide another secret and invite the respective user of this secret to this repo as collaborator with write access.
You might want to use your bot-githubaction for that 🙃 Seems this bot is designed for such tasks 😁

Here is an example of how such an PR could look like.
Notice that it doesn't run any tests. Only the DCO check runs (because of I don't know the reason 🙈 )

@StefMa
Copy link
Contributor Author

StefMa commented Feb 6, 2024

@ov7a wanna have a look at this? 😁

@ov7a
Copy link
Member

ov7a commented Feb 6, 2024

@StefMa sorry, I'm not confident enough to approve this.
While having an automatic wrapper update is nice, I don't think the wrapper-upgrade-gradle-plugin is the best fit for that.
Did you consider https://github.com/gradle-update/update-gradle-wrapper-action instead? It's more straightforward.

@StefMa
Copy link
Contributor Author

StefMa commented Mar 7, 2024

Sorry for coming so late back to you @ov7a 🙈

Yes, I agree that a plugin that checks for Gradle upgrades might be not the best decision to put into a project.
These are two different things and should be separated.

Using the mentioned action could be an option, however, it seems it is a bit dated and seems not to be maintained anymore. (Not sure if required, but 🤷 ).

On the other hand, other Gradle projects also using the gradle-wrapper-upgrade-plugin (examples PRs):
gradle/wrapper-upgrade-gradle-plugin#205
gradle/gradle-enterprise-build-validation-scripts#563
gradle/develocity-build-config-samples#1053
gradle/common-custom-user-data-gradle-plugin#21

Obviosuly I don't know how your organisation is structured and how far it make sense to streamline.
But I also wanted to point out that the Junit team as well as my current company see the concers of having the Gradle plugin in each and every project. Therefore we decided to have a separate repository that schedules the udpates for each repository.
See https://github.com/junit-team/wrapper-upgrade & https://github.com/ioki-mobility/GradleWrapperUpgrader

Maybe this is a solution for you as well? 🤔

@jbartok
Copy link
Member

jbartok commented Nov 13, 2024

For this project it's not useful to automatically update the wrapper whenever there is a Gradle release. The plugin works with all kinds of Gradle versions, regardless which wrapper it's built with. So we have nothing to gain from automatic updates, but we can easily break the build of this project. So I guess we shouldn't do this.

@jbartok jbartok closed this Nov 13, 2024
@StefMa
Copy link
Contributor Author

StefMa commented Nov 13, 2024

The plugin works with all kinds of Gradle versions, regardless which wrapper it's built with.

Thats the default for Gradle plugins, no? 😁

but we can easily break the build of this project

Wait... what?!

As a Gradle employee you tell me that automated Gradle updates or using the latest (marked by Gradle as stable) Gradle (wrapper) version in projects "can easily break the build"?

Isn't Gradle itself advocating that "each and every project" should use the "latest Gradle version when possible"?

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.

Add wrapper-upgrade-gradle-plugin
3 participants