root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.61k stars 1.25k forks source link

[ci] Automatize the process of backporting #14889

Open vgvassilev opened 5 months ago

vgvassilev commented 5 months ago

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

ferdymercury commented 5 months ago

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

vgvassilev commented 5 months ago

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.

dpiparo commented 5 months ago

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?

vgvassilev commented 5 months ago

Why do we need to squash the commits?

dpiparo commented 5 months ago

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."

vgvassilev commented 5 months ago

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...

dpiparo commented 5 months ago

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.

pcanal commented 5 months ago

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.