root icon indicating copy to clipboard operation
root copied to clipboard

[ci] Automatize the process of backporting

Open vgvassilev opened this issue 1 year ago • 9 comments

Feature description

If we have a pull request against the master and it needs to be backported we should just add the right label and the bot should be able to do this.

The advantage of this approach is that is saves time but also makes sure that we do not push changes without pushing them on the master first.

It seems that there are tools that can do that already and we should "just" use it in our CI: https://github.com/marketplace/actions/backporting

Alternatives considered

No response

Additional context

No response

vgvassilev avatar Mar 06 '24 07:03 vgvassilev

Thanks for the suggestion. I am however unsure on how it should handle the release notes, as they are 'different files', not just versions of the same file. See discussion here: https://github.com/root-project/root/issues/14439

See also https://github.com/sorenlouv/backport

ferdymercury avatar Mar 06 '24 08:03 ferdymercury

Thanks for the suggestion. I am however unsure on how it should handle the release notes, as they are 'different files', not just versions of the same file. See discussion here: #14439

Most of the backports are fixes that are not probably worth mentioning in the release notes.

vgvassilev avatar Mar 06 '24 10:03 vgvassilev

Thanks for the proposal backed up by a concrete potential solution. I like the idea of having something automated that in case of problems, simply does nothing. One thing that changes though is the squashing. This is something to discuss. In your opinion, @vgvassilev , what do we loose by automatically squashing commits intended for backports?

dpiparo avatar Mar 06 '24 14:03 dpiparo

Why do we need to squash the commits?

vgvassilev avatar Mar 06 '24 16:03 vgvassilev

I was reading the doc of the action "It can backport rebased and merged pull requests with a single commit and squashed and merged pull requests."

dpiparo avatar Mar 07 '24 08:03 dpiparo

I was reading the doc of the action "It can backport rebased and merged pull requests with a single commit and squashed and merged pull requests."

Ah, ok, well. At that point if we want the bot to help us we should probably do 1 commit by PR for backports. Alternatively, we can implement our own logic - should be no more than 2-3 git commands...

vgvassilev avatar Mar 07 '24 09:03 vgvassilev

I think the squashing of commits is simply a change with respect to what is being done today, it's not negative or a regression per se. I even could see an advantage in having one backport per commit. A good item to be discussed in the team I guess, but this action could be really help us.

dpiparo avatar Mar 07 '24 13:03 dpiparo

Having different granularity of commits in the main branch and the backport branch may make it harder to do forensic. For example to find out if a change/commit is present in a specific branch or when it was introduced there.

pcanal avatar Mar 07 '24 21:03 pcanal

@pcanal just attempted to solve this issue but Copilot was not smart enough ;) Maybe we should look into https://github.com/marketplace/actions/backport-action

ferdymercury avatar Dec 05 '25 20:12 ferdymercury