From d53d154b8a717bf5d0d89cd4bf29477f5253c1f6 Mon Sep 17 00:00:00 2001 From: Alice Zhao <66543449+alicelovescake@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:41:17 -0700 Subject: [PATCH] chore: update manual backport readme and trop comment with `e backport` command (#272) * docs: add docs on manual backport in readme and trop comment * docs: fix link --------- Co-authored-by: David Sanders --- docs/manual-backports.md | 6 +++++- src/utils.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/manual-backports.md b/docs/manual-backports.md index af7febd..9ba88ad 100644 --- a/docs/manual-backports.md +++ b/docs/manual-backports.md @@ -1,6 +1,6 @@ # Manual Backports -When `trop` fails to backport your PR (trust us it tried its best) you need to backport the PR manually. You can do this by cherry-picking the commits in the PR yourself locally and pushing up a new branch. +When `trop` fails to backport your PR (trust us it tried its best) you need to backport the PR manually. You can do this by cherry-picking the commits in the PR yourself locally and pushing up a new branch or using a [`build-tools` command](#build-tools-backport-command). When you create PR for a manual backport, the body of the backport PR must contain: @@ -23,6 +23,10 @@ Backport of https://github.com/electron/electron/pull/21813 If you raise a PR to a branch that isn't `main` or a release branch without including a valid reference as above, `trop` will create a "failed" check on that PR to prevent it being merged. +## Build Tools Backport Command + +You can use the `e backport ` command to backport PRs. [This command](https://github.com/electron/build-tools?tab=readme-ov-file#e-backport-pr) manually backports PRs by automating the steps above. + ## Skipping Backport Checks Sometimes development flows will necessitate a PR train, or several linked PRs to be merged into one another successively where none is a backport. To account for this case, `trop` allows for a label to be set on the non-backport PR: `SKIP_CHECK_LABEL`. diff --git a/src/utils.ts b/src/utils.ts index 955f454..dd6da9d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -726,7 +726,7 @@ export const backportImpl = async ( context.repo({ issue_number: pr.number, body: `I was unable to backport this PR to "${targetBranch}" cleanly; - you will need to perform this backport manually.`, + you will need to perform this [backport manually](https://github.com/electron/trop/blob/main/docs/manual-backports.md#manual-backports).`, }), );