-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: GitHub downloader should do a GET and retry, trying to discover the correct URL #171
Merged
Conversation
This file contains 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
Does 302 means it's a valid URL? Maybe we should treat it the same as Also can you give an example for a URL that returned 302 for a HEAD request? |
disq
changed the title
fix: GitHub downloader
fix: GitHub downloader should retry certain status codes trying to discover the correct URL
Nov 22, 2023
erezrokah
approved these changes
Nov 22, 2023
disq
commented
Nov 22, 2023
// Check server response | ||
if resp.StatusCode == http.StatusNotFound { | ||
err := retry.Do(func() error { | ||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, downloadURL, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HEAD still returns 401 so it's GET now.
disq
changed the title
fix: GitHub downloader should retry certain status codes trying to discover the correct URL
fix: GitHub downloader should do a GET and retry, trying to discover the correct URL
Nov 22, 2023
erezrokah
approved these changes
Nov 22, 2023
kodiakhq bot
pushed a commit
that referenced
this pull request
Nov 22, 2023
🤖 I have created a release *beep* *boop* --- ## [1.14.1](v1.14.0...v1.14.1) (2023-11-22) ### Bug Fixes * **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.4.6 ([#164](#164)) ([9d20b63](9d20b63)) * **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.5.0 ([#166](#166)) ([0a09610](0a09610)) * **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.5.1 ([#167](#167)) ([13802a1](13802a1)) * **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.6.0 ([#168](#168)) ([f382c2c](f382c2c)) * GitHub downloader should do a GET and retry, trying to discover the correct URL ([#171](#171)) ([abb3bd7](abb3bd7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
GitHub now sometimes returns 302 on a HEAD
It seems to return 401 in tests. So we now do a GET and retry on 401/429.
Extracted from #170