Renovate: Renovate bot should use project's gradle wrapper

Created on 21 Feb 2020  路  5Comments  路  Source: renovatebot/renovate

Describe the bug
"gradle --init-script renovate-plugin.gradle renovate" is executed with your own gradle instance (right now it's using a gradle with version 5.6.4). However, it should use the project wrapper to init this plugin (or al least the same version).

For example, Gradle Play publisher min gradle required version is is 6.2.
So if you have this plugin integrated, renovate bot will not work. Same issue if you use android-snapshot-publisher plugin

Did you see anything helpful in debug logs?

{
  "errMessage": "Command failed: docker run --rm -v \"/mnt/renovate/gh/**************\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -w \"/mnt/renovate/gh/*******\" renovate/gradle bash -l -c \"gradle --init-script renovate-plugin.gradle renovate\"\n\nFAILURE: Build completed with 2 failures.\n\n1: Task failed with an exception.\n-----------\n* Where:\nBuild file '/mnt/renovate/***********/app/build.gradle' line: 18\n\n* What went wrong:\nA problem occurred evaluating project ':app'.\n> Failed to apply plugin [id 'com.xmartlabs.snapshot-publisher']\n   > Android Snapshot Publisher's minimum Gradle version is at least Gradle 6.0 and yours is Gradle 5.6.4. Find the latest version at https://github.com/gradle/gradle/releases, then run './gradlew wrapper --gradle-version=$LATEST --distribution-type=ALL'.\n\n* Try:\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.\n==============================================================================\n\n2: Task failed with an exception.\n-----------\n* What went wrong:\nA problem occurred configuring project ':app'.\n> compileSdkVersion is not specified.\n\n* Try:\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.\n==============================================================================\n\n* Get more help at https://help.gradle.org\n\nBUILD FAILED in 3m 46s\n"
}

To Reproduce
Create a project and integrate android-snapshot-publisher plugin or gradle-play-publisher

gradle priority-2-important bug

Most helpful comment

Both options will work. However, In my opinion the first one makes me more sense. You create a project with gradle, it contains a wrapper to use, so I think we should use that wrapper.

Renovate knows that gradle is set up, and it try to apply a gradle plugin using the project gradle setup. So, from my point of view it should use the project gradle wrapper

All 5 comments

@matir91 can you create a (simple) public repo on github.com that reproduces the problem?

I've created this project, it has only two commits.

  1. The AS sample app initialization
  2. The plugin setup
    log.txt

Thanks. I think we detect/use the gradle wrapper when it's non-Docker, but ignore it when it's Docker. What would be the most fool-proof?

  1. Run with gradle wrapper within latest gradle image we have? or
  2. Work out what gradle image should be used and run it directly?

Both options will work. However, In my opinion the first one makes me more sense. You create a project with gradle, it contains a wrapper to use, so I think we should use that wrapper.

Renovate knows that gradle is set up, and it try to apply a gradle plugin using the project gradle setup. So, from my point of view it should use the project gradle wrapper

:tada: This issue has been resolved in version 19.151.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zephraph picture zephraph  路  3Comments

Flydiverny picture Flydiverny  路  4Comments

rarkins picture rarkins  路  3Comments

amilajack picture amilajack  路  3Comments

jycouet picture jycouet  路  4Comments