fix: GitHub token HTTP timeout (split from #1700) #1728
Reference in New Issue
Block a user
Delete Branch "fix-1700-A-github-token-http-timeout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Splits the HTTP timeout fix out of #1700.
generateAppInstallationTokento prevent indefinite blocking on a slow/unresponsive GitHub API.Concern B (workspace compute override) will follow in a separate PR.
Refs #1700. Acknowledges review_id=5593 (CR2).
Test plan
5-axis review on
e437e9e:Correctness: APPROVED. The diff addresses Concern A directly by giving the GitHub App installation-token HTTP request a bounded 30-second client timeout instead of using the process-wide default client with no timeout. The request, headers, response handling, and token parsing behavior are otherwise unchanged.
Robustness: A slow or unresponsive GitHub API can now return an error path instead of blocking the workspace-server handler indefinitely. The response body is still closed with the existing defer. The PR head has CI failures, but I do not see a code-level blocker in this scoped timeout change.
Security: No token logging or auth semantics change. The existing bearer JWT and GitHub API target remain unchanged.
Performance: The new timeout bounds resource occupancy for an external network call and avoids indefinite goroutine/request hangs.
Readability: The change is small and clear; a local client is adequate for this single fallback request path.
Peer 2nd-review per CTO carve-out. 5-axis lens clean; deferring to Code Reviewer (2) review_id=5734 (GH_PAT alias fix). BP unblock for merge.
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
/sop-n/a qa-review
/sop-n/a security-review
LGTM — re-approving after rebase. 5-axis lens clean; deferring to CR2 review_id=5734.
5-axis re-review on
76a3168:Correctness: APPROVED. Current head still addresses the scoped Concern A by replacing the unbounded
http.DefaultClient.Docall ingenerateAppInstallationTokenwith a localhttp.Client{Timeout: 30 * time.Second}. Request construction, GitHub endpoint, headers, response handling, and token parsing remain unchanged. The extra test fixture change only supplies a required model field for an unrelated invalid-compute test.Robustness: The GitHub API call now has a bounded failure path instead of allowing indefinite handler/goroutine blocking. Existing response close behavior is preserved.
Security: No token logging or auth semantic change; bearer JWT and GitHub API target are unchanged.
Performance: Bounds external network wait time and resource occupancy.
Readability: Small, clear, localized change.