-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add issue-triage skill from PureWeen/maui PR #9 #33327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PureWeen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot we don't want to hard code SR3, SR4 and servicing. SR3 and SR4 will change every month we have a new milestone every month so you'll need to just query current milestones to know what milestone to suggest for issues, these values can't be hardcoded
Updated in 643b230. The milestone suggestion logic now queries current milestones dynamically from dotnet/maui using |
There was a problem hiding this 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 an issue-triage skill from PureWeen/maui PR #9 to help triage open GitHub issues that need milestones, labels, or investigation. The skill provides three PowerShell scripts that work together to initialize triage sessions, query untriaged issues with intelligent filtering, and track triage decisions. The milestone suggestion logic dynamically queries current milestones from the dotnet/maui repository to avoid hardcoding service release (SR) milestones that change monthly.
Key Changes
- Skill definition: Provides workflow documentation, trigger phrases, and milestone suggestion logic for the issue triage process
- PowerShell scripts: Three scripts for initializing sessions, querying issues with filters, and recording triage decisions
- Copilot integration: Adds the skill to the Reusable Skills section in Copilot instructions for direct invocation or use by agents
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
.github/skills/issue-triage/SKILL.md |
Documents the triage workflow, milestone suggestion logic, script parameters, and usage examples for the issue-triage skill |
.github/skills/issue-triage/scripts/init-triage-session.ps1 |
Initializes triage sessions by fetching current milestones and labels from dotnet/maui, creating a session tracker file |
.github/skills/issue-triage/scripts/query-issues.ps1 |
Queries open issues needing triage with platform/area/age filters, fetches linked PRs via GraphQL, suggests milestones dynamically |
.github/skills/issue-triage/scripts/record-triage.ps1 |
Records triage decisions (milestone, labels) to the session tracker and updates statistics |
.github/copilot-instructions.md |
Adds "Reusable Skills" section documenting the issue-triage skill with trigger phrases and script references |
| "android" = "platform/android 🤖" | ||
| "ios" = "platform/iOS 🍎" | ||
| "windows" = "platform/windows 🪟" | ||
| "maccatalyst" = "platform/macOS 🍏" |
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The platform label for macOS appears to use "macOS" emoji (🍏) rather than "macCatalyst" to match the ValidateSet parameter value "maccatalyst". This could cause confusion since the parameter is "maccatalyst" but the label mapping key and display text suggest "macOS". Consider whether this should be "macCatalyst" consistently or if there's a specific reason for the naming difference.
| "maccatalyst" = "platform/macOS 🍏" | |
| "maccatalyst" = "platform/macCatalyst 🍏" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The label platform/macOS 🍏 is the actual label name in dotnet/maui. Changing it to platform/macCatalyst 🍏 would break the script since that label doesn't exist in the repo. The parameter is maccatalyst for user convenience, but it correctly maps to the actual GitHub label.
| } | ||
|
|
||
| $labelNames = ($issue.labels | ForEach-Object { $_.name }) -join ", " | ||
| $platformLabel = ($issue.labels | Where-Object { $_.name -like "platform/*" } | Select-Object -First 1)?.name ?? "unknown" |
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional access operator syntax '?.name' is not supported in PowerShell 5.1 (the default on Windows). This syntax was introduced in PowerShell 7.0. If this script needs to run on systems with PowerShell 5.1, this will cause a syntax error. Consider using a more compatible approach like checking if the property exists before accessing it, or document that PowerShell 7+ is required.
| # Update stats | ||
| switch -Regex ($Milestone) { | ||
| "Backlog" { $session.Stats.Backlog++ } | ||
| "Servicing" { $session.Stats.Servicing++ } |
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern in the switch statement will match "Servicing" anywhere in the milestone name because it lacks anchors. For example, a milestone named "Pre-Servicing" would incorrectly increment the Servicing counter. Consider using a more specific pattern like '^.*Servicing$' or checking for exact match if "Servicing" should only match milestones ending with that word.
| "Servicing" { $session.Stats.Servicing++ } | |
| "^Servicing$" { $session.Stats.Servicing++ } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested fix ^Servicing$ would break the script - actual milestones are named .NET 10 Servicing, not just Servicing. The current pattern works correctly for dotnet/maui's established milestone naming conventions which are stable.
| $linkedPRs += [PSCustomObject]@{ | ||
| Number = $pr.number | ||
| Title = $pr.title | ||
| State = $pr.state | ||
| URL = $pr.url | ||
| Milestone = $pr.milestone?.title ?? "" |
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional access operator syntax '?.name' and '?.title' is not supported in PowerShell 5.1. This will cause syntax errors on systems running the default Windows PowerShell version. Consider using null checks with if statements or document that PowerShell 7+ is required.
| $linkedPRs += [PSCustomObject]@{ | |
| Number = $pr.number | |
| Title = $pr.title | |
| State = $pr.state | |
| URL = $pr.url | |
| Milestone = $pr.milestone?.title ?? "" | |
| $milestoneTitle = "" | |
| if ($pr.milestone -and $pr.milestone.title) { | |
| $milestoneTitle = $pr.milestone.title | |
| } | |
| $linkedPRs += [PSCustomObject]@{ | |
| Number = $pr.number | |
| Title = $pr.title | |
| State = $pr.state | |
| URL = $pr.url | |
| Milestone = $milestoneTitle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above - these scripts require PowerShell 7+ via the shebang. The ?. operator is intentionally used.
| @@ -0,0 +1,116 @@ | |||
| #!/usr/bin/env pwsh | |||
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shebang line has incorrect spacing. PowerShell shebangs should be '#!/usr/bin/env pwsh' without extra spaces. The current format with spaces after '#' may not be recognized correctly by some systems.
| Stats = @{ | ||
| Total = 0 | ||
| Backlog = 0 | ||
| Servicing = 0 | ||
| SR = 0 | ||
| Skipped = 0 | ||
| } |
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Stats object is accessed as a hashtable with '@{}' syntax but accessed with dot notation later. PowerShell PSCustomObject properties should use consistent syntax. Consider using a PSCustomObject instead of a hashtable for the Stats property to match how it's accessed elsewhere, or ensure consistent bracket notation access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PowerShell hashtables support dot notation access, so this works correctly. While using [PSCustomObject] would be more consistent stylistically, the current code functions as expected.
| @@ -0,0 +1,203 @@ | |||
| #!/usr/bin/env pwsh | |||
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shebang line has incorrect spacing. PowerShell shebangs should be '#!/usr/bin/env pwsh' without extra spaces. The current format with spaces after '#' may not be recognized correctly by some systems.
| @@ -0,0 +1,588 @@ | |||
| #!/usr/bin/env pwsh | |||
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shebang line has incorrect spacing. PowerShell shebangs should be '#!/usr/bin/env pwsh' without extra spaces. The current format with spaces after '#' may not be recognized correctly by some systems.
|
/rebase |
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
…vicing values Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
643b230 to
b77e761
Compare
Adds the issue-triage skill from PureWeen#9 to help triage open GitHub issues that need milestones, labels, or investigation. ## Changes - **`.github/skills/issue-triage/SKILL.md`** - Skill definition with workflow, trigger phrases, and milestone suggestion logic - **`scripts/init-triage-session.ps1`** - Initializes session with current milestones and labels from dotnet/maui - **`scripts/query-issues.ps1`** - Queries open issues with platform/area/age filters, fetches linked PRs, suggests milestones dynamically - **`scripts/record-triage.ps1`** - Tracks triaged issues in session file - **`.github/copilot-instructions.md`** - Added "Reusable Skills" section documenting the new skill ## Dynamic Milestone Detection Milestones are queried dynamically from dotnet/maui rather than being hardcoded (since SR milestones change monthly): - **SR milestones**: Identified by pattern `\.NET.*SR\d+`, sorted by due date to determine current/next SR - **Servicing milestone**: Identified by pattern `\.NET.*Servicing` - Suggestions use the dynamically discovered milestones based on issue characteristics (regressions → current SR, PRs → Servicing, etc.) ## Usage ```bash # Initialize triage session pwsh .github/skills/issue-triage/scripts/init-triage-session.ps1 # Query Android issues needing triage pwsh .github/skills/issue-triage/scripts/query-issues.ps1 -Platform android -Limit 20 # Record a triage decision pwsh .github/skills/issue-triage/scripts/record-triage.ps1 -IssueNumber 33272 -Milestone "Backlog" ``` Trigger phrases: "find issues to triage", "triage Android issues", "what issues need attention" <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > Create a PR for an issue-triage skill that uses the skill from here PureWeen#9. Just grab the issue-triage skill from this PR please </details> <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/dotnet/maui/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com> Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
Adds the issue-triage skill from PureWeen#9 to help triage open GitHub issues that need milestones, labels, or investigation.
Changes
.github/skills/issue-triage/SKILL.md- Skill definition with workflow, trigger phrases, and milestone suggestion logicscripts/init-triage-session.ps1- Initializes session with current milestones and labels from dotnet/mauiscripts/query-issues.ps1- Queries open issues with platform/area/age filters, fetches linked PRs, suggests milestones dynamicallyscripts/record-triage.ps1- Tracks triaged issues in session file.github/copilot-instructions.md- Added "Reusable Skills" section documenting the new skillDynamic Milestone Detection
Milestones are queried dynamically from dotnet/maui rather than being hardcoded (since SR milestones change monthly):
\.NET.*SR\d+, sorted by due date to determine current/next SR\.NET.*ServicingUsage
Trigger phrases: "find issues to triage", "triage Android issues", "what issues need attention"
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.