sigma / magit-gh-pulls

Magit plugin for dealing with GitHub pull requests
254 stars 48 forks source link

Errors when refreshing PRs #107

Open nicklan opened 7 years ago

nicklan commented 7 years ago

Emacs version: 25.1.1 magit-gh-pulls version: 20161020.249 from melpa

I'm running into a couple of errors when trying to refresh PRs. In one repo (with no PRs) I get the following:

Debugger entered--Lisp error: (wrong-type-argument listp "Not Found")
  assoc(id (message . "Not Found"))
  #[(obj path) "\302 \210\303\304  \305\"\"A\207" [path obj call-next-method assoc eieio-oref :input] 5]([eieio-class-tag--marshal-driver-alist (message . "Not Found") unbound] id)
  apply(#[(obj path) "\302 \210\303\304    \305\"\"A\207" [path obj call-next-method assoc eieio-oref :input] 5] ([eieio-class-tag--marshal-driver-alist (message . "Not Found") unbound] id))
  #[385 "\301\302\303\304\305!\306\"\307$\310K\311K\301\302\312\304\305\"\313\"\307$\216\310M\210\311M\210\314\300\")\207" [#[(obj path) "\302 \210\303\304 \305\"\"A\207" [path obj call-next-method assoc eieio-oref :input] 5] make-byte-code 0 "\301\300!\207" vconcat vector [cl--generic-isnot-nnm-p] 2 next-method-p call-next-method "\302\300M\210\303\301M\207" [next-method-p call-next-method] apply] 13 "\n\n(fn CL-CNM OBJ PATH)"](#[128 "\302\300\206

In another (with a TON of PRs), I get this (truncated because it's a giant output, let me know if you need more):

Debugger entered--Lisp error: (wrong-type-argument sequencep 600)
  mapcar(#[128 "\302\300\303\301\"\"\207" [gh-object-read (gh-pulls-request) apply append] 6 "\n\n(fn &rest ARGS2)"] 600)
  #[(obj data) "\302\303!  \"\207" [obj data mapcar gh-object-reader] 3](gh-pulls-request 600)
  apply(#[(obj data) "\302\303!    \"\207" [obj data mapcar gh-object-reader] 3] (gh-pulls-request 600))
  #[385 "\301\302\303\304\305!\306\"\307$\310K\311K\301\302\312\304\305\"\313\"\307$\216\310M\210\311M\210\314\300\")\207" [#[(obj data) "\302\303! \"\207" [obj data mapcar gh-object-reader] 3] make-byte-code 0 "\301\300!\207" vconcat vector [cl--generic-isnot-nnm-p] 2 next-method-p call-next-method "\302\300M\210\303\301M\207" [next-method-p call-next-method] apply] 13 "\n\n(fn CL-CNM OBJ DATA)"](#[128 "\302\300\206
christianromney commented 7 years ago

Also getting this error.

torgeir commented 6 years ago

I'm seeing the same thing on emacs 25.3, magit 20180405.625, magit-gh-pulls-20171121.1110

ccqpein commented 6 years ago

Get the same problem. API: https://github.my-company.com/api/v3 Emacs: 26.1

lewang commented 5 years ago

I've found this is a problem how it guesses which Github project this repo corresponds to

setting it manually made the error go away

git config magit.gh-pulls-repo <user>/<repo> # your github repository
torgeir commented 5 years ago

That does not improve the situation on my end. I get the same error with both git config magit.gh-pulls-repo user/repo and git config magit.gh-pulls-repo git@github.com:user/repo.git. Might be related to the repo being private?

rockneurotiko commented 3 years ago

I had this problem too, and after digging on what was happening I discovered that my problem was that the original repository name had changed but I didn't updated my origin url, and the gh library doesn't follow the github redirects:

> curl -H "Authorization: token <token>" -i https://api.github.com/repos/<user>/<repo>/pulls

{
  "message": "Moved Permanently",
  "url": "https://api.github.com/repositories/<id>/pulls",
  "documentation_url": "https://docs.github.com/v3/#http-redirects"
}

If you try again with the url received it will work.

My solution was just updating my origin url.