Bug
get-aspire-cli-pr.sh fails to install the Aspire CLI from a PR when the PR touches too many files.
Failure
The LegacySettingsMigration_AdjustsRelativeAppHostPath CLI E2E test failed in CI run #24410740249 on PR #15995 because the script could not retrieve the PR HEAD SHA.
Terminal recording: ▶️ View Recording
Root Cause
The get_pr_head_sha() function in eng/scripts/get-aspire-cli-pr.sh calls the single-PR REST endpoint:
GET /repos/microsoft/aspire/pulls/{pr_number}
This endpoint computes the full diff. When a PR has too many changed files, GitHub returns HTTP 422:
{"message":"The request could not be processed because too many files changed","documentation_url":"https://docs.github.com/rest/pulls/pulls#get-a-pull-request","status":"422"}
The script treats this as a fatal error and exits before downloading CLI artifacts.
Relevant code (eng/scripts/get-aspire-cli-pr.sh, line ~615):
head_sha=$(gh_api_call "${GH_REPOS_BASE}/pulls/$pr_number" ".head.sha" "Failed to get HEAD SHA for PR #$pr_number")
Suggested Fix
Use the GraphQL API to fetch just the head SHA without computing the diff:
gh api graphql \
-f query='{ repository(owner:"microsoft",name:"aspire") { pullRequest(number:) { headRefOid } } }' \
--jq '.data.repository.pullRequest.headRefOid'
Or alternatively, use the REST API with a media type that skips the diff, or query the git/ref endpoint using the PR branch name.
Affected Script
eng/scripts/get-aspire-cli-pr.sh — get_pr_head_sha() function (line ~609)
- The same pattern may also exist in
eng/scripts/get-aspire-cli-pr.ps1
Bug
get-aspire-cli-pr.shfails to install the Aspire CLI from a PR when the PR touches too many files.Failure
The
LegacySettingsMigration_AdjustsRelativeAppHostPathCLI E2E test failed in CI run #24410740249 on PR #15995 because the script could not retrieve the PR HEAD SHA.Terminal recording:▶️ View Recording
Root Cause
The
get_pr_head_sha()function ineng/scripts/get-aspire-cli-pr.shcalls the single-PR REST endpoint:This endpoint computes the full diff. When a PR has too many changed files, GitHub returns HTTP 422:
The script treats this as a fatal error and exits before downloading CLI artifacts.
Relevant code (
eng/scripts/get-aspire-cli-pr.sh, line ~615):head_sha=$(gh_api_call "${GH_REPOS_BASE}/pulls/$pr_number" ".head.sha" "Failed to get HEAD SHA for PR #$pr_number")Suggested Fix
Use the GraphQL API to fetch just the head SHA without computing the diff:
Or alternatively, use the REST API with a media type that skips the diff, or query the
git/refendpoint using the PR branch name.Affected Script
eng/scripts/get-aspire-cli-pr.sh—get_pr_head_sha()function (line ~609)eng/scripts/get-aspire-cli-pr.ps1