Skip to content

Commit ac55117

Browse files
TravisEz13Copilot
andauthored
Update backport prompt (PowerShell#26392)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 69770b2 commit ac55117

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

.github/prompts/backport-pr-to-release-branch.prompt.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,42 @@ Choose either tooling or Customer impact.
231231
- **Medium**: Changes non-critical features, adds new functionality, or modifies existing behavior
232232
- **Low**: Documentation, test-only changes, minor refactoring, or fixes with narrow scope
233233
- Justify your assessment based on the scope of changes and potential impact
234+
- **For CI/CD changes**: When backporting CI/CD infrastructure changes (workflows, build scripts, packaging), note in your justification that not taking these changes may create technical debt and make it difficult to apply future CI/CD changes that build on top of them. This doesn't change the risk level itself, but provides important context for why the change should be taken despite potentially higher risk
234235
235236
**If there were merge conflicts**:
236237
Add a note in the PR description after the Risk section describing what conflicts occurred and how they were resolved.
237238
238-
### Step 6: Clean up temporary files
239+
### Step 6: Add the CL label to the backport PR
239240
240-
After successful PR creation, clean up any temporary files created during the process:
241+
After creating the backport PR, add the same changelog label (CL-*) from the original PR to the backport PR:
242+
243+
```bash
244+
gh pr edit <backport-pr-number> --repo PowerShell/PowerShell --add-label "<original-cl-label>"
245+
```
246+
247+
Example: `gh pr edit 26389 --repo PowerShell/PowerShell --add-label "CL-BuildPackaging"`
248+
249+
This ensures the backport is properly categorized in the changelog for the release branch.
250+
251+
### Step 7: Update the original PR's backport labels
252+
253+
After successfully creating the backport PR, update the original PR to reflect that it has been backported:
254+
255+
```bash
256+
gh pr edit <original-pr-number> --repo PowerShell/PowerShell --add-label "Backport-<version>.x-Migrated" --remove-label "Backport-<version>.x-Consider"
257+
```
258+
259+
Example: `gh pr edit 26193 --repo PowerShell/PowerShell --add-label "Backport-7.5.x-Migrated" --remove-label "Backport-7.5.x-Consider"`
260+
261+
Notes:
262+
- If the original PR had `Backport-<version>.x-Approved` instead of `Consider`, remove that label
263+
- This step helps track which PRs have been successfully backported
264+
- The `Migrated` label indicates the backport PR has been created (not necessarily merged)
265+
- The `Done` label should only be added once the backport PR is merged
266+
267+
### Step 8: Clean up temporary files
268+
269+
After successful PR creation and labeling, clean up any temporary files created during the process:
241270

242271
```powershell
243272
Remove-Item pr*.diff -ErrorAction SilentlyContinue
@@ -253,6 +282,8 @@ Remove-Item pr*.diff -ErrorAction SilentlyContinue
253282
- [ ] If conflicts occurred, provided resolution summary to user
254283
- [ ] Branch pushed to origin
255284
- [ ] PR created with correct title format: `[<release-branch>] <original-title>`
285+
- [ ] CL label added to backport PR (matching original PR's CL label)
286+
- [ ] Original PR labels updated (added Migrated, removed Consider/Approved)
256287
- [ ] Temporary files cleaned up (pr*.diff)
257288
- [ ] PR body includes:
258289
- [ ] Backport reference: `Backport of (PR-number) to <release-branch>`
@@ -269,13 +300,13 @@ Remove-Item pr*.diff -ErrorAction SilentlyContinue
269300
270301
## 6 — Branch naming convention
271302
272-
**Format:** `backport-<pr-number>`
303+
**Format:** `backport/release/<version>/pr/<pr-number>`
273304
274305
Examples:
275-
- `backport-26193`
276-
- `backport-26334`
306+
- `backport/release/v7.5/pr/26193`
307+
- `backport/release/v7.4.1/pr/26334`
277308
278-
Note: Automated bot uses format `backport/release/v<version>/<pr-number>-<commit-hash>`, but manual backports use the simpler `backport-<pr-number>` format.
309+
Note: Automated bot uses format `backport/release/v<version>/<pr-number>-<commit-hash>`, but manual backports should use the format `backport/release/<version>/pr/<pr-number>` as shown above.
279310
280311
## 7 — Example backport PR
281312

0 commit comments

Comments
 (0)