jaxbot / github-issues.vim

Github issue lookup in Vim
http://jaxbot.me/articles/github-issues-vim-plugin-5-7-2014
Other
406 stars 28 forks source link

:Gissue broken - Python http errors #54

Closed jonmorehouse closed 10 years ago

jonmorehouse commented 10 years ago

When I run :Gissue, I'm getting all kinds of http errors. After doing some digging it happens on the edit gissues/repourl/issues command. Note the commented out line below. This is now not breaking for me - but I'm not sure what the correct functionality should be. Has anyone else seen this?

def showIssueList(labels):
    repourl = getRepoURI()

    if repourl == "":
        print "Failed to find a suitable Github repository URL, sorry!"
        return

    vim.command("silent new")
    #vim.command("edit " + "gissues/" + repourl + "/issues")
    vim.command("normal ggdG")

    b = vim.current.buffer
jonmorehouse commented 10 years ago

Interesting ... this only seems to fail the first time I run it. For instance if I press "enter" and close the error, then immediately run :Gissues again, it pulls up the menu correctly ...

jaxbot commented 10 years ago

Is it consistently doing it only the first time?

The problem could be that when you run Gissues the first time, it's not able to find a proper git repo, or the HTTP request fails. The edit command is necessary since the file name is used to keep track of which project you're using

jaxbot commented 10 years ago

Ah, problem was stupid. Fixed now. If it happens again, though, feel free to reopen!

jonmorehouse commented 10 years ago

Thanks for the quick fix, I'm still having issues with the plugin. I've been playing with two repositories and one works fine when running :Gissues, the other one gives me an error when I open.

image

jonmorehouse commented 10 years ago

For the repo that does get to the :Gissues page, I'm getting weird errors when I open an individual issue for the first time. When I go back to the issues list and open again, it doesn't show the error. I'm guessing this is related because I didn't see any other issues, but nonetheless, let me know if I should open up a new issue. Thanks for the help!

image

Once I click through and enter the issue buffer, once I save I get this error:

image

jaxbot commented 10 years ago

Hmm.. this is a different problem, but related enough to warrant reopening it. What exactly is the dir to the project you're working on? Does it contain any non alphanumeric characters?

jonmorehouse commented 10 years ago

Hmm ... the repository is just at $HOME/dotfiles ... no non alphanumeric characters.

Trying on a few different repositories locally, different errors keep popping up. For some background, I'm using hub as my git tool. I've also installed python via homebrew and am linking vim against that version + python path.

jonmorehouse commented 10 years ago

Here's an example of another error when I run against a freshly clone repository. The path is $HOME/Desktop/node-app-bootstrap. I'm simply running :Gissues

image

jaxbot commented 10 years ago

That last issue was caused by the label having a space in the name, and thus an invalid command was created. Should be fixed now. Looking into the others

jonmorehouse commented 10 years ago

Cool. Just tried it out and it looks like the g:Issue command is working smoothly on all the repos I tested. Nice work! The only thing left is actually opening up issues, it seems

jaxbot commented 10 years ago

Placed a fix on opening issues; seems I forgot to account for issues with no body messages. Give it a shot and like me know what else is broken.

P.S. really appreciate the debug help!

jonmorehouse commented 10 years ago

Looks good! Just tried it out on a few issues. Thanks for the quick fixes!

jaxbot commented 10 years ago

No problem! Will be closing this out for now; do reopen (or open other issues) if something comes up!