-
Notifications
You must be signed in to change notification settings - Fork 2
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 user-friendly functions to add locations #184
Conversation
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.
Yes thank you. This has annoyed me many times before as well.
One alternative would be to have a generic orderly_location_add, which just takes a string and figures it out, like Git does it. We would need some kind of negotiation to determine if an http URL is an outpack_server or a Packit instance (or we use packit+https://
, but that's ugly). We would lose some flexibility if we did that though.
In any case this PR is a good step forward already as is.
As a side-note, at some point maybe before next week's workshop I want to get Packit to display on its home page the line of code needed to add the location to a local workspace, in an easily copy-pasteable way, similar to how GitHub does for new repositories.
##' | ||
##' We currently support two types of locations - `path`, which points | ||
##' We currently support three types of locations - `path`, which points |
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.
two types of locations and off by one errors 😁
##' | ||
##' @param path The path to the other archive root. This should | ||
##' generally be an absolute path, or the behaviour of outpack will | ||
##' be unreliable. |
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.
Might be worth cleaning up and defining the semantics of a relative path at some point (not in this PR). IMO it should be relative to the orderly root, and be resolved each time we use the location, not when it is first added.
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.
Are you thinking here again of people on the cluster where directories "move"?
##' @param token The value for your your login token (currently this | ||
##' is a GitHub token with `read:org` scope). If `NULL`, orderly2 | ||
##' will perform an interactive authentication against GitHub to | ||
##' obtain one. |
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.
Technically this can be a Packit JWT instead of a GitHub PAT, but we don't really publicize any way of obtaining those so I think it is fine if you don't want to mention it here.
This is the only place a JWT would be used today: https://github.com/mrc-ide/orderly-action/blob/main/packit-login.R#L65-L69
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.
I just copied this in from the string that was present in the Details for now
No objection to supporting that; it's concice and would be portable to the Python version too. But it would make custom locations hard to support, and we already have a couple of those now.
This is a great idea |
This annoyed me every time I tried to show someone orderly, so fixing it now before I teach it to a room of people.
I was trying to be too general with
orderly_location_add
but we can make it much nicer if we have functionsorderly_location_add_path
etc with nice arguments, docs and autocomplete for them.For custom locations we might add similar functions within their packages then if users use
library()
they'll be available.A very noisy diff but this is mostly just using the new version throughout the tests