Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/skills/backport-email/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: backport-email
description: Generate a backport email from a PR for sending to Tactics. Use when asked to create or generate a backport email.
---

# Backport Email Generation

Generate a formatted email for requesting backport approval from Tactics.

## Required Input

Ask the user for the **backport PR URL** if not provided. Example:
- `https://github.com/dotnet/runtime/pull/124058`

## Process

1. **Fetch the backport PR** using the GitHub MCP tools to get:
- PR number and title
- Target release branch (e.g., `release/9.0`)
- PR description (filled in from the `pr_description_template` in `.github/workflows/backport.yml`)
Comment on lines +18 to +20
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

This suggests the target branch is something like release/9.0, but servicing backports may target release/X.0-staging (see the notes in .github/workflows/backport.yml). Consider updating the example/wording to reflect that the base branch might include -staging.

Copilot uses AI. Check for mistakes.

2. **Read the email template** at `.github/skills/backport-email/templates/BACKPORT_EMAIL_TEMPLATE.md`

3. **Generate the email** by:
- Filling in the subject line with the release branch, PR title, and PR number
- Extracting the issue link and main PR link from the PR description
- Copying the PR description verbatim as the email body

## Output Format

Output the email as **plain text** (not markdown) since email clients don't render markdown.

```
Subject: [release/X.0] Backport request: <TITLE> (#<PR_NUMBER>)
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

The sample subject line here uses Subject: ... <TITLE> while .github/BACKPORT_EMAIL_TEMPLATE.md uses **Subject:** ... <BRIEF_DESCRIPTION>. Align the placeholder naming/format between the skill output example and the template to reduce ambiguity about what should be inserted (full PR title vs brief description).

Suggested change
Subject: [release/X.0] Backport request: <TITLE> (#<PR_NUMBER>)
Subject: [release/X.0] Backport request: <BRIEF_DESCRIPTION> (#<PR_NUMBER>)

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

The placeholder naming in the sample output uses <TITLE>, but the template file uses <BRIEF_DESCRIPTION>. Using consistent placeholder names across both files will reduce confusion when following the instructions.

Suggested change
Subject: [release/X.0] Backport request: <TITLE> (#<PR_NUMBER>)
Subject: [release/X.0] Backport request: <BRIEF_DESCRIPTION> (#<PR_NUMBER>)

Copilot uses AI. Check for mistakes.

Hello Tactics,

Please consider https://github.com/dotnet/runtime/pull/<PR_NUMBER> for backporting into release/X.0.
Comment on lines +34 to +38
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

The sample email hardcodes release/X.0 in the subject/body. Backport PRs may target release/X.0-staging, so this can generate an approval request for the wrong branch. Use a <TARGET_BRANCH> placeholder populated from the PR base branch instead of release/X.0.

Copilot uses AI. Check for mistakes.

Fixes https://github.com/dotnet/runtime/issues/<ISSUE_NUMBER>

main PR: <MAIN_PR_LINK>

<PR description verbatim>
```

## Important Notes

- **Do NOT attempt to open the email in Outlook or any email client.** Just output the formatted text for the user to copy.
- Copy the PR description verbatim — do not rewrite or restructure it.
- Extract the release branch version (e.g., `9.0`) from the PR's base branch.
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

The instructions say to extract the release branch version (e.g., 9.0) from the PR base branch, but that would drop a -staging suffix and can produce the wrong target (e.g., release/9.0 vs release/9.0-staging). Use the full base branch name as the target branch in the generated subject/body.

Copilot uses AI. Check for mistakes.
- If any section is missing from the PR description, note it and leave a placeholder.
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

There’s a contradiction between “Copy the PR description verbatim — do not rewrite or restructure it” and “If any section is missing from the PR description, note it and leave a placeholder.” If the PR description must be verbatim, missing-section placeholders should be added outside the verbatim block (or change the instruction to allow modifying the description).

Suggested change
- If any section is missing from the PR description, note it and leave a placeholder.
- If any section is missing from the PR description, note it in the email outside the copied PR description and leave a placeholder there.

Copilot uses AI. Check for mistakes.
20 changes: 20 additions & 0 deletions .github/skills/backport-email/templates/BACKPORT_EMAIL_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Backport Email Template
Copy link
Member

Choose a reason for hiding this comment

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

How much does the file name matter for copilot? Can the file be in a subdirectory and have a name that does not look like a special name recognized by github? (For example, the existing PULL_REQUEST_TEMPLATE is a special directory name that github knowns about.)

Copy link
Member Author

Choose a reason for hiding this comment

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

We could likely put this anywhere and tell the skill where to pick it up. It seemed 'better' to have this under .github since it's intended to work with the skill.

Copy link
Member

@jkotas jkotas Feb 7, 2026

Choose a reason for hiding this comment

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

intended to work with the skill.

Can this be a sub-directory in the skill directory? Like https://github.com/dotnet/runtime/tree/main/.github/skills/azdo-helix-failures

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I created a template folder and moved it into there.


Use this template when emailing Tactics to request approval for a backport to a release branch.
The body of the email should be the PR description verbatim (based on the `pr_description_template` in `.github/workflows/backport.yml`).

---

**Subject:** [release/X.0] Backport request: <BRIEF_DESCRIPTION> (#<PR_NUMBER>)
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

Although this file is Markdown, the template text is meant to be copied into an email as plain text. The **Subject:** markup will copy literally into the email; consider changing it to Subject: (and similarly avoid other Markdown-only formatting) so the template can be pasted directly without cleanup.

Suggested change
**Subject:** [release/X.0] Backport request: <BRIEF_DESCRIPTION> (#<PR_NUMBER>)
Subject: [release/X.0] Backport request: <BRIEF_DESCRIPTION> (#<PR_NUMBER>)

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

Placeholder naming is inconsistent between the skill (<TITLE>) and the template (<BRIEF_DESCRIPTION>), which makes it harder to follow both. Align on a single placeholder name across both files.

Suggested change
**Subject:** [release/X.0] Backport request: <BRIEF_DESCRIPTION> (#<PR_NUMBER>)
**Subject:** [release/X.0] Backport request: <TITLE> (#<PR_NUMBER>)

Copilot uses AI. Check for mistakes.

---

Hello Tactics,

Please consider https://github.com/dotnet/runtime/pull/<PR_NUMBER> for backporting into release/X.0.
Comment on lines +8 to +14
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

This subject line hardcodes release/X.0, but backport PRs can target release/X.0-staging. Use a <TARGET_BRANCH> placeholder (filled from the PR base branch) so the email targets the correct branch.

Suggested change
**Subject:** [release/X.0] Backport request: <BRIEF_DESCRIPTION> (#<PR_NUMBER>)
---
Hello Tactics,
Please consider https://github.com/dotnet/runtime/pull/<PR_NUMBER> for backporting into release/X.0.
**Subject:** [<TARGET_BRANCH>] Backport request: <BRIEF_DESCRIPTION> (#<PR_NUMBER>)
---
Hello Tactics,
Please consider https://github.com/dotnet/runtime/pull/<PR_NUMBER> for backporting into <TARGET_BRANCH>.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +14
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

This line hardcodes release/X.0, but the correct backport target can be release/X.0-staging. Use <TARGET_BRANCH> (from the PR base branch) here to avoid requesting approval for the wrong branch.

Suggested change
**Subject:** [release/X.0] Backport request: <BRIEF_DESCRIPTION> (#<PR_NUMBER>)
---
Hello Tactics,
Please consider https://github.com/dotnet/runtime/pull/<PR_NUMBER> for backporting into release/X.0.
**Subject:** [<TARGET_BRANCH>] Backport request: <BRIEF_DESCRIPTION> (#<PR_NUMBER>)
---
Hello Tactics,
Please consider https://github.com/dotnet/runtime/pull/<PR_NUMBER> for backporting into <TARGET_BRANCH>.

Copilot uses AI. Check for mistakes.

Fixes https://github.com/dotnet/runtime/issues/<ISSUE_NUMBER>

main PR: <MAIN_PR_LINK>

<Copy the PR description verbatim>