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

Support for Renovate Bot #207

Open
miikeat opened this issue Jul 21, 2020 · 21 comments
Open

Support for Renovate Bot #207

miikeat opened this issue Jul 21, 2020 · 21 comments
Labels
help wanted Extra attention is needed

Comments

@miikeat
Copy link

miikeat commented Jul 21, 2020

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
Copy link
Member

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
Copy link
Member

jmfayard commented Sep 3, 2020

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

@jmfayard jmfayard added the help wanted Extra attention is needed label Sep 3, 2020
@miikeat
Copy link
Author

miikeat commented Sep 27, 2020

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

@jmfayard
Copy link
Member

jmfayard commented Sep 27, 2020

I had a look at what Renovate Bot here galacticcouncil/substrate-api-explorer#114 and here mulesoft/mule-migration-assistant#406

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

  • detect whether the file versions.properties exist
  • if yes, run $ ./gradle refershVersions
  • then read, analyse and write the file versions.properties.

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
Copy link
Member

@vlsi
Copy link

vlsi commented Oct 14, 2020

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

@yschimke
Copy link
Contributor

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
Copy link
Member

jmfayard commented Jul 28, 2022

@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
Copy link

vlsi commented Jul 28, 2022

@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
Copy link
Member

jmfayard commented Jul 28, 2022

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
Copy link
Contributor

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
Copy link
Member

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
Copy link

vlsi commented Jul 28, 2022

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

@jmfayard
Copy link
Member

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

@yschimke
Copy link
Contributor

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

@vlsi
Copy link

vlsi commented Jul 28, 2022

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

Oh, I missed aliases.

@jmfayard
Copy link
Member

Also FYI @yschimke they don't support versions catalogs
dependabot/dependabot-core#3121

@yschimke
Copy link
Contributor

yschimke commented Jul 28, 2022

OK.

Heres a renovate PR for it square/okhttp#7386

@jmfayard
Copy link
Member

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

@simonbasle
Copy link

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
Copy link
Contributor

yschimke commented Jul 28, 2022

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants