Add manual backport instructions to backport failure comments#17488
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The new manual backport instructions don’t fully mirror the workflow’s required steps (notably the PR-head fetch and force-push behavior), which can cause the suggested manual commands to fail.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 3
- Review effort level: Lite
|
@copilot resolve the feedbacks from the review |
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Resolved in |
There was a problem hiding this comment.
🟡 Changes recommended
The new manual backport snippet currently has a couple of sharp edges (notably --body "..." readability with multi-line templates and git push --force in user-facing instructions) that can mislead users and create unnecessary risk.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
.github/workflows/backport-base.yml:169
backport_pr_descriptiondefaults to a multi-line template, so embedding it directly in--body "..."makes the snippet span multiple lines inside quotes, which is easy for users to misread/copy incorrectly. Consider switching the instructions to--body-file -with a quoted heredoc so the body is clearly multi-line and does not require shell escaping/expansion concerns.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
|
@copilot respond to the review feedback |
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Addressed in |
There was a problem hiding this comment.
🟢 Approval recommended
The change is localized to workflow messaging/templating and is low risk, with only a minor doc-accuracy tweak suggested in review comments.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
.github/workflows/backport-base.yml:152
- The manual backport snippet uses
git fetch origin refs/pull/.../headas a normal step, but the workflow treats this fetch as best-effort (warns and continues). If this fetch fails for a user (e.g., ref not available or permissions), they may stop even though they can still proceed withgit am. Consider making the snippet match the workflow by ignoring failures and/or adding a short note that it is optional.
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
- Review effort level: Lite
akoeplinger
left a comment
There was a problem hiding this comment.
One comment, LGTM otherwise
| '# 6. Open the backport pull request', | ||
| `gh pr create --base ${target_branch} --head ${temp_branch}${label_switches} \\`, | ||
| ` --title "${shell_escape(backport_pr_title)}" \\`, | ||
| ` --body "${shell_escape(backport_pr_description)}"`, |
There was a problem hiding this comment.
this will embed the quite large PR description (e.g. the full servicing template for dotnet/runtime) in the command shown to the user, I don't think that will be a nice UX :)
When the backport action fails (usually a merge conflict), the comment it posts contains only a failure notice and raw
git amoutput — enough for experienced users, but not a starting point for anyone who hasn't done a manual backport before.The failure comment now includes a step-by-step
How to backport manuallysection, placed after the failure message and before the (less interesting)<details>block with the command output.Changes
manual_backport_instructions(temp_branch, patch_file, git_am_command)renders a bash snippet mirroring what the workflow itself does: branch off the target branch, download the PR patch, run the samegit amcommand that failed, resolve conflicts, push, and open the PR.git amfailure, conflict-resolution command failure, and unresolved conflicts after resolution..replace(...)chains from the PR-creation path.Sample output for a conflicted backport to
release/9.0withpr_labels: Servicing-consider:To double check:
The repo has no test harness for workflow scripts. Validation was done by extracting the
Run backportscript and executing it under Node with mockedgithub/context/core/exec, covering thegit amfailure path (instruction rendering and escaping of quotes/$/backticks in the PR title) and the success path (PR still created with correct title, body, and labels after the template hoist).