dropbox / dependency-guard

A Gradle plugin that guards against unintentional dependency changes.
Apache License 2.0
406 stars 15 forks source link

Can there be an option to auto-rebaseline after failure? #14

Open handstandsam opened 2 years ago

qwert2603 commented 1 year ago

Hi! At first glance it looks useful to get rid of extra actions the user needs to do to re-baseline dependencies:

But, on the other hand, if "auto-rebaseline" will be in gradle's plugin configuration and everything will be done automatically, it will be implicit and less transparent. It will be easy to forget to commit updated baselines to git after auto-rebaseline. In such case it will be unclear, why build is successful on local machine, but fails on CI.

There could be a build flag to explicitly specify that baselines must be updated in case of error. Also there could be corresponding message in build log after auto-rebaseline.

./gradlew :app:assembleDebug --dependency-guard-auto-rebaseline

Another question — should all the baselines in the project be updated in such case or only baselines in the module being build?

Actually, the most explicit way is to get build error and re-baseline manually. It won't take a lot of time, especially with configuration cache enabled, because re-baselining itself takes less than 1 second even on the large-scale project. And the command to re-baseline is listed in the build error.