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

install_bitbucket from private host: hardcoded directory "repositories" in URL #584

Open
andreagrioni opened this issue Feb 15, 2021 · 11 comments
Labels
feature a feature request or enhancement help wanted ❤️ we'd love your help!

Comments

@andreagrioni
Copy link

I have a R package on a private BitBucket server.

The cmd remotes::install_bitbucket(repo="user/repo.git", host="bitbucket.NAME.net/") exited with error message:

Error: Failed to install 'unknown package' from Bitbucket: cannot open URL 'https://bitbucket.NAME.net//repositories/user/repo.git/src/HEAD/DESCRIPTION'

Note that the directory repositories is not provided in the arguments but it is hardcoded by the install_bitbucket function.

@lmullany
Copy link

lmullany commented Mar 31, 2021

Same issue with me.. When I override with my private bitbucket server, the hardcoding of repositories within the construction of the url causes this to fail

See: #429

@aprijol
Copy link

aprijol commented Jun 23, 2021

Also having this issue!

@jimhester jimhester added the feature a feature request or enhancement label Sep 24, 2021
@lmullany
Copy link

lmullany commented Jan 6, 2022

@andreagrioni and/or @aprijol : Have either of you found a good work around for this?

@gaborcsardi
Copy link
Member

What is the correct URL on a private server?

@robertkck
Copy link

Our Bitbucket Server can be addressed with the Bitbucket Server REST API, but I am not able to identify the right requests to change the install_bitbucket function. Happy to assist if possible.

@gaborcsardi
Copy link
Member

Well, I don't have access to any private BitBucket repos, but if you can create a PR, I'll be happy to review it.

@gaborcsardi gaborcsardi added the help wanted ❤️ we'd love your help! label Jan 7, 2022
@lmullany
Copy link

lmullany commented Jan 7, 2022

What is the correct URL on a private server?

@gaborcsardi , I'm sorry to say that I'm not sure.. I don't know if this example helps or not:

The remote is this:
https://code.jh.edu/scm/psq/pmaputilities.git

In a browser, I can directly access the repos like this..
https://code.jh.edu/projects/PSQ/repos/pmaputilities/browse

I have an auth token and thought I would be able to install the package like this:

auth_token = <my token>
remotes::install_bitbucket(
    repo = "repos/pmapUtilities",
    ref="main",
    host="code.jh.edu/projects/psq/",
    upgrade="never",
    auth_token = auth_token
    )

output:

Error: Failed to install 'unknown package' from Bitbucket:
  cannot open URL 'https://code.jh.edu/projects/psq//repositories/repos/pmapUtilities/src/main/DESCRIPTION'
Traceback:

1. remotes::install_bitbucket(repo = "repos/pmapUtilities", ref = "main", 
 .     host = "code.jh.edu/projects/psq/", upgrade = "never", auth_token = auth_token)
2. install_remotes(remotes, auth_user = auth_user, password = password, 
 .     host = host, dependencies = dependencies, upgrade = upgrade, 
 .     force = force, quiet = quiet, build = build, build_opts = build_opts, 
 .     build_manual = build_manual, build_vignettes = build_vignettes, 
 .     repos = repos, type = type, ...)
3. tryCatch(res[[i]] <- install_remote(remotes[[i]], ...), error = function(e) {
 .     stop(remote_install_error(remotes[[i]], e))
 . })
4. tryCatchList(expr, classes, parentenv, handlers)
5. tryCatchOne(expr, names, parentenv, handlers[[1L]])
6. value[[3L]](cond)

I notice the hard coding of the term "repositories" as also experienced by @andreagrioni . I may be doing a number of other things incorrectly -- any insight you can provide would be much appreciated... or any workaround!

@aprijol
Copy link

aprijol commented Jan 10, 2022

What is the correct URL on a private server?

Private servers can have a number of things in that node. Our organization has the org abbreviation there. I just went in and removed "repositories" from the build_url calls. I added the node I needed to username (e.g., orgabbrev/username). I still had issues further down the line with authentication and ended up having to put this effort on hold. But, just taking out "repositories" worked for this issue.

@morriso1
Copy link

morriso1 commented Jun 6, 2022

I also have this problem. Is there any way we can specify the whole URL? This would be a great feature as the current hard coding of "repositories" does not work for me

@andysw90
Copy link

andysw90 commented Dec 8, 2023

Any potential workarounds to this? I am having the same issue

@gaborcsardi
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement help wanted ❤️ we'd love your help!
Projects
None yet
Development

No branches or pull requests

8 participants