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

New board_connect_url() #706

Closed
wants to merge 27 commits into from
Closed

New board_connect_url() #706

wants to merge 27 commits into from

Conversation

juliasilge
Copy link
Member

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

Comment on lines 729 to 734
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())
}
Copy link
Member Author

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,
Copy link
Member Author

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.

Copy link
Member Author

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.

Comment on lines +11 to +12
#' `board_connect_url()` is read only, and does not support either the use of a
#' [manifest file][write_board_manifest()] or versioning.
Copy link
Member Author

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, ...) {
Copy link
Member Author

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}>")
Copy link
Member Author

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()?

R/board_connect.R Outdated Show resolved Hide resolved
@juliasilge
Copy link
Member Author

Closed by #732

I did end up re-using all that testing code I wrote in this PR so yay! 🎉

@juliasilge juliasilge closed this Apr 14, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a helper function to download pins straight from Connect content/vanity URLs
2 participants