GitLab doesn't support low-level git API like GitHub, so currently we mark every PR as canRebase=false. But it would perhaps be desirable to close existing PR and create a replacement, instead of leaving the existing one as conflicted.
Cc @guumaster
Depends on your GitLab version, ut turns out that Gitlab EE has the feature, but its not exposed through the API.
In that case I guess we can't use it though? BTW I have been testing against the public gitlab.com myself
The public GitLab.com site is their Enterprise Edition.
For what it's worth, I would lean on the side of not using any specific EE features as there are a lot of non-profits out there using GitLab Community Edition, and they too may benefit from renovate.
With npm5 out and package-locks being a default feature this issue has become a whole lot more relevant.
So far my workflow to handle this manually has been to nuke the conflicting branch and re-running renovate which generates a new branch with the same name and links to the original PR. This is not perfect however as we lose an updated description and title in the case of newer versions of deps being added during this process.
If we can overcome that drawback automating the branch nuking may be a viable solution though.
What do you guys think?
we lose an updated description and title in the case of newer versions of deps being added during this process.
Could you give an example of this so I understand?
It would be a bit challenging to stage the scenario myself. But the steps to reproduce this naturally would be:
@Autre31415 Are you saying that in GitLab you can delete a branch and it does not automatically delete/close the MR?
If so then this behaviour differs from GitHub but that would be a good thing and help me solve the problem.
That is correct, and that has been my manual solution to dealing with this problem, with the only drawback being that the title and description will not update if the dependency has a newer version when the branch is remade. If that can be fixed then I think this is a good solution to handling this issue.
That's quite possibly the trick we need then.
So:
The strange thing is that (5) is meant to be the way things work already. If you're sure it's not - or was it just theoretical - then hopefully it can be fixed. FYI: renovate will check the MR title and description on every iteration and update it if the old one is outdated.
I can confirm through my own use of renovate that 2 and 4 are the case, with 5 being the only problem. I've been dealing with this problem since npm5 dropped and package-lock created merge conflicts galore.
The zombie MR will include a message that the branch was deleted, but will remain open with no changes or commits listed.
Thanks for the info. I think it can be fixed and the end result will hopefully be as elegant as the existing GitHub rebasing.
I'm looking into this now. I think an easy way to reproduce such a challenge in an empty repo is:
[email protected])Confirming how it looks to me when I delete the branch:

And after running renovate again it relinks:

Nearly done. You get a bit of "noise" in the "Discussion" area but otherwise it's quite elegant:

@Autre31415 please try renovate version 8.38.0 and let me know how it goes. It should automatically delete and recreate any branches that have got into unmergeable state (e.g. due to package-lock.json.
BTW in case you have "related" packages causing this problem (e.g. eslint and friends), consider having a package "group" to put them all into the same branch and avoid the merge/rebase/merge/rebase cycle when multiple are released at similar times.
Example: https://github.com/singapore/renovate/blob/master/package.json#L109-L118
馃帀 馃帀 馃帀 馃帀 馃帀 馃帀
I just tried it out and am happy to report that our merge conflicts are being handled properly now, and with updated descriptions. Awesome work!
Great news! Thanks for tip re: how GitLab let's you delete branches without automatically closing the MR - that was the whole reason why I couldn't do the same thing on GitHub and assumed the same for GitLab.
Also wanted to chime in and say what an awesome enhancement!
The extra discussion updates are a minor matter given the enormous benefit.
Most helpful comment
Thanks for the info. I think it can be fixed and the end result will hopefully be as elegant as the existing GitHub rebasing.