zielu / GitToolBox

GitToolBox IntelliJ plugin
GNU General Public License v3.0
604 stars 71 forks source link

[Feature] repository links GitHub Enterprise Server support #479

Open TwoDCube opened 1 year ago

TwoDCube commented 1 year ago

It would be nice if the repository links paid feature would support GitHub Enterprise Server. I didn't find anything related to this, so I'm assuming this is currently unsupported.

zielu commented 1 year ago

Hi, I'll look into it - it might actually work already, but I need to double-check if links are structured same as on github.com

zielu commented 1 year ago

Hi, I could not find any info how links are structured in github ent. Do you have access to an instance by any chance ?

TwoDCube commented 1 year ago

Thanks for taking the time to look into it. Yes I have access and I am a paid user so I can test it as well.

The links are structured the exact same way as public GitHub.

Public example:
https://github.com/Verseghy/website_k8s/blob/2bf5c0e49b4b2859a8a678c12f6743b2570f1ba8/services/cert-manager-cluster-issuer.yaml#L2

GHES example:
https://<domain>/<org>/<repo>/blob/<commit>/path/to/file#L35

Not sure how your current vcs detection works, but for GHES the difference I saw is that ALL requests MUST contain authorization, even getting the /octocat ASCII art. But even without authorization, the error message gives it away that it's a github enterprise server: https://github.ibm.com/api/v3/octocat https://docs.github.com/en/enterprise-server@3.8/rest/meta#get-octocat (but do mind, that it is usually preferred, that you do not randomly probe the internal tools, so IF possible, a solution where it either "just figures it out somehow" (like simply having github in the URL (not all companies might have that)) or I can set it manually would be better)

zielu commented 1 year ago

So it might actually work already - detection is based purely on branch upstream url without any calls. It should be enough if you just add github ent host in Setttings > Version Control > GitToolBox > Repositories > Github section.

TwoDCube commented 1 year ago

I have it added as such currently, the option to copy the link/open does come up, but clicking them do nothing. Neither does the other way around, copying a link does not pop up the notification to navigate to the file like public GH links do

image image

idea.log does not contain anything related to this

zielu commented 1 year ago

Ok, I'll investigate what is wrong

zielu commented 1 year ago

Hi, I released a new EAP build which contains additional logging.

  1. How to switch to it: https://github.com/zielu/GitToolBox#eap-builds
  2. How to enable debug logs is described here: https://github.com/zielu/GitToolBox/wiki/Manual#logging

After logs are enabled try to open context menu and click Open File Link and Copy File Link, then please share the logs.