-
Notifications
You must be signed in to change notification settings - Fork 62
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
New board_connect_url()
#706
Conversation
R/board_connect.R
Outdated
board_connect_colorado <- function(...) { | ||
if (!connect_has_colorado()) { | ||
testthat::skip("board_connect_colorado() only works with Posit's demo server") | ||
} | ||
board_connect(..., server = "colorado.posit.co", auth = "rsconnect", cache = fs::file_temp()) | ||
} |
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.
This was in here twice. 🤷♀️
|
||
board <- new_board_v1( | ||
"pins_board_connect_url", | ||
vanity_urls = vanity_urls, |
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 am calling this vanity_urls
for now until I figure out if we need the url
element in the board still. Maybe we end up with just plain urls
, in which case, I can reuse some of the board_url()
methods.
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.
Turns out I'm not going to use urls
because I need the url
element on the board to use rsc_GET()
and similar. So let's stick with vanity_urls
to distinguish it.
#' `board_connect_url()` is read only, and does not support either the use of a | ||
#' [manifest file][write_board_manifest()] or versioning. |
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.
We can't use the approach to handle versioning that board_url()
uses (no manifest files on Connect) or that board_connect()
uses (no looking up GUIDs), so no versioning on this board.
|
||
#' @rdname board_deparse | ||
#' @export | ||
board_deparse.pins_board_connect_url <- function(board, ...) { |
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 did decide to create a board_deparse
method for this board (board_url()
does not have one FYI). This method is mostly used in vetiver and a board without versioning is not the best fit for MLOps tasks, but I tend to think it's better to support the deparsing than not.
) | ||
|
||
version <- try_catch_rsc_version(board, cache, server) | ||
pins_inform("Connecting to Posit Connect {version} at <{server$url}>") |
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 could put this inside of the new helper function try_catch_rsc_version()
?
Co-authored-by: Hadley Wickham <[email protected]>
Closed by #732 I did end up re-using all that testing code I wrote in this PR so yay! 🎉 |
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
Closes #616
For testing, I'll need to write a pin or two with
board_connect()
and then set the vanity URL:https://docs.posit.co/connect/api/#put-/v1/content/%7Bguid%7D/vanity