[Coding Agents] Add HTTP REST API fallbacks for AzDO build analysis#8448
Conversation
When az/gh CLIs are unavailable or misconfigured, fall back to direct HTTP requests via Invoke-RestMethod for read-only operations. Stage retry still requires az. 🤖 Co-Authored-By: Claude Code <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f68b02eda
ℹ️ 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".
Avoid picking up stale closed/merged PRs when branch names are reused in the HTTP fallback path. 🤖 Co-Authored-By: Claude Code <[email protected]>
The scripts declare #Requires -Version 5.1 and use no PS 7+ specific syntax. Update skill docs to reflect 5.1 as minimum, with PS 7+ (pwsh) as preferred. 🤖 Co-Authored-By: Claude Code <[email protected]>
BenchmarksBenchmark execution time: 2026-04-14 18:29:56 Comparing candidate commit 8ff4202 in PR branch Found 1 performance improvements and 1 performance regressions! Performance is the same for 25 metrics, 0 unstable metrics, 87 known flaky benchmarks.
|
Summary of changes
Add HTTP fallback to
AzureDevOpsHelpers.psm1so the CI build analysis skill works withoutazorghCLIs installed.Reason for change
The
azandghCLI tools are not always available (e.g., fresh machines, CI environments, or teammates without them installed). Sincedd-trace-dotnetis a public project on both Azure DevOps and GitHub, read-only API requests work without authentication.Implementation details
Invoke-AzDevOpsApi: triesaz devops invokefirst; on failure or missing CLI, falls back toInvoke-RestMethodwith direct REST URLs forGETrequests.PATCH/POST/PUTstill requireaz.Get-BuildIdFromPR: triesgh pr checksfirst; falls back to GitHub REST API (get PR → get commit statuses → extract AzDO build URL).Get-PRNumberForCurrentBranch(new): triesgh pr view; falls back to GitHub pulls API with?head=DataDog:{branch}filter.Test-Prerequisites: now warns instead of erroring when CLIs are missing/misconfigured, since HTTP fallback covers read-only operations.SKILL.md,scripts-reference.md) updated to reflect optional CLI requirements.New internal helper functions:
Invoke-AzDevOpsApiViaCli,Invoke-AzDevOpsApiViaHttp,Get-BuildIdFromPRViaGh,Get-BuildIdFromPRViaHttp.Test coverage
Manually tested all three invocation paths with HTTP fallback forced:
-BuildId <ID>— direct AzDO HTTP GET-PullRequest <NUMBER>— GitHub REST API → AzDO HTTP GETOther details
Stage retry (
Retry-AzureDevOpsFailedStages.ps1) intentionally has no HTTP fallback because it requires authenticatedazCLI forPATCHoperations.🤖 Generated with Claude Code