Skip to content

Let local readers and Object methods through the off-quota guard - #1311

Open
Thayorns wants to merge 1 commit into
zerocracy:masterfrom
Thayorns:1226
Open

Thayorns wants to merge 1 commit into
zerocracy:masterfrom
Thayorns:1226

Conversation

@Thayorns

Copy link
Copy Markdown
Contributor

The off-quota guard of Fbe.octo ran for every method called on the client, even those that make no request. So after a commits call took the quota under the threshold, last_response of that very call raised Fbe::OffQuota, and so did auto_paginate, per_page, nil?, inspect and class, as #1226 shows. With the quota unknown, each such call could also cost a /rate_limit request.

Now the guard lets through last_response, auto_paginate and per_page, and any method that every Object has. Methods that call GitHub are still refused off quota.

The new tests drain the quota with one commits call and then read last_response, the paging settings and a random Object method, check that another commits is still refused, and check that per_page costs no /rate_limit request. The tests pass an empty github_token explicitly, so a GITHUB_TOKEN in the environment doesn't change what they see.

Closes #1226

@Thayorns

Copy link
Copy Markdown
Contributor Author

@yegor256 take a look please, happy to clarify anything about this change.

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.

The off-quota guard of Fbe.octo blocks calls that make no request, such as last_response and inspect

1 participant