georgberky / dependency-update-maven-plugin

A Maven plugin that creates merge requests for dependency updates.
Apache License 2.0
26 stars 9 forks source link

Update already existing branch with a dependency update #29

Open sparsick opened 3 years ago

sparsick commented 3 years ago

As developer, I want that if a branch already exists for a dependency and a new version of this dependency is found in Maven repository, then the plugin should rename and change the already existing branch to the new version.

Example:

We have already a branch for dependency A with version 1.0. This branch wasn't merged. Then the plugin finds a new version 1.1 for dependency A. Then the plugin should update the branch with dep A and version 1.0 to version 1.1.

sparsick commented 2 years ago

As discussed with @georgberky, if we have an open branch with dependency update, we will log a warning that a newer version is available, but the branch will not be updated. We want to encourage that the developers merge already existing branches first.

see new issue https://github.com/georgberky/dependency-update-maven-plugin/issues/43

bmarwell commented 2 years ago

Currently, the native git provider will throw:

[ERROR] fatal: a branch named 'dependency-update/org.slf4j-log4j-over-slf4j-2.0.0-alpha7' already exists

... but you do not capture stdErr to see this message:

[ERROR] Failed to execute goal io.github.georgberky.maven.plugins.depsupdate:dependency-update-maven-plugin:0.9.0-SNAPSHOT:update (default-cli) on project io: Execution default-cli of goal io.github.georgberky.maven.plugins.depsupdate:dependency-update-maven-plugin:0.9.0-SNAPSHOT:update failed: Native git invocation failed. Command: $HOME/.local/apps/homebrew/bin/git checkout -b dependency-update/org.slf4j-log4j-over-slf4j-2.0.0-alpha7, return value was: 128

To make it visible, replace Pair with Triple and also return stdout. And do not forget to add a Charset... PRs welcome?