-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add build-duty skill for PR triage across dotnet repos #53311
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,232 @@ | ||||||||||||
| --- | ||||||||||||
| name: build-duty | ||||||||||||
| description: Generate a build duty PR triage report across dotnet/sdk, dotnet/installer, dotnet/templating, and dotnet/dotnet repositories. Use when asked about "build duty", "triage PRs", "build duty report", "merge queue", "dependency PRs", "what PRs need merging", "build duty status", or "check open PRs for build duty". | ||||||||||||
| --- | ||||||||||||
|
|
||||||||||||
| # Build Duty PR Triage | ||||||||||||
|
|
||||||||||||
| Monitor and classify pull requests across .NET SDK repositories for build duty engineers. Produces a structured triage report with PR status, age, classification, and failure details. | ||||||||||||
|
|
||||||||||||
| > 🚨 **NEVER** use `gh pr merge` or approve PRs automatically. Merging and approval are human-only actions. This skill only generates reports. | ||||||||||||
|
|
||||||||||||
| **Workflow**: Run the script (Step 1) → Read the output + JSON summary (Step 2) → Investigate failing PRs with ci-analysis (Step 3) → Synthesize the final report (Step 4). | ||||||||||||
|
|
||||||||||||
| ## When to Use This Skill | ||||||||||||
|
|
||||||||||||
| Use this skill when: | ||||||||||||
| - Checking build duty status ("what PRs need merging?", "build duty report") | ||||||||||||
| - Triaging automated PRs across dotnet repos | ||||||||||||
| - Generating a daily build duty triage report | ||||||||||||
| - Checking if dependency update or codeflow PRs are ready to merge | ||||||||||||
| - Asked "what's the merge queue look like?" or "any stuck PRs?" | ||||||||||||
|
|
||||||||||||
| ## Quick Start | ||||||||||||
|
|
||||||||||||
| ```powershell | ||||||||||||
| # Full report across all 4 repos | ||||||||||||
| ./.claude/skills/build-duty/scripts/Get-BuildDutyReport.ps1 | ||||||||||||
|
|
||||||||||||
| # Report for specific repos only | ||||||||||||
| ./.claude/skills/build-duty/scripts/Get-BuildDutyReport.ps1 -IncludeRepo sdk,installer | ||||||||||||
|
|
||||||||||||
| # JSON-only output | ||||||||||||
| ./.claude/skills/build-duty/scripts/Get-BuildDutyReport.ps1 -OutputJson | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ## Key Parameters | ||||||||||||
|
|
||||||||||||
| | Parameter | Description | | ||||||||||||
| |-----------|-------------| | ||||||||||||
| | `-IncludeRepo` | Filter to specific repos: `sdk`, `installer`, `templating`, `dotnet` (default: all 4) | | ||||||||||||
| | `-DaysStale` | Days after which a PR is flagged stale (default: 7) | | ||||||||||||
| | `-OutputJson` | Emit only JSON (no human-readable tables) | | ||||||||||||
| | `-Verbose` | Show individual `gh` API calls for debugging | | ||||||||||||
|
|
||||||||||||
| ## What the Script Does | ||||||||||||
|
|
||||||||||||
| 1. **Queries 4 repositories** via `gh` CLI for open PRs from monitored authors: | ||||||||||||
| - `dotnet-maestro[bot]` — Dependency updates and codeflow PRs | ||||||||||||
| - `github-actions[bot]` — **Only** inter-branch merge PRs (titles containing "Merge branch"); excludes backport PRs | ||||||||||||
| - `vseanreesermsft` — Release management PRs | ||||||||||||
| - `dotnet-bot` — Automated bot PRs | ||||||||||||
|
|
||||||||||||
| 2. **Applies special VMR filtering** for `dotnet/dotnet`: Only includes PRs from `dotnet-maestro[bot]` whose titles reference SDK-owned repos (`dotnet/sdk`, `dotnet/templating`, `dotnet/deployment-tools`, `dotnet/source-build-reference-packages`). | ||||||||||||
|
|
||||||||||||
| 3. **Fetches detailed status** for each PR via GitHub GraphQL: | ||||||||||||
| - `mergeStateStatus` (CLEAN, BLOCKED, UNSTABLE) | ||||||||||||
| - `statusCheckRollup` (SUCCESS, FAILURE, PENDING) | ||||||||||||
| - `reviewDecision` (APPROVED, CHANGES_REQUESTED, REVIEW_REQUIRED) | ||||||||||||
| - Labels, age, draft status | ||||||||||||
|
|
||||||||||||
| 4. **Classifies each PR** into categories (see below). | ||||||||||||
|
|
||||||||||||
| 5. **Outputs** both human-readable tables and a `[BUILD_DUTY_SUMMARY]` JSON block. | ||||||||||||
|
|
||||||||||||
| ## PR Classification Categories | ||||||||||||
|
|
||||||||||||
| ### ✅ Ready to Merge | ||||||||||||
| PRs where: | ||||||||||||
| - `mergeStateStatus` is `CLEAN` or `UNSTABLE` (non-required checks failing is still mergeable) | ||||||||||||
| - No blocking labels (`DO NOT MERGE`, `Branch Lockdown`) | ||||||||||||
| - Not a draft PR | ||||||||||||
|
|
||||||||||||
| **Action:** These can be merged immediately by the build duty engineer. | ||||||||||||
|
|
||||||||||||
| ### 🔒 Branch Lockdown | ||||||||||||
| PRs where: | ||||||||||||
| - Has `Branch Lockdown` label | ||||||||||||
| - Expected during servicing windows | ||||||||||||
|
|
||||||||||||
| **Action:** Queue for merge when lockdown lifts. No investigation needed. | ||||||||||||
|
|
||||||||||||
| ### ⚠️ Changes Requested | ||||||||||||
| PRs where: | ||||||||||||
| - `reviewDecision` is `CHANGES_REQUESTED` | ||||||||||||
| - Reviewer name is included in the report | ||||||||||||
|
|
||||||||||||
| **Action:** Requires action from PR author or upstream team. Note which reviewer requested changes. | ||||||||||||
|
|
||||||||||||
| ### ❌ Failing / Blocked | ||||||||||||
| PRs where: | ||||||||||||
| - `mergeStateStatus` is `BLOCKED` | ||||||||||||
| - Or `statusCheckRollup` is `FAILURE` or `PENDING` | ||||||||||||
| - Or has `DO NOT MERGE` label | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+97
to
+99
|
||||||||||||
| - Or `statusCheckRollup` is `FAILURE` or `PENDING` | |
| - Or has `DO NOT MERGE` label | |
| - Or has `DO NOT MERGE` label | |
| > Note: Classification here relies on GitHub's `mergeStateStatus` and labels. Individual failing or pending status checks may not always cause a PR to be categorized as Failing / Blocked if GitHub still reports `mergeStateStatus` as `CLEAN`. |
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 skill doc describes
-DaysStale,-OutputJson, and-Verbose, but the script also defines-SkipCIDetailsand documents it in the script help. Consider documenting-SkipCIDetailshere as well (or removing it from the script) to keep the user-facing instructions complete and consistent.