-
-
Notifications
You must be signed in to change notification settings - Fork 22
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Enterprise GitHub #15
Comments
Does the "gh" tool work with enterprise? Ive only interfaced with the public site and API. Maybe we can determine if this will work. |
Yes, with gh pr list and
|
Its interesting you can list the pull requests, but the API call for it indicates it does not exist on your enterprise github server. gh.nvim/lua/litee/gh/ghcli/init.lua Line 142 in f766943
This is essentially the command thats failing. If you were to run something similar with the gh tool manually, what happens? "gh api /repos/{owner}/{repo}/pulls/1" for example. |
Yes, that was the problem, After setting gh api /repos/{owner}/{repo}/pulls/1 works. When performing |
Hm, its most likely not hanging there, thats just the last log message when we fetch data. So either theres a silent error in checks, or something didnt load and we couldn't spawn the UI. If you issue ":LTPanel" command, what happens? |
This gives me an idea. If we can somehow tell from the git repo and we are using GitHub Enterprise server, we could set that ENV var for all CLI requests so the user doesnt need. Or we can just make a config value which maps remotes to enterprise hosts. |
Then I get the error
Yes, these would be good options. Or we can add to the documentation that users need to set |
@David-Kunz https://github.com/ldelossa/gh.nvim/tree/debug Can you switch |
Using the
|
Wow that is not what I would have expected. If that's the case, your gh.nvim is dying somewhere around here: gh.nvim/lua/litee/gh/pr/handlers.lua Line 65 in 7fe8f5b
If you follow the lines, it seems like you never get past the "fetch" of the local code using the Git tool. Are you familiar with lua and your neovim directories to place a few more logs around that "gitcli.fetch" command? You can go to its definition and print the command its issuing, then try it on your repo and see what happens. |
Okay so local out = gitcli.fetch(remote_name, head_branch) is called with remote_name = "litee-gh_{owner}/{repo}" -- {owner} and {repo} are replaced by the actual values of my repository
head_branch = "foo/bar" -- that's how the branch is called where the return value
And indeed I get a notification BUT: In order to get the notification, I have to press |
Can you discern why the git fetch is failing? |
The easiest thing to do is probably log the "cmd" variable here: gh.nvim/lua/litee/gh/gitcli/init.lua Line 35 in 7fe8f5b
|
Yes, the command git fetch litee-gh_{owner}/{repo} {branchname} will timeout:
({owner}, {repo} and {branchname} replaced) |
Okay, you'll have to do a bit of debugging on your end why that's occurring. If the git remote looks OK, and the fetch command looks OK, you have a different issue here where connectivity is not working. |
Okay, I now know the problem. Access via So if I'd change the entry it would work: [remote "litee-gh_xxx/yyy"]
- url = git@HOST:xxx/yyy.git
+ url = https://HOST/xxx/yyy.git
fetch = +refs/heads/*:refs/remotes/litee-gh_xxx/yyy/* Any chance to change it to HTTPS? |
https://github.com/ldelossa/gh.nvim/blob/main/doc/gh-nvm.txt#L356 You'll want to flip this flag in your config. |
Hurray, it works 馃憤 Thanks a lot for your quick help! If you want, I can open a PR to document the necessity for Best regards, |
PR to document for now would be a good idea. I want to make that a "per git repo" option, so that you dont need to flick it on and off for every repository you open. My thinking is, in the config have an option to map "remote_name => GH_HOST value", then if we see the remote in that map, make sure to set that ENV variable during init. I think any "gh" or "git" processes forked from Neovim will inherit the env var. |
Hi 馃憢 ,
I was trying to use this plugin with our internal Enterprise GitHub server (not github.com).
When running
:GHOpenPR
I successfully retrieve a list of pull requests, but when selecting one I getAre Enterprise GitHub servers supported?
Thanks a lot and best regards,
David
The text was updated successfully, but these errors were encountered: