Conversation
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/5d554415-f0de-4916-ab3d-1d94afcddc5e Co-authored-by: radical <1472+radical@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16169Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16169" |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates get-aspire-cli-pr scripts to resolve PR HEAD SHA via GitHub GraphQL (headRefOid) to avoid REST GET /pulls/{number} returning HTTP 422 on large diffs, with a REST fallback when GraphQL is unavailable.
Changes:
- Add
owner/namerepository format validation before PR lookup. - Prefer GraphQL
repository.pullRequest(number).headRefOidfor HEAD SHA resolution. - Fall back to existing REST
.head.shalookup when the GraphQL call fails.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| eng/scripts/get-aspire-cli-pr.sh | Adds GraphQL-based PR head SHA lookup with REST fallback and repo format validation. |
| eng/scripts/get-aspire-cli-pr.ps1 | Mirrors the GraphQL-first PR head SHA lookup and fallback behavior in PowerShell. |
- Use anchored regex in bash to match PowerShell repo format validation - Change -F to -f for owner/name GraphQL vars to prevent numeric type coercion Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Bash: redirect stderr to /dev/null, check stdout for valid SHA - PowerShell: capture stdout only (2>$null), normalize to trimmed string - Both: treat null/empty GraphQL result as failure triggering REST fallback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
JamesNK
left a comment
There was a problem hiding this comment.
Clean change. GraphQL query is well-formed with parameterized variables, stderr is correctly separated from stdout on both platforms, PowerShell output is normalized, and the REST fallback preserves the original error semantics. No issues found.
|
🎬 CLI E2E Test Recordings — 69 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #24438033504 |
|
No documentation PR is required for this change. This PR updates internal CI scripts (
|
Description
get-aspire-cli-prcould fail before artifact download whenGET /pulls/{number}returns HTTP 422 for large diffs. This change makes PR HEAD SHA resolution independent of diff generation by querying GraphQLheadRefOid, with a REST fallback for environments where GraphQL is unavailable.Scope
eng/scripts/get-aspire-cli-pr.shandeng/scripts/get-aspire-cli-pr.ps1inget_pr_head_sha/Get-PRHeadSHA.Behavior change
repository.pullRequest(number).headRefOid..head.shalookup if GraphQL call fails.owner/namerepo format before querying.Implementation sketch
Fixes #16168
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue:Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
1s1vsblobprodcus386.vsblob.vsassets.io/home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/sdk/10.0.201/MSBuild.dll /noautoresponse /nologo /nodemode:1 /nodeReuse:true /low:false(dns block)c78vsblobprodcus322.vsblob.vsassets.io/home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/sdk/10.0.201/MSBuild.dll /noautoresponse /nologo /nodemode:1 /nodeReuse:true /low:false(dns block)https://api.github.com/graphql/usr/bin/gh gh api graphql -f query=query($owner:String!, $name:String!, $number:Int!) { repository(owner:$owner, name:$name) { pullRequest(number:$number) { headRefOid } } } -F owner=microsoft -F name=aspire -F number=15995 --jq .data.repository.pullRequest.headRefOid aspire-cli-pr-failure --local cal/bin/bash user.name -deps.ps1(http block)/usr/bin/gh gh api graphql -f query=query($owner:String!, $name:String!, $number:Int!) { repository(owner:$owner, name:$name) { pullRequest(number:$number) { headRefOid } } } -F owner=microsoft -F name=aspire -F number=15995 --jq .data.repository.pullRequest.headRefOid celain --ignore-submodules | head -n 10 --local ateFailingTestIssue.csproj user.email(http block)/usr/bin/gh gh api graphql -f query=query($owner:String!, $name:String!, $number:Int!) { repository(owner:$owner, name:$name) { pullRequest(number:$number) { headRefOid } } } -F owner=microsoft -F name=aspire -F number=15995 ools/linux_x64/p/home/REDACTED/work/aspire/aspire/tools/scripts/DownloadFailingJobLogs.cs d4b3�� dotnet" global.json bash committer.email(http block)https://api.github.com/repos/microsoft/aspire/pulls/100/usr/bin/gh gh api repos/microsoft/aspire/pulls/100 --jq .head.sha --get-regexp --local artifacts/bin/replace-text/Debug/replace-text(http block)kxqvsblobprodcus376.vsblob.vsassets.io/home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/sdk/10.0.201/MSBuild.dll /noautoresponse /nologo /nodemode:1 /nodeReuse:true /low:false(dns block)l49vsblobprodcus358.vsblob.vsassets.io/home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/sdk/10.0.201/MSBuild.dll /noautoresponse /nologo /nodemode:1 /nodeReuse:true /low:false(dns block)pkvvsblobprodcus321.vsblob.vsassets.io/home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/sdk/10.0.201/MSBuild.dll /noautoresponse /nologo /nodemode:1 /nodeReuse:true /low:false(dns block)u3hvsblobprodcus371.vsblob.vsassets.io/home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/sdk/10.0.201/MSBuild.dll /noautoresponse /nologo /nodemode:1 /nodeReuse:true /low:false(dns block)uy6vsblobprodcus34.vsblob.vsassets.io/usr/share/dotnet/dotnet dotnet test tests/Infrastructure.Tests/Infrastructure.Tests.csproj -tl:off -- --filter-not-trait quarantined=true --filter-not-trait outerloop=true(dns block)/usr/share/dotnet/dotnet dotnet build /home/REDACTED/work/aspire/aspire/tools/GenerateTestSummary/GenerateTestSummary.csproj --restore(dns block)/usr/share/dotnet/dotnet dotnet build /home/REDACTED/work/aspire/aspire/tools/ExtractTestPartitions/ExtractTestPartitions.csproj --restore(dns block)v53vsblobprodcus320.vsblob.vsassets.io/home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/sdk/10.0.201/MSBuild.dll /noautoresponse /nologo /nodemode:1 /nodeReuse:true /low:false(dns block)yluvsblobprodcus367.vsblob.vsassets.io/home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/sdk/10.0.201/MSBuild.dll /noautoresponse /nologo /nodemode:1 /nodeReuse:true /low:false(dns block)ytvvsblobprodcus310.vsblob.vsassets.io/home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/dotnet /home/REDACTED/work/aspire/aspire/.dotnet/sdk/10.0.201/MSBuild.dll /noautoresponse /nologo /nodemode:1 /nodeReuse:true /low:false(dns block)If you need me to access, download, or install something from one of these locations, you can either: