Skip to content

Commit da96dd9

Browse files
committed
Broaden skill to CI status analysis, add job summary
- Update SKILL.md description to cover CI status checks, not just failures - Add trigger phrases: 'is CI passing', 'build status', 'ready to merge' - Add job summary in build output (e.g., '143 total: 142 passed, 1 failed') - Improve no-build-found message to explain CI hasn't been triggered
1 parent a9ea742 commit da96dd9

2 files changed

Lines changed: 33 additions & 7 deletions

File tree

.github/skills/azdo-helix-failures/SKILL.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
---
22
name: azdo-helix-failures
3-
description: Retrieve and analyze test failures from Azure DevOps builds and Helix test runs for dotnet repositories. Use when investigating CI failures, debugging failing PRs, or given URLs containing dev.azure.com or helix.dot.net.
3+
description: Analyze CI build and test status from Azure DevOps and Helix for dotnet repository PRs. Use when checking CI status, investigating failures, determining if a PR is ready to merge, or given URLs containing dev.azure.com or helix.dot.net.
44
---
55

6-
# Azure DevOps and Helix Failure Analysis
6+
# Azure DevOps and Helix CI Analysis
77

8-
Analyze CI test failures in Azure DevOps and Helix for dotnet repositories (runtime, sdk, aspnetcore, roslyn, and more).
8+
Analyze CI build status and test failures in Azure DevOps and Helix for dotnet repositories (runtime, sdk, aspnetcore, roslyn, and more).
99

1010
## When to Use This Skill
1111

1212
Use this skill when:
13+
- Checking CI status on a PR ("is CI passing?", "what's the build status?")
1314
- Investigating CI failures or checking why a PR's tests are failing
15+
- Determining if a PR is ready to merge based on CI results
1416
- Debugging Helix test issues or analyzing build errors
1517
- Given URLs containing `dev.azure.com`, `helix.dot.net`, or GitHub PR links with failing checks
16-
- Asked questions like "why is this PR failing", "analyze the CI failures", or "what's wrong with this build"
18+
- Asked questions like "why is this PR failing", "analyze the CI", "is CI green", or "what's the build status"
1719

1820
## Quick Start
1921

.github/skills/azdo-helix-failures/scripts/Get-HelixFailures.ps1

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ function Get-AzDOBuildIdFromPR {
381381
}
382382
}
383383
}
384-
throw "Could not find Azure DevOps build for PR #$PR in $Repository"
384+
throw "No CI build found for PR #$PR in $Repository — the CI pipeline has not been triggered yet"
385385
}
386386

387387
# Return all unique failing build IDs
@@ -1362,7 +1362,7 @@ function Get-HelixWorkItemDetails {
13621362
foreach ($file in $response.Files) {
13631363
if ($file.FileName -and $file.FileName -match '/') {
13641364
$encodedFileName = ($file.FileName -split '/' | ForEach-Object { [uri]::EscapeDataString($_) }) -join '/'
1365-
$file.Uri = "https://helix.dot.net/api/jobs/$JobId/workitems/$encodedWorkItem/files/$encodedFileName`?api-version=2019-06-17"
1365+
$file.Uri = "https://helix.dot.net/api/jobs/$JobId/workitems/$encodedWorkItem/files/$encodedFileName?api-version=2019-06-17"
13661366
}
13671367
}
13681368
}
@@ -2026,8 +2026,32 @@ try {
20262026
$totalFailedJobs += $failedJobs.Count
20272027
$totalLocalFailures += $localTestFailures.Count
20282028

2029+
# Compute job summary from timeline
2030+
$allJobs = @()
2031+
$succeededJobs = 0
2032+
$pendingJobs = 0
2033+
$canceledJobCount = 0
2034+
if ($timeline -and $timeline.records) {
2035+
$allJobs = @($timeline.records | Where-Object { $_.type -eq "Job" })
2036+
$succeededJobs = @($allJobs | Where-Object { $_.result -eq "succeeded" }).Count
2037+
$pendingJobs = @($allJobs | Where-Object { -not $_.result -or $_.state -eq "pending" -or $_.state -eq "inProgress" }).Count
2038+
$canceledJobCount = @($allJobs | Where-Object { $_.result -eq "canceled" }).Count
2039+
}
2040+
20292041
Write-Host "`n=== Build $currentBuildId Summary ===" -ForegroundColor Yellow
2030-
Write-Host "Failed jobs: $($failedJobs.Count)" -ForegroundColor Red
2042+
if ($allJobs.Count -gt 0) {
2043+
$parts = @()
2044+
if ($succeededJobs -gt 0) { $parts += "$succeededJobs passed" }
2045+
if ($failedJobs.Count -gt 0) { $parts += "$($failedJobs.Count) failed" }
2046+
if ($canceledJobCount -gt 0) { $parts += "$canceledJobCount canceled" }
2047+
if ($pendingJobs -gt 0) { $parts += "$pendingJobs pending" }
2048+
$jobSummary = $parts -join ", "
2049+
$summaryColor = if ($failedJobs.Count -eq 0 -and $pendingJobs -eq 0) { "Green" } elseif ($failedJobs.Count -gt 0) { "Red" } else { "Cyan" }
2050+
Write-Host "Jobs: $($allJobs.Count) total ($jobSummary)" -ForegroundColor $summaryColor
2051+
}
2052+
else {
2053+
Write-Host "Failed jobs: $($failedJobs.Count)" -ForegroundColor Red
2054+
}
20312055
if ($localTestFailures.Count -gt 0) {
20322056
Write-Host "Local test failures: $($localTestFailures.Count)" -ForegroundColor Red
20332057
}

0 commit comments

Comments
 (0)