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

Allow repository guessing for bitbucket and gitlab #562

Merged
merged 3 commits into from Dec 16, 2017

Conversation

Projects
None yet
2 participants
@MarkEWaite
Copy link

commented Dec 14, 2017

The plugin has a repository browser guesser if a repository browser is not selected. Previously, that guesser was limited to a subset of github URLs.

This pull request broadens the types of github URLs which will be recognized and adds bitbucket.org and gitlab.com as possible guesses.

Repository browser guessing is only useful for those repository hosting services which have a well-known host name, like github.com, bitbucket.org, and gitlab.com. Internally hosted GitHub enterprise, or Bitbucket, or GitLab will still need to specify the repository browser, as will other browser types.

I intentionally chose the simpler implementation rather than implementing this using an abstract GitRepositoryBrowserDescriptor. Since the number of public git repository browsers supported by the plugin is quite small, it seemed simpler to extend the existing regular expression based detection technique and return the matching browser rather than modify GitSCM and the relevant repository browser classes.

@reviewbybees

MarkEWaite added some commits Dec 14, 2017

Add GitSCM.guessBrowser() tests
Before extending the guesser to support other hosting providers
More GitSCM.guessBrowser() tests
Before extending the guesser to support other hosting providers
Enable Bitbucket and Gitlab browser guessing
Test additional case with a leading slash in an alternate ssh URL.

Test failure case with example.com as the unrecognized URL.
@ryanwren
Copy link

left a comment

This LGTM, nice tests as well

@MarkEWaite MarkEWaite merged commit 6c91868 into jenkinsci:master Dec 16, 2017

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details

@MarkEWaite MarkEWaite deleted the MarkEWaite:better-browser-guessing branch Dec 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.