Splitties / refreshVersions

Life is too short to google for dependencies and versions
https://splitties.github.io/refreshVersions/
MIT License
1.66k stars 107 forks source link

Support for Renovate Bot #207

Open miikeat opened 4 years ago

miikeat commented 4 years ago

Renovate Bot is only supporting updating version numbers in gradle.properties. Probably it also doesn't understand the "_"-placeholder.

Is there a way to get Renovate Bot working while still using your Plugin with all it's advantages? I would love to have the feature of automatic PR creation for Dependency Updates but as we are using Bitbucket the number of possible applications to do this is quite low :(

LouisCAD commented 4 years ago

It's complicated and would certainly require work on Renovate bot's end. I'll keep this open, but this is low priority as I'm focused on version 1.0 (and on vacation).

jmfayard commented 4 years ago

If someone wants to work on this from the Renoavte Bot side, I can provide information on how that would work

miikeat commented 4 years ago

I'd be curious what's needed for this to work! Maybe I'll find the time and could do the Renovate part...

jmfayard commented 4 years ago

I had a look at what Renovate Bot here https://github.com/galacticcouncil/substrate-api-explorer/issues/114 and here https://github.com/mulesoft/mule-migration-assistant/pull/406

It seems to me that it should be quite easy for the bot to

That's the whole point of it by the way, this file is machine readable and writable.

Given a versions.properties like this:

it could then reformat it in the issue like this:

- [ ] update version.kotlinx.coroutines to 1.3.7 from 1.3.1

And in the pull request it would just do

## versions.properties
- version.kotlinx.coroutines=1.3.1
+ version.kotlinx.coroutines=1.3.7

Now ideally you would have a CI setup so that you run the unit tests for example to checck whether you have a compability problem with the new version.

(The only question would be how you filter the multiple options to just one)

jmfayard commented 4 years ago

Discover thanks to Twitter how renovabot currently works https://github.com/renovatebot/renovate/blob/d858d85205cc99d7ecf617754612d2a17ff4eda0/lib/manager/gradle/gradle-updates-report.ts#L42

vlsi commented 4 years ago

AFAIK the approach here would be to add gradle-refreshVersions "manager" (like gradle and gradle-wrapper )

yschimke commented 2 years ago

I came here to file this bug upon seeing https://github.com/renovatebot/renovate/pull/16684/files which adds support for kts files. Does this still seem feasible?

jmfayard commented 2 years ago

@yschimke Kotlin scripts support in dependabot isn't related to refreshVersions.

Are you using refreshVersion already?

If yes there is no need to use dependabot. I use a little GitHub Actions that runs or demand or according to a crontab, which runs refreshVerisons, commit and open a pull request. I can share it if you need it.

Screenshot 2022-07-28 at 09 29 41
vlsi commented 2 years ago

@jmfayard , I believe the PR was just a sample integration.

If yes there is no need to use dependabot

I'm afraid, that is the other way around. Dependabot / Renovate helps to make it easier to weigh and test different dependencies. Dependabot/renovate generate human-readable PRs, they list changelog, etc, etc.

So it would make total sense to add something like PR 16684 above, except it should consume and update versions.properties.

jmfayard commented 2 years ago

If somoeone wants to work on dependabot for that, I'm totally fine.

It seems like they are doing manual parsing? That's a bit sad. They would never fully support Gradle this way, it's turing complete.

If they use Gradle there is nothing special they need to do query the list of dependencies and versions managed by refreshVersions. And for updating versions.properties we can trivially add a task ./gradlew refreshVersionsUpdateVersion --dependency "it.krzeminski:github-actions-kotlin-dsl" --version "0.22.0"

yschimke commented 2 years ago

Yep, wasn't linking to that PR as a solution, more as a recent example showing they take contributions, and the complexity of this sort of support.

jmfayard commented 2 years ago

As I said, the complexity depend on whether they do manual parsing or can call Gradle. If the later it should be pretty easy, for the former I wouldn't want to work on it personally.

vlsi commented 2 years ago

I do not think parsing versions.properties is harder than calling Gradle though.

jmfayard commented 2 years ago

With manual parsing, dependabot can't know that the key version.kotest is meant for io.kotest:kotest-.*:*

yschimke commented 2 years ago

nit: Is dependabot a generic term? I thought it and renovate were different products? Hopefully the solution could be adapted for both.

vlsi commented 2 years ago

With manual parsing, dependabot can't know that the key version.kotest is meant for io.kotest:kotest-.:

Oh, I missed aliases.

jmfayard commented 2 years ago

Also FYI @yschimke they don't support versions catalogs https://github.com/dependabot/dependabot-core/issues/3121

yschimke commented 2 years ago

OK.

Heres a renovate PR for it https://github.com/square/okhttp/pull/7386

jmfayard commented 2 years ago

Ah the issue is resolved then. Then it works with refreshVersions too, we don't do anything special.

simonbasle commented 2 years ago

nit: Is dependabot a generic term? I thought it and renovate were different products? Hopefully the solution could be adapted for both.

definitely not a generic term @yschimke. Dependabot and Renovate are two competitors (Dependabot doesn't indeed support version catalog Gradle feature).

also, did you link to the wrong PR in your last comment? I don't understand the relation with the current discussion (this is just an example of a Renovate PR) and I don't understand why @jmfayard comes to the conclusion the issue is resolved 🤔

yschimke commented 2 years ago

Yep, I confused everyone with a PR showing support for kts. Sorry for confusing this message.

I came here to file this bug upon seeing https://github.com/renovatebot/renovate/pull/16684/files which adds support for kts files.

The previous links to examples were from 2020, so thought a fresh sample of an integration could help.

I'll leave now...