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

fix: ape plugins list bad auth and unnecessary requests #2365

Merged
merged 3 commits into from
Nov 1, 2024

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Nov 1, 2024

What I did

fixes: #2363

Two things

  1. Avoid requesting anything from GH during ape plugins list (unless --all) is given. There is no need!
    This is a performance boost as well:

Before:

ape plugins list  2.87s user 0.32s system 74% cpu 4.299 total

After:

ape plugins list  1.49s user 0.20s system 99% cpu 1.700 total
  1. When receiving a 401 from bad auth in GH client, retry request w/o auth, as it likely will still work. Also, let the user know via a log warning.

How to verify it

export GITHUB_ACCESS_TOKEN="poop"
ape plugins list
ape plugins list --all

The first ape plugins list should be fine - no requests to GH are even made anywhere and it is faster.
The second request should still work! Only you get a warning now about your bad auth.

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@antazoey antazoey merged commit aa1c02c into ApeWorX:main Nov 1, 2024
16 checks passed
@antazoey antazoey deleted the fix/pluginslist branch November 1, 2024 16:40
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.

Error when calling ape plugins list
2 participants