Skip to content
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

chore: bump checkout version #22

Merged
merged 3 commits into from Jan 21, 2021
Merged

chore: bump checkout version #22

merged 3 commits into from Jan 21, 2021

Conversation

henryiii
Copy link
Contributor

Hoping to expose a different issue (#21 ).

@henryiii
Copy link
Contributor Author

This works for me locally if I run yarn test, all tests pass. But it looks like it might be mocking the remote response; since it seems to likely be a change on GH's end, maybe those would pass?

@henryiii
Copy link
Contributor Author

This doesn't look right:

curl -I "https://api.github.com/repos/Kitware/CMake/releases"
HTTP/1.1 200 OK
Server: GitHub.com
Date: Tue, 19 Jan 2021 04:25:17 GMT
Content-Type: application/json; charset=utf-8
Status: 200 OK
Cache-Control: public, max-age=60, s-maxage=60
Vary: Accept, Accept-Encoding, Accept, X-Requested-With
ETag: W/"f4cd2b1610ad19f3c5b8aedef5587616d57ddbb631a3e8e4d46cf435e4d5a91e"
X-GitHub-Media-Type: github.v3; format=json
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
X-RateLimit-Reset: 1611033602
x-ratelimit-used: 3
Accept-Ranges: bytes
X-GitHub-Request-Id: D2A0:45AC:ECF9E8:19AF567:60065F2A

There's no Link header! If I use the standard example from the docs:

curl -I "https://api.github.com/search/code?q=addClass+user:mozilla"
HTTP/1.1 200 OK
Server: GitHub.com
Date: Tue, 19 Jan 2021 04:26:10 GMT
Content-Type: application/json; charset=utf-8
Status: 200 OK
Cache-Control: no-cache
Vary: Accept, Accept-Encoding, Accept, X-Requested-With
X-GitHub-Media-Type: github.v3; format=json
Link: <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=2>; rel="next", <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=34>; rel="last"
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 9
X-RateLimit-Reset: 1611030429
x-ratelimit-used: 1
Accept-Ranges: bytes
X-GitHub-Request-Id: D2A2:3BA9:9814F6:1435308:60065F61

There is a Link header.

@henryiii
Copy link
Contributor Author

henryiii commented Jan 19, 2021

I'm hoping to get a response here, but until then, some ideas. 1) Could you use @octokit/core.js? Don't know if you can call JS from TypeScript easily, and I don't know if that is working or broken too. 2) Could you loop over pages until empty? Crude, but seems like some users had to do this in the past. It could be done only if this is missing, perhaps? 3) If an exact version is specified, could you just compute the URL if it's not found and try that? Since if I request exactly 3.7.2, you could compute a likely URL for that and just try to download it? (Haven't tried this to see if it's already done, actually).

@henryiii
Copy link
Contributor Author

@jwlawson By the way, I think the changes here are still useful, even though they don't fix a problem, feel free to edit & merge after you get #23 working if you like them. The API recommends you add the Accept header, and the workflow changes are likely useful too.

@jwlawson
Copy link
Owner

OK thanks. The changes all look very reasonable.

@henryiii henryiii closed this Jan 19, 2021
@henryiii henryiii reopened this Jan 19, 2021
@henryiii
Copy link
Contributor Author

Yes, looks like GitHub fixed their issue. Maybe it would be a good idea to fall back on paginating if this header ever goes missing again? Not as the main method, but as a fallback.

@jwlawson jwlawson merged commit e6d2824 into jwlawson:master Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants