Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support enterprise github urls #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nrayapati
Copy link
Member

@nrayapati nrayapati commented Apr 9, 2018

It would be nice if we can enhance this to support enterprise github urls too.

Especially we have an instance github.domain.com.

Not sure if we need to expand this to support more options? Any suggestions.

Really appreciate your time. Thanks for the good work.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds fine as a quick fix.
// Just discovered this PR while looking at something else

@oleg-nenashev oleg-nenashev requested a review from a team January 13, 2020 12:26
@jglick
Copy link
Member

jglick commented Jan 13, 2020

Maybe not a good idea. Even assuming that URL pattern is reliable (I do not know), would we expect these repositories to accessible anonymously from the Jenkins server? Support for authenticated repositories was deliberately omitted from this simple plugin, which was meant only to make it easier to share libraries on the Internet; a particular company would more likely want to predefine libraries with specific authentication and so on. Of course you can write additional plugins that offer library resolvers with other behaviors.

@nrayapati
Copy link
Member Author

My thoughts are a bit different on this, probably the URL needs to parameterized including the public GitHub URL, as a developer I feel comfortable pulling in any library from the internal enterprise server but not from the public GitHub or internet (for various security reasons. )

@jglick
Copy link
Member

jglick commented Jan 13, 2020

as a developer I feel comfortable pulling in any library from the internal enterprise server but not from the public GitHub or internet

Perfectly reasonable, but probably deserves a separate plugin with its own configuration or something. (Of course you can do without any feature like this by explicitly configuring libraries; the convenience here is being able to refer to a library repo without any system-level or even folder-level configuration, just a line in a Jenkinsfile.)

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the right approach here is to check either org.jenkinsci.plugins.github_branch_source.GitHubConfiguration.endpoints or org.jenkinsci.plugins.github.config.GitHubPluginConfig.configs (not sure offhand why both exist; something to be dealt with at some point) and only match non-git.luolix.top URLs which correspond to one of the known GHE endpoints, picking up any credentials from that endpoint as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants