[Claude] Improve troubleshoot-ci-build skill with scripts and heuristics#8181
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
5ebe4df to
0d0113b
Compare
d432fad to
35dc707
Compare
35dc707 to
697bf66
Compare
troubleshoot-ci-build skill with scripts and heuristics
troubleshoot-ci-build skill with scripts and heuristicstroubleshoot-ci-build skill with scripts and heuristics
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0054b306bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Nice! Not for this PR, but I was thinking that we should have a single skill for CI analisys. Right now, we have this for Azure and the one from DD marketplace for gitlab and GH actions. It would be nice to have one for everything in our pipeline. I actually asked yesterday to Claude to generate one, but did not really test it or even review it: master...nacho/analyzeCiSkill |
This comment was marked as off-topic.
This comment was marked as off-topic.
eb560f0 to
7264897
Compare
BenchmarksBenchmark execution time: 2026-02-24 04:28:47 Comparing candidate commit 8b3c42a in PR branch Found 5 performance improvements and 15 performance regressions! Performance is the same for 156 metrics, 16 unstable metrics. scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1
scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472
scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1
scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0
scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark netcoreapp3.1
scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1
scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
|
Add PowerShell installation instructions and version requirements: - Minimum: PowerShell 5.1 (Windows built-in) - Recommended: PowerShell 7+ (cross-platform) - Always prefer pwsh over powershell.exe when available Add runtime version check to script with helpful error messages. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Remove -CompareWithMaster and -CompareWithBuild from the build analysis script and all skill docs. All tests are assumed to pass in master. Add single-runtime failure as a flaky test indicator (test fails on one runtime but passes on others). 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
When CI failures persist after retry, engineers should alert #apm-dotnet. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Replace Invoke-Expression with safe argument array and call operator to prevent command injection vulnerabilities in Azure CLI invocation. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Add structured context (Area, Resource, Exit Code) to API failures for easier debugging when calls fail. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Add regex patterns to detect additional test failure formats: - xUnit format: [xUnit.net ...] TestName [FAIL] - Stack traces: at Namespace.Class.Method() - Span count mismatches: Expected N spans but got M - Snapshot verification failures Improves test name extraction from CI error messages. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Add the complete command line to error output for easier debugging and manual reproduction of API failures. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
- Rename $args to $azArgs to avoid PowerShell automatic variable conflict - Split route parameters by whitespace into separate arguments The Azure CLI --route-parameters flag expects each parameter as a separate argument, not a single space-separated string. Passing "project=dd-trace-dotnet buildId=12345" as one argument caused authentication errors. Now splits into individual arguments: project=dd-trace-dotnet and buildId=12345 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Azure CLI's --route-parameters requires each key=value pair as a separate argument. Passing them as a single space-separated string causes misleading TF400813 authorization errors. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Based on analysis of recent failed builds (196072, 195867, 195830, etc.): - Add comma-separated xUnit pattern for profiler tests - Add crash block detection for bare test names after host crash - Remove stack trace pattern (extracted method names, not test names) Verified against builds with each pattern type. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Replace manual version validation with #Requires -Version 5.1 directive, which PowerShell enforces natively before execution. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Add Extract-BuildErrors function to capture compilation errors (CS, NU, NETSDK, etc.) and Nuke target exceptions. Add test host crash and framework-specific failure patterns to Extract-FailedTests. Wire new BuildErrors field into result object and table output. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Always return PSCustomObject to the pipeline and display the human-readable summary via Write-Host. Callers can pipe to ConvertTo-Json for JSON output. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Redirect stderr to a temp file instead of merging with stdout via 2>&1. Prevents az/gh CLI warnings from corrupting JSON output before ConvertFrom-Json parsing. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
Extract API reference and Windows CLI pitfalls to references/cli-reference.md, reducing SKILL.md from 634 to 413 lines. Remove redundant README.md and duplicate Supporting Files section. Make description more trigger-friendly. Remove disable-model-invocation. 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
- Add Bash(pwsh:*) to allowed-tools for auto-approval - Replace inline categorization rules with pointer to failure-patterns.md - Sharpen "load when" guidance for reference files - Condense output format template from ~70 to ~15 lines - Add table of contents to failure-patterns.md 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
- Remove stale scratchpad references in cli-reference.md - Remove redundant "Key Learnings" header in SKILL.md - Remove redundant curl/grep commands from failure-patterns.md 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
5bb3c9d to
8b3c42a
Compare
Summary of changes
Improves the
/troubleshoot-ci-buildskill by extracting analysis logic into a standalone PowerShell script, adding better failure heuristics, and detecting snapshot mismatches and build errors.Reason for change
master— comparison didn't add valueUpdateSnapshotsFromBuildwhen snapshot diffs are detected (vs span count mismatches which indicate deeper issues)Implementation details
PowerShell Script (
tracer/tools/Get-AzureDevOpsBuildAnalysis.ps1):-BuildIdor-PullRequest(mutually exclusive)-IncludeLogs, output formats:table(default) orjsonExtract-BuildErrors: CapturesCS/NU/NETSDK/etc compilation errors and Nuke target exceptions from logsExtract-FailedTests: Expanded patterns for xUnit, crash blocks, comma-separated profiler results, snapshot failuresInvoke-Expression)TF400813auth errors)#Requires -Version 5.1directive for native version enforcementjq/grep/seddependenciesSkill changes (
SKILL.md,failure-patterns.md):UpdateSnapshotsFromBuildNuke target when appropriate#apm-dotnet)scripts-reference.mdfor script documentationExample output
Running
/troubleshoot-ci-build build 195754produces:Test coverage
Manual verification:
Get-Help Get-AzureDevOpsBuildAnalysis.ps1 -Fullparses correctly-BuildId/-PullRequest)Other details
Internal development tooling for engineering teams. Not included in any customer-facing artifacts.