Skip to content

add S3 methods for checking server capabilities - #1392

Merged
karawoo merged 7 commits into
mainfrom
kara/capability-generics
Oct 2, 2026
Merged

karawoo merged 7 commits into
mainfrom
kara/capability-generics

Conversation

@karawoo

@karawoo karawoo commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

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 calls accountInfo() for Connect Cloud records, so it now errors if that account was removed, which is consistent with Connect and shinyapps.io.

appMetadata() and inferAppMode() still take a logical argument and not a client, because writeManifest() calls them and has no client. The argument is renamed from isShinyappsServer to staticRmdNeedsShiny to describe the capability and not the server.

@karawoo
karawoo added this pull request to stack #1393 September 30, 2026 23:02
Comment thread R/applications.R
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

future: Is it a mistake that rpubs has no client? Probably not worth addressing given that publishing stops next year.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread R/auth.R Outdated
Comment thread R/client-generics.R Outdated
Base automatically changed from kara/upload-bundle to main October 1, 2026 20:40
@karawoo
karawoo force-pushed the kara/capability-generics branch from e77e3fb to a308896 Compare October 1, 2026 21:18
@karawoo
karawoo marked this pull request as ready for review October 1, 2026 21:51
@karawoo

karawoo commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review comments and added a few additional capabilities in 3d647e3

Comment thread R/deployApp.R
}
if (isPositConnectCloudServer(accountDetails$server)) {
cli::cli_abort("Node.js content is not supported on Posit Connect Cloud.")
if (!supportsNodejs(client)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@karawoo
karawoo merged commit d292d65 into main Oct 2, 2026
19 checks passed
@karawoo
karawoo deleted the kara/capability-generics branch October 2, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants