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

Ability to publish a Shiny app with a custom description #947

Open
capncodewash opened this issue Aug 10, 2023 · 2 comments
Open

Ability to publish a Shiny app with a custom description #947

capncodewash opened this issue Aug 10, 2023 · 2 comments
Labels
feature a feature request or enhancement

Comments

@capncodewash
Copy link

capncodewash commented Aug 10, 2023

I may be missing something, but it appears that the rsconnect package's deployApp() function doesn't seem to support setting a custom description for a Shiny app. The parameters available are currently:

deployApp(
  appDir = getwd(),
  appFiles = NULL,
  appFileManifest = NULL,
  appPrimaryDoc = NULL,
  appSourceDoc = NULL,
  appName = NULL,
  appTitle = NULL,
  envVars = NULL,
  appId = NULL,
  contentCategory = NULL,
  account = NULL,
  server = NULL,
  upload = TRUE,
  recordDir = NULL,
  launch.browser = getOption("rsconnect.launch.browser", is_interactive()),
  on.failure = NULL,
  logLevel = c("normal", "quiet", "verbose"),
  lint = TRUE,
  metadata = list(),
  forceUpdate = NULL,
  python = NULL,
  forceGeneratePythonEnvironment = FALSE,
  quarto = NA,
  appVisibility = NULL,
  image = NULL
)

But to change the description, it seems I need to either interact with the API directly (PATCH /v1/content/{guid}), or use the connectapi package's content_update() function.

This seems a bit of an oversight in this package, since most users don't have an API key. However, the same users are able to update the app description from the Posit Connect GUI.

I tried using appTitle but it doesn't seem to map the description field. The metadata field isn't as useful, since it's only stored in the local .dcf file, and not on the server side. It also would be great if we could set arbitrary key/value pairs on the server side!

My use case is publishing Shiny apps to Posit Connect, and documenting aspects of the deployment (config configuration name, Git commit ID, date, time, user, etc.) alongside the deployed app. The description field is the only place that seems suitable.

Thanks.

@hadley hadley added the feature a feature request or enhancement label Aug 10, 2023
@hadley
Copy link
Member

hadley commented Aug 10, 2023

Are you sure it's not the appTitle?

@capncodewash
Copy link
Author

capncodewash commented Aug 11, 2023

Hi Hadley (thanks for all the R packages by the way!)

appTitle doesn't appear to affect the description field on either first publication or on app update. For reference, I'm using:

  • Posit Connect v2023.03.0 Build v2023.03.0-0-g927f384
  • rsconnect package version 0.8.29
  • R 4.2.2

Publish command (note, I'm updating an existing app here):

rsconnect::deployApp(appDir = ".",
                     account = "<redacted-my-email>",
                     server = "rstudio-connect.<redacted-my-domain>",
                     appName = "demoshinyapp-production",
                     appId = 303,
                     appTitle = "This is a custom description.",
                     launch.browser = function(url) {
                         message("Deployment completed: ", url)
                     },
                     lint = FALSE,
                     metadata = list(asMultiple = FALSE, asStatic = FALSE),
                     logLevel = "verbose",
                     forceUpdate = TRUE)

Result:

rsconnect-republish-update-appTitle

I can't currently upgrade for normal usage to rsconnect v1.0.1 for my main projects due to renv issues ( #926 ), but I tested it with v1.0.1 on a throwaway 'Old Faithful Geyser' demo app that doesn't have an renv lock file, and the appTitle string seemed to make its way to the 'friendly' app name in Connect, but the description field is empty. This is publishing for the first time:

rsconnect::deployApp(appDir = ".",
                     account = "<redacted-my-email>",
                     server = "rstudio-connect.<redacted-my-domain>",
                     appName = "shinypublishtest",
                     appTitle = "This is a custom description.",
                     launch.browser = function(url) {
                         message("Deployment completed: ", url)
                     },
                     lint = FALSE,
                     metadata = list(asMultiple = FALSE, asStatic = FALSE),
                     logLevel = "verbose")

Result:

rsconnect-1 0 1-blank-app-publish

So it seems like if you supply appTitle on first publication, it's used as a the friendly name, but on update (with forceUpdate) it doesn't replace the appName in Connect.

In neither case did the description field get updated - it just shows 'Click here to edit description' in Connect, so it's presumably blank in the database.

Apologies if this has been fixed in Connect - I'm not able to upgrade quite yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants