karmann-dm / gradle-versions-plugin

Gradle plugin for automatic version management. Inspired by SemVer
MIT License
4 stars 0 forks source link

Silent failure of "git push" #6

Open Szer opened 3 years ago

Szer commented 3 years ago

This code swallow any exceptions and leave repo in weird state where task reports that tag assigend successfully, but it's not.

https://github.com/karmann-dm/gradle-versions-plugin/blob/ba3c8812f4f9dae1dfb5d328e2d851e2e8e875ac/src/main/java/com/karmanno/plugins/tasks/AssignTagTask.java#L27-L29

It could fail with multiple reasons, e.g. authentication, lack of git config, lack of remote, etc

My proposal is to delete try catch, if it breaks, let the user know that task failed and why. Therefore task will be in failed state which is expected

karmann-dm commented 3 years ago

Mitigated in https://github.com/karmann-dm/gradle-versions-plugin/releases/tag/2.0.0 version, push functionality has been removed, only tagging remained. For now you can just do git push --tags manually or within you CI tool. Will be re-developed in 2.0.1