fix: Use GAF network stack for license downloads#6684
Merged
PeterSchafer merged 1 commit intomainfrom Apr 2, 2026
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This comment has been minimized.
This comment has been minimized.
3f38c75 to
dccb5a6
Compare
This comment has been minimized.
This comment has been minimized.
dccb5a6 to
bd9bfa8
Compare
This comment has been minimized.
This comment has been minimized.
bd9bfa8 to
48d6239
Compare
This comment has been minimized.
This comment has been minimized.
48d6239 to
1a51921
Compare
This comment has been minimized.
This comment has been minimized.
1a51921 to
3f87fc6
Compare
This comment has been minimized.
This comment has been minimized.
3f87fc6 to
02ec632
Compare
This comment has been minimized.
This comment has been minimized.
Contributor
|
@danskmt please cleanup the PR description to the latest state |
02ec632 to
f75c0a0
Compare
This comment has been minimized.
This comment has been minimized.
f75c0a0 to
fe53d19
Compare
This comment has been minimized.
This comment has been minimized.
fe53d19 to
bdf0b5e
Compare
This comment has been minimized.
This comment has been minimized.
PeterSchafer
approved these changes
Apr 1, 2026
bdf0b5e to
b1824a2
Compare
This comment has been minimized.
This comment has been minimized.
b1824a2 to
835194f
Compare
PR Reviewer Guide 🔍
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Submission Checklist
What does this PR do?
Fixes GitHub 429 rate-limiting failures during third-party license preparation (CLI-1402) by switching manual license downloads from a plain
http.Clientto the GAF network stack.manualLicenseDownloaduses an*http.Clientfromnetworking.NewNetworkAccess(), which provides automatic retry with backoff on 429/5xx,Retry-Aftersupport, and proxy/TLS behaviour aligned with the rest of the CLI.User-Agentheader is set via GAF'sAddHeaderFieldinstead of per-request construction.maxDownloadAttemptsis set to 5.Timeoutof 60 seconds so individual downloads cannot hang indefinitely.Where should the reviewer start?
cliv2/scripts/prepare_licenses.go—newHTTPClient(GAF + timeout), updatedmanualLicenseDownloadsignaturecliv2/scripts/prepare_licenses_test.go—TestNewHTTPClient_SetsUserAgent,TestNewHTTPClient_RetriesOn429, and existing tests migrated to testify where touchedHow should this be manually tested?
make clean && make build— licenses download successfully using the GAF clientcliv2/, rungo test ./scripts/(or rely on CI:make openboxtestrunsgo test -cover ./..., which includes thescriptspackage)Any background context you want to provide?
The license step fetches a few files from
raw.githubusercontent.com. Parallel CI can trigger 429 responses. The previous client had a fixed timeout but no retries on those responses, so builds could flake. GAF’s middleware adds retries; the 60s client timeout caps how long a single download can block.What's the product update that needs to be communicated to CLI users?
None. This is an internal build infrastructure fix with no user-facing changes.
Risk assessment (Low | Medium | High)?
Low — only affects build-time license preparation, not CLI runtime behaviour. GAF is already a dependency and its networking stack is used by the CLI itself.
Any background context you want to provide?
The license preparation step downloads a handful of licenses from
raw.githubusercontent.com. Under load (e.g. parallel CI jobs), GitHub returns 429 responses. The previous barehttp.Clienthad no retry logic, causing flaky build failures. GAF's networking middleware handles this transparently.What are the relevant tickets?
CLI-1402