Open stephlocke opened 8 years ago
Thank you for making this package.
Packages can be installed as follows:
cred <- git2r::cred_user_pass(username = "", password = "<token>")
devtools::install_git("https://<domain>.visualstudio.com/<project>/_git/<repo>", credentials = cred)
Do you want to implement it or should I open a PR?
PR please 😍
Ideally, this'll need some unit tests n stuff - give me a shout if/when you get to needing a repo for the unit tests and I'll add an R package repo into my test VSTS instance :)
And of course, if you want to bounce ideas off me or need a hand before then - feel free to get in touch
I'll make a PR, but it might take a couple of days/a week.
I don't have access to a public repo on VSTS, so it would be great if you can provide one :-)
Edit: Can I just reuse the token from https://github.com/stephlocke/tfsR/blob/master/tests/testthat/test-TFSAuth.R
Yep you can - I think you can push code to a repo (so you can make a dummy package for unit tests) using those creds but let me know if not.
Nice. Regarding the function signature, do you prefer to enter https://<domain>.visualstudio.com/<project>/_git/<repo>
or https://<domain>.visualstudio.com
as tfs
as in your other functions and then project
and repo
?
Great question!
I'd love for the function to work as much like install_github
as possible but we have a few more moving parts.
What do you think would be the most usable option?
I prefer the latter.
Actually, I've changed my mind. The URL of the "code" part of a repo is the the one that should be passed to devtools::install_git
, so I think that's the better option.
@stephlocke Can you post the URL of a test repo?
I can't make it work... R just hangs. Can you try the two commands I provided with the token from the other test file?
I do & get
cred <- git2r::cred_user_pass(username = "tfsRtesting", password = "fz43enydh7vi2o6jqir2gmftohh7ooz2lizqvy6jxtw4ltrpwola")
devtools::install_git("https://stephlocke.visualstudio.com/DefaultCollection/_git/tfsr3", credentials = cred)
## Downloading git repo https://stephlocke.visualstudio.com/DefaultCollection/_git/tfsr3
## Installation failed: Error in 'git2r_clone': too many redirects or authentication replays
Hmm... That's weird. I don't recall having any problems. I'll have another look at the site I have access to.
Now I can't make it work either..! Although I get a different error
Installation failed: Error in 'git2r_clone': failed to set credentials: The parameter is incorrect.
I have to dig some more, but I don't really have a time estimate.
No worries - you're doing work on this in your spare time! Any time you donate is amazing 🥇
Also - they're doing some stuff with ssh urls so it's possible we're just doing stuff at a bad time where links and auth are being a bit iffy
Good point about the ssh urls -- I did get an email about ssh keys, but didn't make the connection to this problem.
Now the devtools
approach work for me again in "my" repository -- if I add my corporate email as username
.
Does that approach work for any of your repos?
Add a function for installing a package from tfs, similar to
devtools::install_github()