Cosmos-sdk: Github Bot for companion backport PRs

Created on 19 Jan 2021  Â·  3Comments  Â·  Source: cosmos/cosmos-sdk

Summary


Add a Github bot that creates backport PRs for all PRs merged to master that have the backport/{branch} label.

Problem Definition

Our current backport policy (not yet documented, afaik) is to:

  • create a PR on master
  • label it with backport/{branch}, where {branch} is the long-living release branch
  • once that PR is merged in master, create a backport PR into the release/{branch} branch by cherry-picking the PR's squashed commit.
  • the {branch} release manager approves/rejects the backport PR

The 3rd step is not ideal:

  • we often forget to do it
  • we shouldn't require external contributors to do it

This leads to days (like today) where we backport 10+ PRs at once, which is intensive and error-prone.

Proposal

A Github bot that would create companion backport PRs.

This bot would:

  • watch for PRs with the backport/{branch} label
  • for each of those PRs that gets merged into master:

    • create a PR on the release/{branch} branch by cherry-picking the parent PR's squashed commit

    • add the correct milestone to the backport PR (optional, only do it if its easy)

Advantages:

  • save developers time by avoiding creating backport PRs
  • we won't forget any backport PRs (so we would avoid backport-intensive days, or mega cherry-pick PRs)

Disadvantages:

  • we might need to code this bot ourselves? Would be good to have a look at what exists out there.

cc @alessio @robert-zaremba


For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned
tooling

Most helpful comment

yea this would be awsome. Mergify can do this for us https://docs.mergify.io/actions.html#backport

All 3 comments

CC'ing @marbar3778 @jgimeno @helder-moreira

yea this would be awsome. Mergify can do this for us https://docs.mergify.io/actions.html#backport

Awesome! Also looks like there's a command for it that we could start using now I think https://docs.mergify.io/commands.html#backport. Although I'm not sure if this opens a PR or just cherry-picks and merges... Would be good to have a PR step in between.

Was this page helpful?
0 / 5 - 0 ratings