Repository navigation
Add known-issue-history skill for analyzing Known Build Error failure rates - #10
Conversation
… rates New skill that reconstructs failure timelines for Known Build Error issues by querying the GitHub GraphQL userContentEdits API. The build-analysis bot periodically edits issue bodies with rolling hit count tables (24h/7d/1mo) -- this skill mines the edit history to detect individual failure events and group them into failure periods. Features: - Single issue analysis with failure timeline and period grouping - -ListActive mode to scan all open Known Build Error issues and rank by recent activity - -Since filter for date-range queries - -Json output for structured consumption by agents - Pagination support for issues with many edits Works across all dotnet repos that use Known Build Error issues (runtime, aspnetcore, sdk, roslyn, etc). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new known-issue-history skill to the dotnet-dnceng plugin to reconstruct historical “Known Build Error” failure timelines by mining GitHub issue body edit history via GraphQL userContentEdits.
Changes:
- Introduces
Get-KnownIssueHistory.ps1to analyze a single issue or scan active known issues and optionally emit a JSON summary block. - Adds skill documentation (
SKILL.md) and a deeper reference doc describing detection logic, interpretation, and limitations. - Updates CODEOWNERS to assign ownership for the new skill folder.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| plugins/dotnet-dnceng/skills/known-issue-history/scripts/Get-KnownIssueHistory.ps1 | New PowerShell implementation that queries userContentEdits and attempts to parse hit-count history into events/periods. |
| plugins/dotnet-dnceng/skills/known-issue-history/references/known-issue-history.md | Reference documentation explaining the approach and how to interpret results. |
| plugins/dotnet-dnceng/skills/known-issue-history/SKILL.md | Skill metadata + usage documentation for the agent/skill catalog. |
| .github/CODEOWNERS | Adds code ownership entry for the new skill directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@lewing general issue but I think we should put a little stub skill in repos like runtime to find this? I nearly put it in there but I knew that would be wrong.. |
…CODEOWNERS - Increase labels(first: 10) to first: 100 to avoid missing label on issues with many labels - Add AssumeUniversal to -Since date parsing for deterministic UTC filtering - Warn when -MaxIssues exceeds GitHub API per_page limit of 100 - Add @lewing as second CODEOWNER (CI requires 2+ individuals) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
this I think is a repo configuration thing for branch in forks @lewing?
|
Addresses validate-structure warning about missing sequenced procedures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add sort=updated&direction=desc to ListActive API call so recently-active issues are fetched first - Use Write-Host for JSON output to keep all output on same stream Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The "right" way to do this I guess is to hook something up to query the Build analysis Kusto. But that seems a potential pit of wiring and infra and perms when this simple trick works well enough for now. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Ugh it made another PR |
…k, throw on errors - Add [ValidateRange(1,100)] to -MaxIssues parameter - Use regex validation in Split-Repository to reject unexpected characters - Add explicit gh auth status check before API calls - Use throw instead of Write-Error (consistent with ErrorActionPreference=Stop) - Remove dead MaxIssues cap code (now handled by ValidateRange) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add explicit Get-Command gh check before gh auth status for a clearer error when the CLI is missing - Switch SKILL.md description to folded YAML scalar style for readability Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Check for GraphQL errors array before accessing data (avoids misleading 'Issue not found' when the real error is permissions/repo not found) - Cap ListActive pagination to 5 pages (500 edits) per issue to avoid thousands of API calls when scanning many issues Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@matouskozak look OK can we merge? I'm using it already -- but out of the PR... |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When -Since is specified, Format-Timeline now labels failure event and period counts with '(since ...)' and shows all-time totals separately. Build-JsonSummary includes both filtered and total counts, plus the sinceFilter value, so JSON consumers know when data is filtered. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary and failure period tables now show clean yyyy-MM-dd dates instead of raw timestamps. Detailed timeline keeps full timestamps. ListActive now skips items with a pull_request field to avoid querying PRs that happen to have the Known Build Error label. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
|
||
| ## Key Parameters | ||
|
|
||
| | Parameter | Description | |
There was a problem hiding this comment.
Not sure if we care too much about this as a scenario, but the case where someone amends the tracking blob will throw this off quite a bit.
| @@ -0,0 +1,77 @@ | |||
| # Known Issue History Analysis | |||
There was a problem hiding this comment.
Is there something this doc is trying to add that the main skill file doesn't already hint at?
matouskozak
left a comment
There was a problem hiding this comment.
LGTM, I would try to reduce the duplicate information between the two .md files before merging.
|
|
||
| ### Interpreting Output | ||
|
|
||
| **Failure periods** show clusters of failures. A test with many short periods is intermittently flaky. A test with one long period had a sustained regression. |
There was a problem hiding this comment.
This is going to be mostly true for main where pipelines run every day. However, on servicing branches, we sometimes have KBE issues that only hit once a week as the frequency of pipeline runs is much lower.
That said, I don't think this will cause too much trouble and it is probably better to keep it simple this way.
| ### Failure Periods | ||
|
|
||
| Consecutive failure events are grouped into periods. A period starts when 24h goes from 0→N and ends when all counts return to 0. | ||
|
|
||
| - **Many short periods** → intermittently flaky test | ||
| - **One long period** → sustained regression | ||
| - **Peak 24h count** → severity indicator (1 = occasional, higher = frequent across builds) | ||
|
|
||
| ### Triage Guidelines | ||
|
|
||
| | Days Since Last Failure | Status | Action | | ||
| |------------------------|--------|--------| | ||
| | 0-7 | Actively failing | Needs investigation | | ||
| | 7-30 | Recently active | Monitor | | ||
| | 30-90 | Dormant | Consider closing | | ||
| | 90+ | Likely fixed | Recommend closing | |
There was a problem hiding this comment.
I think this is duplicated in known-issue-history.md
There is actually quite a few sections which are duplicated.
|
@copilot address feedback |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| } | ||
| elseif ($inFailure -and $entry.Event -ne 'all_clear') { | ||
| # Non-failure update within a period — track peak counts as they decay |
There was a problem hiding this comment.
This inline comment says "track peak counts as they decay", but the code only updates PeakHit1mo when the value increases (i.e., it tracks a peak, not decay). Please update the comment to match the behavior, or adjust the logic if you intended to capture something other than the maximum.
| # Non-failure update within a period — track peak counts as they decay | |
| # Non-failure update within a period — maintain peak 1-month hit count |
Add known-issue-history skill
Note
This PR description was AI/Copilot-generated.
Summary
Adds a new
known-issue-historyskill to thedotnet-dncengplugin that reconstructs basic failure timelines for "Known Build Error" issues without needing Kusto access.Problem
The build-analysis bot maintains rolling hit count tables (24h/7d/1mo) in Known Build Error issue bodies, but there's no way to see historical failure rates or answer "when did this test last fail?" The rolling windows hide the full history.
Solution
A PowerShell script that queries the GitHub GraphQL
userContentEditsAPI to mine the edit history of these issues. Each time the build-analysis bot edits the hit counts, it creates a snapshot. By tracking when the 24-hour count transitions from 0 to a positive value, the script detects individual failure events and groups them into failure periods.Features
-IssueNumber 100088) — full failure timeline with period grouping, peak counts, days since last failure-ListActive) — scans all open Known Build Error issues and ranks by recent activity-Since 2025-01-01) — focus on recent history-Json) — structured[KNOWN_ISSUE_HISTORY]block for agent consumptionExample output
Files
plugins/dotnet-dnceng/skills/known-issue-history/SKILL.md— skill metadata and documentationplugins/dotnet-dnceng/skills/known-issue-history/scripts/Get-KnownIssueHistory.ps1— analysis scriptplugins/dotnet-dnceng/skills/known-issue-history/references/known-issue-history.md— reference doc.github/CODEOWNERS— added ownership entry