github-release-resource icon indicating copy to clipboard operation
github-release-resource copied to clipboard

Check fails for repos with a lot of releases

Open tbe opened this issue 2 years ago • 2 comments

Describe the bug

Using the github-release-resource with repositories that contain more then 1000 releases, the check step fails with

422 Only the first 1000 results are available.

Reproduction steps

Use the resource with a repo with more then 1000 releases

Expected behavior

The resource does not list every possible release, or stops after 1000

Additional context

It looks like this was introduced with #96

tbe avatar May 10 '23 21:05 tbe

To satisfy that need, the GitHub REST API provides up to 1,000 results for each search.

Source: https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28

I think the best-effort thing we can do is gracefully recover from this error and return the results we did get.

taylorsilva avatar Mar 14 '25 15:03 taylorsilva

This is easy to recover from when using the REST API. But when we use the graphql API, we don't have access to the underlying HTTP response where we can check the status code.

Might make sense to move to a more generic graphql library instead of the one we're currently using: https://github.com/shurcooL/githubv4 Which uses https://github.com/shurcooL/graphql which doesn't return the response body: https://github.com/shurcooL/graphql/blob/ed46e5a4646634fc16cb07c3b8db389542cc8847/graphql.go#L87-L96

Maybe switch to https://github.com/Khan/genqlient ?

taylorsilva avatar Mar 14 '25 15:03 taylorsilva