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

neil throws null pointer exception when past the GH json API rate limit #136

Closed
ikappaki opened this issue Nov 24, 2022 · 0 comments
Closed

Comments

@ikappaki
Copy link

ikappaki commented Nov 24, 2022

Hi,

I've noticed that GH throws a NullPointer exception for some of its operations which call on the GH json API (e.g. querying about licences).

neil license search linense
----- Error --------------------------------------------------------------------
Type:     java.lang.NullPointerException
Location: d:\src\neil\neil:1386:36

----- Context ------------------------------------------------------------------
1382:                          curl-get-json
1383:                          (map #(select-keys % [:key :name])))
1384:         search-results (if search-term
1385:                          (filter #(str/includes?
1386:                                    (str/lower-case (:name %))
                                         ^--- 
1387:                                    (str/lower-case search-term))
1388:                                  license-vec)
1389:                          license-vec)]
1390:     (if (empty? search-results)
1391:       (binding [*out* *err*]

This can happen when the IP address where the user is runnign neil from an IP address that has exceeded the GH json api rate limit, which for most people using the tool will be 60 req per hour.

When this happens, it is not obvious to the user why neil fails.

To reproduce

  1. Check out neil
  2. run the neil test suite at least twice, it will fail the scond time
bb tests
# and again
bb tests

(a user can check their usage by running curl -I https://api.github.com/users/<gh user name>)

I understand this is a known limitation, but I could not find anything mentioned in neil's documentation about it or elsewhere.

I can think of the following options to solve this issue

  1. Explain in the documentation/neil usage output that this can happen while improving on error messages when this happens.
  2. as before, but also allow users to set their pershonal GH token with neil (personal tokens permit thousands of calls per hour), e.g. using an env variable where the user can set their token at and picked up by neil.
  3. Investigate alternatives ways to retrieve info from GH.

thanks

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

No branches or pull requests

1 participant