Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 30, 2025

Summary

This PR implements the /backport action command to automate the process of backporting merged pull requests to release branches.

Changes

GitHub Actions Workflow

Added a GitHub Actions workflow in .github/workflows/backport.yaml that:

  • Listens for issue comment events on pull requests
  • Integrates with the standard dotnet/arcade/.github/workflows/backport-base.yml@main workflow
  • Automatically handles /backport to <branch-name> commands
  • Creates backport PRs targeting the specified branch
  • Includes a link to the comment that requested the backport for context

Documentation

Added a "Backporting Changes" section to CONTRIBUTING.md that:

  • Explains how to use the /backport to <branch-name> command
  • Provides examples of the command usage
  • Lists available release branches (dev17.13.x, dev17.9.x, dev17.8.x, dev17.7.x, dev17.4.x, dev16.11.x)
  • Notes permission requirements (Write or Admin access)

Usage

Contributors can backport changes by commenting on a merged PR:

/backport to dev17.13.x

This will automatically create a new pull request targeting the dev17.13.x branch with the changes from the original PR. The backport PR will include a link back to the original comment that requested the backport.

Benefits

  • Streamlines the backporting process
  • Reduces manual effort and potential errors
  • Uses the battle-tested dotnet/arcade backport infrastructure
  • Provides a consistent workflow across dotnet repositories
  • Automatically handles branch targeting and PR creation
  • Maintains context by linking to the requesting comment

Fixes #9799

Original prompt

This section details on the original issue you should resolve

<issue_title>Set up /backport action command</issue_title>
<issue_description>## Summary

User Impact

</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #9799

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Set up /backport action command Set up /backport action command Sep 30, 2025
Copilot finished work on behalf of LittleLittleCloud September 30, 2025 21:54
@LittleLittleCloud LittleLittleCloud marked this pull request as ready for review October 1, 2025 02:32
@LittleLittleCloud LittleLittleCloud requested a review from a team as a code owner October 1, 2025 02:32
- Write
- Admin
then:
- backportPullRequest
Copy link
Member

Choose a reason for hiding this comment

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

Where is this command comes from

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The backportPullRequest command was part of the GitOps.PullRequestIssueManagement schema that I initially added to resourceManagement.yml. However, I've now reverted that approach.

Instead, the implementation now uses a GitHub Actions workflow (backport.yaml) that calls the standard dotnet/arcade backport workflow, which is a more established and reliable approach used across dotnet repositories. (7e7adfc)

@LittleLittleCloud
Copy link
Member

@copilot revert all other changes eexcept the backport.yaml

Copy link
Contributor Author

Copilot AI commented Oct 7, 2025

@copilot revert all other changes eexcept the backport.yaml

Reverted the changes to CONTRIBUTING.md and resourceManagement.yml. Only the backport.yaml workflow file remains. (7e7adfc)

@Copilot Copilot AI requested a review from LittleLittleCloud October 7, 2025 20:34
Copilot finished work on behalf of LittleLittleCloud October 7, 2025 20:34
@LittleLittleCloud
Copy link
Member

Keep the change in Contributing.md

Comment on lines 16 to 19
pr_description_template: |
Backport of #%source_pr_number% to %target_branch%
/cc %cc_users%
Copy link
Member

Choose a reason for hiding this comment

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

Wonder if we could include a link to the comment that requested this. Could be useful to have that context.

Copy link
Member

Choose a reason for hiding this comment

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

@copilot do what Drew suggested

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a link to the requesting comment in the backport PR description template using %source_pr_url%#issuecomment-%trigger_comment_id%. (Latest commit)

Copy link
Contributor Author

Copilot AI commented Oct 9, 2025

Keep the change in Contributing.md

Restored the CONTRIBUTING.md documentation that explains how to use the /backport command. (Latest commit)

Copilot finished work on behalf of LittleLittleCloud October 9, 2025 05:30
@LittleLittleCloud LittleLittleCloud enabled auto-merge (squash) October 9, 2025 05:43
@LittleLittleCloud LittleLittleCloud merged commit b2ecd5f into main Oct 9, 2025
6 checks passed
@LittleLittleCloud LittleLittleCloud deleted the copilot/fix-2068e180-0152-4e0d-97f1-640db7b92e2d branch October 9, 2025 05:46
@dotnet-policy-service dotnet-policy-service bot added this to the 18.1 milestone Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up /backport action command
3 participants