You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 44b41d5
Browse filesBrowse the repository at this point in the historyBrowse files
fix(scripts): avoid false PR head changes during GitHub outages (#125517)
gh exit status was treated as proof that stdout held a PR object. The Octopool cache shim reports upstream 5xx responses as exit 0 with empty stdout, so reads now use a bounded-retry validation helper. Convert 9 of 28 gh pr view sites where an empty payload could produce a wrong decision.
echo"GitHub API failure while reading PR #$pr: $reason after $max_attempts attempts.">&2
182
+
[ !-s"$stderr_file" ] || cat "$stderr_file">&2
183
+
rm -rf "$temp_dir"
184
+
return 1
185
+
}
186
+
187
+
pr_view_string_field() {
188
+
local json="$1" field="$2" pr="$3" remedy="${4:-Retry the command.}" label value
189
+
case"$field"in
190
+
headRefOid) label="a head SHA" ;;
191
+
baseRefName) label="a base branch" ;;
192
+
headRefName) label="a head branch" ;;
193
+
*) label="a non-empty .$field string" ;;
194
+
esac
195
+
if! value=$(printf '%s\n'"$json"| jq -er --arg field "$field"'.[$field] | if type == "string" and length > 0 then . else error("missing string field") end'2>/dev/null);then
196
+
echo"GitHub PR metadata for #$pr did not include $label. $remedy">&2
echo "HTTP 503: No server is currently available to service your request. (https://api.github.com/graphql)" >&2
0 commit comments