Conversation
There was a problem hiding this comment.
Pull request overview
Adds a reusable Copilot skill that documents and standardizes the repo’s backport workflow (via New-BCAppsBackport) for creating backport PRs from main to one or more releases/* branches, including preflight checks, per-branch ADO work item handling guidance, and optional auto-merge.
Changes:
- Introduces
.github/skills/backport-pr/SKILL.mddescribing the end-to-end backport procedure and conventions. - Documents per-branch ADO work item resolution as the default (with
-ReuseWorkItemas opt-in). - Includes recovery guidance for transient push failures and an optional auto-merge step.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $backportPr = gh pr list --repo microsoft/BCApps --state open --search "[$branch] in:title $pr in:body" --json number,body,url | ConvertFrom-Json | Select-Object -First 1 | ||
| if ($backportPr) { | ||
| $newBody = $backportPr.body -replace '\[\*\*Insert Work Item Number Here\*\*\]', $map[$branch] | ||
| gh pr edit $backportPr.number --repo microsoft/BCApps --body $newBody | ||
| } |
There was a problem hiding this comment.
The PR-body patch step finds the created backport PR via a broad gh pr list --search ... | Select-Object -First 1, which can select the wrong PR (or none) if multiple open PRs match the query or if GitHub search indexing lags. Consider filtering deterministically (e.g., include --base <branch> and/or match the exact title the script generates) and adding a small retry loop before editing the body.
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Updated in 8f63040: the PR lookup is now deterministic (--base + exact generated title match), includes a retry loop to handle indexing lag, and warns if no PR is found after retries. I also added a guard for missing source PR title before entering the loop.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/BCApps/sessions/852107e7-13ec-40ef-a8a6-0e85a9599f06 Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/BCApps/sessions/852107e7-13ec-40ef-a8a6-0e85a9599f06 Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Groenbech96
left a comment
There was a problem hiding this comment.
Love it. Could we put this in a marketplace so that is is opt in?
It's quite related to BCApps and the backporting tool that already exists. Not sure if placing it in a marketplace is worth it. |
That becomes an issue over time, as more and more skills we be added and forced on people that are working in BCApps. To keep it clean, a marketplace provides a repository you opt into and is available here in BCApps. I would suggest to add the the README and overview of the marketplace and how to install the plugin, what it does etc. |
Adds a reusable Copilot skill at
.github/skills/backport-pr/SKILL.mdthat automates backporting a PR frommainto one or morereleases/*branches.The skill wraps
New-BCAppsBackportfrombuild/scripts/CrossBranchPorting.psm1and codifies the conventions we follow when backporting:ghauth, PR mergeability (mergeCommit/potentialMergeCommit), target branch existence, clean working tree.-ReuseWorkItemmode is documented as opt-in only.git pushfailures we sometimes hit, so the agent doesn't restart the whole batch.gh pr merge --auto --squash) at the end.releases/*, blocked auto-merge, dirty worktree, etc.).Discoverable via trigger phrases: backport a PR, port to
releases/*, cherry-pick to a release branch, propagate a change to release branches.Generated from the workflow used to backport #7830 to the 27.* and 28.* branches (#7832, #7834–#7841).
AB#612711