fridex / githubcap

A CLI and a library for communicating with GitHub API v3 safely and sanely
http://githubcap.readthedocs.io
Apache License 2.0
1 stars 2 forks source link

issues-listing -o username failure #4

Open jayvdb opened 4 years ago

jayvdb commented 4 years ago

I suspect this may be because I havent authenticated, iirc the github scope rules. If so, the CLI should prompt the user that they need to auth first before it will work.

/usr/bin/githubcap-cli issues-listing -o jayvdb -s OPEN
2020-01-07 12:30:28,050 [23115] CRITICAL root: Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/githubcap/base.py", line 64, in call
    response.raise_for_status()
  File "/home/jayvdb/.local/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.github.com/orgs/jayvdb/issues?page=1&per_page=100&filter=all&state=open&sort=created&direction=desc&milestone=*&assignee=*

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/bin/githubcap-cli", line 11, in <module>
    load_entry_point('githubcap==0.0.0', 'console_scripts', 'githubcap-cli')()
  File "/usr/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/githubcap/cli.py", line 172, in issues_listing
    _print_result(list(reported_issues), not no_pretty)
  File "/usr/lib/python3.7/site-packages/githubcap/resources/issues.py", line 63, in list_assigned_issues
    for item in self._do_listing(base_uri):
  File "/usr/lib/python3.7/site-packages/githubcap/base.py", line 97, in _do_listing
    response, headers = self.get(uri)
  File "/usr/lib/python3.7/site-packages/githubcap/base.py", line 76, in get
    return cls.call(*args, **kwargs, method='GET')
  File "/usr/lib/python3.7/site-packages/githubcap/base.py", line 66, in call
    raise HTTPError(response.json(), response.status_code) from exc
githubcap.exceptions.HTTPError: Not Found
jayvdb commented 4 years ago

Same happens with authenticated with a token. Using -o coala works.

Maybe the help text for -o needs to be changed to not mentioned usernames.