-
Notifications
You must be signed in to change notification settings - Fork 246
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
add test for bitbucket server #83
Conversation
See #84 as well - allowing a check for all path arguments and keeping the basepath is pretty simple, Having it check the first argument and solving basepath elsewhere would also mitigate some of the conflicts "scm" being in the paths in non-bitbucket servers as well - although i'm sure this is pretty uncommon |
Yeah, the This has the advantage of having one common root URL for all of the services (and just one sub-domain name, and one certificate for the load-balanced URL). Switching to the backup site in case of an outage can be done at this level with one IP/DNS change. Like I said, it's probably not uncommon for hosted services. I'm sure that plenty of people run hosted Gitlab or GitHub Enterprise like this, too. Does that make sense? |
@nwinkler can you look at the assertions here? AFAIK this completely fails with the shipped version of |
The working version was here: 9e9fee0#diff-21e611831fd54f9104bb1bb2abf161eeL89 elif grep -q "/scm/" <<<"$giturl"; then
re='(.*)/scm/(.*)/(.*)\.git'
if [[ $giturl =~ $re ]]; then
giturl=${BASH_REMATCH[1]}/projects/${BASH_REMATCH[2]}/repos/${BASH_REMATCH[3]}
providerUrlDifference=browse
branch="?at=refs%2Fheads%2F${branch}"
fi This has been removed when @derimagia's changes were merged in. |
test/git-open.bats
Outdated
# The following query args work with BB Server: | ||
# at=refs%2Fheads%2Fdevelop, at=develop, at=refs/heads/develop | ||
# However /src/develop does not (unlike bitbucket.org) | ||
assert_output "https://mybb.domain.com/git/projects/ppp/repos/rrr?at=develop" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change required here. If the at
parameter is provided to select a branch, the /browse
part is required after the repo name.
https://mybb.domain.com/git/projects/ppp/repos/rrr/browse?at=develop
One additional assertion for private user repos on Bitbucket Server:
Update: I tried this again with the current implementation, and it looks like it's generating this output from the above input: Output: https://mybb.domain.com/git/projects/~first.last/repos/rrr/browse?at=develop So essentially the same path as the other project URLs for Bitbucket Server, just keeping the That means that there's no special handling of this case. |
Sounds like we should change the test to not include /git, sounds unrelated. My current instances for GHE and gitlab don't do this, but I don't see how it's related to bitbucket specifically. I'll see if I can make a config setting that solves all 3 remaining tasks: Protocol, Host, and Prefix Path |
Yes, completely agree. The prefix/context is a decision at deployment time, and I assume it could be used in any kind of self-hosted solution. |
df232a0
to
f5092e5
Compare
okay. tests updated.
Also I've allowed the tests to create 1 of a few acceptable URLs. |
f5092e5
to
35d4b65
Compare
seems like folks are happy here, so i'm merging. |
* add test for bitbucket server * add branch test for bb server. * updated assertions from discussion. * remove 'git/' from test cases
@nwinkler outlined the requirements over here: #77 (comment)
I believe the patch here implements that, but it currently fails:
https://[email protected]/git/scm/ppp/rrr.git
https://mybb.domain.com/git/projects/ppp/repos/rrr
https://[email protected]/git/projects/ppp/repos/rrr/browse/?at=refs%2Fheads%2Fmaster
Also @derimagia asks some questions about the convention about
/git/scm
at the root of the domain vs just/scm
:@nwinkler will need your help on this one :)