Skip to content

Add a backport prompt for copilot#26383

Merged
TravisEz13 merged 6 commits intoPowerShell:masterfrom
TravisEz13:backport-prompt
Nov 5, 2025
Merged

Add a backport prompt for copilot#26383
TravisEz13 merged 6 commits intoPowerShell:masterfrom
TravisEz13:backport-prompt

Conversation

@TravisEz13
Copy link
Copy Markdown
Member

@TravisEz13 TravisEz13 commented Nov 5, 2025

Add Copilot prompt guide for backporting PRs to release branches

This PR introduces a comprehensive guide for GitHub Copilot to assist with backporting changes to PowerShell release branches. The prompt provides step-by-step instructions, best practices, and automated workflows for creating backport PRs.

What's Added

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

  • 536 lines of detailed guidance for backporting PRs
  • Structured workflow with 6 distinct steps
  • Real-world examples and troubleshooting guidance

Key Features

1. Automated PR Discovery

  • Search for PRs that need backporting using labels
  • Filter by version and triage state (Consider, Approved, Done)
  • Present sorted lists to users for selection

2. Pre-flight Checks

  • Verify PR is merged before attempting backport
  • Check for existing backport PRs to avoid duplicates
  • Interpret backport labels (Migrated, Done, Approved, Consider)
  • Extract PR metadata (merge commit SHA, author, CL labels)

3. Smart Conflict Resolution

  • Fetch and analyze original PR diffs before resolving conflicts
  • Identify conflict types (parameter changes, code removal, refactoring)
  • Context-aware resolution strategies that preserve release branch specifics
  • Automatic conflict summary generation for user review
  • Real-world example from PR Remove usage of fpm for DEB package generation #26281 showing parameter set handling

4. Structured PR Creation

  • Standardized title format: [release/v7.x] <original-title>
  • Complete PR body template with required sections:
    • Backport reference with auto-generated metadata
    • Impact assessment (Tooling vs Customer)
    • Regression information
    • Testing approach
    • Risk evaluation (High/Medium/Low with definitions)
  • Detailed guidelines for filling out each section

5. Manual Backport Tools

  • Documentation for Invoke-PRBackport PowerShell function
  • Bulk backporting with Invoke-PRBackportApproved
  • Backport reporting tools
  • Branch naming conventions (automated vs manual)

6. Cleanup and Validation

  • Automatic cleanup of temporary diff files
  • Comprehensive "Definition of Done" checklist
  • Best practices for testing and CI validation

Benefits

  • Consistency: Ensures all backport PRs follow the same format and include required information
  • Efficiency: Automates repetitive tasks like fetching PR info, creating branches, and formatting PR descriptions
  • Quality: Provides conflict resolution strategies and requires documentation of changes
  • Discoverability: Helps identify PRs that need backporting and checks for duplicates
  • Knowledge Sharing: Documents the backport process for both AI assistants and human maintainers

Testing

This prompt was tested by successfully backporting PR #26281 to the release/v7.4 branch, which included:

Related Work

  • Complements existing PowerShell release tools in tools/releaseTools.psm1
  • Aligns with documented release processes in docs/maintainers/releasing.md
  • Supports the existing automated backport bot (pwshBot) workflow

Note: This is a Copilot prompt file (.prompt.md) that GitHub Copilot can use when users ask for help with backporting. It doesn't affect the codebase directly but provides structured guidance for AI-assisted backporting tasks.

Copilot AI review requested due to automatic review settings November 5, 2025 01:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive documentation for backporting changes to PowerShell release branches. The guide is designed for AI models to assist maintainers with the backporting process.

  • Provides step-by-step instructions for manual and automated backporting workflows
  • Documents the use of PowerShell tools like Invoke-PRBackport for backporting PRs
  • Includes PR templates, naming conventions, and troubleshooting guidance

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/prompts/backport-pr-to-release-branch.prompt.md Outdated
Comment thread .github/prompts/backport-pr-to-release-branch.prompt.md Outdated
Comment thread .github/prompts/backport-pr-to-release-branch.prompt.md Outdated
Comment thread .github/prompts/backport-pr-to-release-branch.prompt.md Outdated
TravisEz13 and others added 4 commits November 5, 2025 09:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@TravisEz13 TravisEz13 added the CL-Docs Indicates that a PR should be marked as a documentation change in the Change Log label Nov 5, 2025
@TravisEz13 TravisEz13 self-assigned this Nov 5, 2025
@TravisEz13 TravisEz13 merged commit bf1c8ed into PowerShell:master Nov 5, 2025
36 of 37 checks passed
@TravisEz13 TravisEz13 deleted the backport-prompt branch November 5, 2025 17:20
SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request Dec 12, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
kilasuit pushed a commit to kilasuit/PowerShell that referenced this pull request Jan 2, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Docs Indicates that a PR should be marked as a documentation change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants