Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate cherry-picking workflow #5132

Open
mossheim opened this issue Aug 9, 2020 · 1 comment
Open

Automate cherry-picking workflow #5132

mossheim opened this issue Aug 9, 2020 · 1 comment

Comments

@mossheim
Copy link
Contributor

mossheim commented Aug 9, 2020

Motivation

related to #5129 , automating cherry-picking would save maintainers time, reduce confusion, and simplify the changelog and release processes.

Description of Proposed Feature

i think i've come up with a reasonable workflow. we'd adopt the following workflow:

  1. humans would label PRs with a special and temporary "to-cherry-pick" label at any point
  2. a python script in tools could be run by any maintainer at any time to generate a cherry-pick PR; permissions to add/remove labels would be necessary

using labels instead of a project board is mainly a safety step -- right now when you add a PR to a project board by default it goes into a special 'awaiting triage' state, and programmatically querying about the project won't return that PR. there's a risk of someone adding the PR to the board and it never gets noticed or gets noticed too late. presence of a label is a binary state, so there's no such risk.

Plan for Implementation

the script would do the following:

  1. filter the set of PRs for those that are (1) merged, and (2) labelled "to-cherry-pick" (optionally check that each of these PRs is against develop)
  2. get the associated commits from each PR (see farther down)
  3. sort the PRs in commit order (this will lead to fewer merge conflicts)
  4. cherrypick the contents of each PR onto a new branch
  5. make a PR to github with the new branch
  6. remove the "to-cherry-pick" label from the source PRs

the title and/or text of the PR should be something easily parsed by a script so that we can use it in #5129 .

we should probably also add an 'undo' script that closes the PR and adds back the labels, in case something goes wrong or one of the PRs shouldn't be cherry-picked.

EDIT: forgot to add my notes about how to get associated commits from a PR. i couldn't find a way to do it more easily than this:

  • if the merge commit has 1 parent, use just the merge commit (it was a squash)
  • if the merge commit has 2 parents, use the commits between it and its first parent, excluding the merge commit itself. this means selecting only "A" and "B" in the following mock commit graph:
* Merge 'topic/example' into 'develop'
|\
| * A
| * B
|/
* Merge 'topic/some-other-branch' into 'develop'
@mossheim mossheim self-assigned this Aug 9, 2020
@mossheim mossheim mentioned this issue Aug 9, 2020
@mossheim mossheim added this to the 3.12.0 milestone Nov 18, 2020
@mossheim mossheim removed their assignment Feb 10, 2021
@dyfer dyfer modified the milestones: 3.12.0, 3.13.0 May 2, 2021
@dyfer dyfer pinned this issue Aug 5, 2021
@dyfer
Copy link
Member

dyfer commented Aug 5, 2021

I'm pinning the issue for now, since we haven't fully addressed it for the 3.12 release

@joshpar joshpar modified the milestones: 3.13.0, future Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants