Repository navigation
add S3 methods for checking server capabilities - #1392
Conversation
| curDeploy <- deploys[i, ] | ||
|
|
||
| # don't sync if published to RPubs or Connect Cloud | ||
| # RPubs has no client, so check it before the client is created |
There was a problem hiding this comment.
future: Is it a mistake that rpubs has no client? Probably not worth addressing given that publishing stops next year.
There was a problem hiding this comment.
rpubs behaves pretty differently to the other servers since we don't track user accounts for it. agree it's not worth addressing now, most of the S3 methods would be unused anyway. shouldn't be too hard to remove the small amount of rpubs-specific code when publishing is no longer supported.
e77e3fb to
a308896
Compare
|
Addressed the review comments and added a few additional capabilities in 3d647e3 |
| } | ||
| if (isPositConnectCloudServer(accountDetails$server)) { | ||
| cli::cli_abort("Node.js content is not supported on Posit Connect Cloud.") | ||
| if (!supportsNodejs(client)) { |
There was a problem hiding this comment.
future: reshape some of these "if not supports then error message" into requireSupportNodejs() calls, making deployApp even trimmer.
Alternatively, an even broader check could be something like confirmSupportedContent(client, appMetadata).
part of #1380
Code that needs to know what a server can do, such as set env vars or deploy without an upload, now asks the client through a generic like
supportsEnvVars(client)instead of checking the server name. There's a fair bit of boilerplate associated with this but it is also now much clearer which servers support which features.The checks in
listAccountEnvVars(),updateAccountEnvVars(), and the user management functions need a client, so they now create the client first. This changes the order of errors: a bad account now errors before the "not supported" error, and on Connect, creating the client can make network calls (Snowflake token or identity federation) first. For the same reason,syncAppMetadata()now callsaccountInfo()for Connect Cloud records, so it now errors if that account was removed, which is consistent with Connect and shinyapps.io.appMetadata()andinferAppMode()still take a logical argument and not a client, becausewriteManifest()calls them and has no client. The argument is renamed fromisShinyappsServertostaticRmdNeedsShinyto describe the capability and not the server.