pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.24k stars 124 forks source link

Octo isn't authenticating even though gh is working properly #568

Closed benelan closed 4 days ago

benelan commented 5 days ago

Issue Description

Type: bug report

Describe what happened (or what feature you want)

Octo isn't realizing that I'm authenticated through gh. I tried switching between ssh and https, which has not effect. I'm using github.com as my remote, so there shouldn't be any issues there.

I am getting a rate limit error when trying to run any Octo commands (e.g. :Octo pr list) due to the auth issue:

gh: API rate limit exceeded for ************. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.) (HTTP 403)

Running :!gh pr list does show the list of PRs.

Running :lua print(require("octo.gh").get_user_name()) does not print my username.

Running !gh auth status shows that I am logged in:

github.com
  ✓ Logged in to github.com account benelan (keyring)
  - Active account: true
  - Git operations protocol: https
  - Token: ***************************************
  - Token scopes: 'gist', 'read:org', 'repo'

I also checked my rate limiting via gh api /rate_limit and I'm not at the limit:

{
  "resources": {
    "core": { "limit": 5000, "used": 0, "remaining": 5000, "reset": 1719617580 },
    "search": { "limit": 30, "used": 0, "remaining": 30, "reset": 1719614040 },
    "graphql": { "limit": 5000, "used": 10, "remaining": 4990, "reset": 1719615254 },
    "integration_manifest": { "limit": 5000, "used": 0, "remaining": 5000, "reset": 1719617580 },
    "source_import": { "limit": 100, "used": 0, "remaining": 100, "reset": 1719614040 },
    "code_scanning_upload": { "limit": 1000, "used": 0, "remaining": 1000, "reset": 1719617580 },
    "actions_runner_registration": { "limit": 10000, "used": 0, "remaining": 10000, "reset": 1719617580 },
    "scim": { "limit": 15000, "used": 0, "remaining": 15000, "reset": 1719617580 },
    "dependency_snapshots": { "limit": 100, "used": 0, "remaining": 100, "reset": 1719614040 },
    "audit_log": { "limit": 1750, "used": 0, "remaining": 1750, "reset": 1719617580 },
    "code_search": { "limit": 10, "used": 0, "remaining": 10, "reset": 1719614040 }
  },
  "rate": { "limit": 5000, "used": 0, "remaining": 5000, "reset": 1719617580 }
}

Describe what you expected to happen

I expect octo.nvim to properly determine that I'm authenticated and find my username.

How to reproduce it (as minimally and precisely as possible)

  1. Run :Octo pr list
  2. See the rate limit error

Tell us your environment

Pop!_OS 22.04 LTS x86_64

Swaywm

gh version 2.52.0 (2024-06-24) (installed using these steps)

NVIM v0.10.0 Build type: Release LuaJIT 2.1.1713484068

Anything else we need to know?

Please let me know if there is anything else I can provide to help troubleshoot, since I doubt you can repro on your end.

I found #466 through a comment in the source code but the workaround of setting vim.g.octo_viewer didn't work for me.

benelan commented 5 days ago

I downgraded to gh version 2.51.0 by installing from source, which resolved the issue. So something changed in v2.52.0 that broke this plugin for me.

benelan commented 4 days ago

I tried updating back to v2.52.0 and it works now, not sure what happened. Sorry for the false alarm!