forked from tibdex/backport
-
Notifications
You must be signed in to change notification settings - Fork 0
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
improve backport experience #7
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,7 +168,7 @@ const getFailedBackportCommentBody = ({ | |
}) => { | ||
const worktreePath = `.worktrees/backport-${base}`; | ||
return [ | ||
`The backport to \`${base}\` failed:`, | ||
`The backport to \`${base}\` failed at ${runUrl}:`, | ||
"```", | ||
errorMessage, | ||
"```", | ||
|
@@ -191,10 +191,22 @@ const getFailedBackportCommentBody = ({ | |
"# Delete the working tree", | ||
`git worktree remove ${worktreePath}`, | ||
"```", | ||
`Then, create a pull request where the \`base\` branch is \`${base}\` and the \`compare\`/\`head\` branch is \`${head}\`.`, | ||
`See ${runUrl} for more information.`, | ||
"Make sure to tag `@sourcegraph/release-guild` in the pull request description.", | ||
"Once the backport pull request is created, kindly remove the `release-blocker` from this pull request." | ||
"If you encouter conflict, first resolve the conflict and stage all files, then run the commands below:", | ||
"```bash", | ||
"git cherry-pick --continue", | ||
"# Push it to GitHub", | ||
`git push --set-upstream origin ${head}`, | ||
"# Go back to the original working tree", | ||
"cd ../..", | ||
"# Delete the working tree", | ||
`git worktree remove ${worktreePath}`, | ||
"```", | ||
"", | ||
"- [ ] Follow above instructions to backport the commit.", | ||
`- [ ] Create a pull request where the \`base\` branch is \`${base}\` and the \`compare\`/\`head\` branch is \`${head}\`., [click here to create the pull request](https://github.com/sourcegraph/sourcegraph/compare/${base}...${head}?expand=1).`, | ||
"- [ ] Make sure to tag `@sourcegraph/release-guild` in the pull request description.", | ||
"- [ ] Once the backport pull request is created, kindly remove the `release-blocker` from this pull request.", | ||
"", | ||
].join("\n"); | ||
}; | ||
|
||
|
@@ -205,7 +217,6 @@ const backport = async ({ | |
labelRegExp, | ||
payload, | ||
runId, | ||
runNumber, | ||
serverUrl, | ||
token, | ||
}: { | ||
|
@@ -233,7 +244,6 @@ const backport = async ({ | |
labelRegExp: RegExp; | ||
payload: PullRequestClosedEvent | PullRequestLabeledEvent; | ||
runId: number; | ||
runNumber: number; | ||
serverUrl: string; | ||
token: string; | ||
}): Promise<{ [base: string]: number }> => { | ||
|
@@ -303,7 +313,7 @@ const backport = async ({ | |
|
||
const title = getTitle({ base, number, title: originalTitle }); | ||
const merged_by = originalMergedBy?.login ?? ""; | ||
const runUrl = `${serverUrl}/${owner}/${repo}/actions/runs/${runId}/jobs/${runNumber}`; | ||
const runUrl = `${serverUrl}/${owner}/${repo}/actions/runs/${runId}`; | ||
Comment on lines
-306
to
+316
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this link is broken e.g., https://github.com/sourcegraph/sourcegraph/actions/runs/6123459521/jobs/15021 the job id is not exposed from the context, let's just go as far as the summary page of the workflow run it's good enough |
||
// PRs are handled sequentially to avoid breaking GitHub's log grouping feature. | ||
// eslint-disable-next-line no-await-in-loop | ||
await group(`Backporting to ${base} on ${head}.`, async () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just send people directly to the page to create the pr