-
Xilai Zhang authored
**design doc: go/easy-cp** umbrella design doc: go/flutter-actions umbrella bug: https://github.com/flutter/flutter/issues/139604 **Sample Results**: 1. If cherry pick succeeds, a pull request with cherry pick template and label is created. https://github.com/flutter/flutter/pull/139523 2. If cherry pick fails, a comment is added under the original Pull Request. https://github.com/flutter/cocoon/pull/3305 In tests, [7d9010](https://github.com/flutter/flutter/commit/7d9010c3578338bc850d66c315bd6086f3d3dc9a) was used to simulate a clean cherry pick, and [cf71a5](https://github.com/flutter/flutter/commit/cf71a55f7d1613dd1795c68cd799c18900caa39a) was used to simulate a merge conflict during cherry pick. **Implementation Details:** 1. triggered when 'cp: beta' or 'cp:stable' label is added to the original PR 4. parses release channel and gets release candidate branch name 5. get commit sha from event payload 6. checks out framework repo and revision history 7. Attempt a cherry pick without any resolution strategy 8. If cp is successful, uses a PR template to open a pull request. 9. If cp isn't successful, leave a comment on the original PR. **PR template** Since PR template doesn't support web form, the cherry pick PR template we used is https://github.com/XilaiZhang/miscellaneous-side-project/blob/master/.github/workflows/template/cherrypick.md, which is adapted from the [web form cherry pick issue template](https://cs.opensource.google/flutter/flutter/+/master:.github/ISSUE_TEMPLATE/7_cherry_pick.yml). This PR template should be reviewed and added to be under the .github path in framework repository. **Decisions Taken** 1. place of source code I put the source code under the framework repository. Acknowledges the risk of duplication of code, in favor of not needing to package and publish our own actions to market place. more details in [open discussions section of design doc](https://docs.google.com/document/d/1EUyJ9NCAltxJq3P3pIzIRVF2ArPUO4cj_eqIUvzl8cw/edit#heading=h.e3zrsz9gwxmp) 2. Resolution strategy No resolution strategy is applied at all during the cherry pick process. [more details](https://docs.google.com/document/d/1EUyJ9NCAltxJq3P3pIzIRVF2ArPUO4cj_eqIUvzl8cw/edit#heading=h.3za1b9qx6pi2) **Future Work** A PAT token is needed for authorization to create branch and add comment. We would need to create a new bot and update its credentials in the secrets section of flutter/flutter repository.