rsconnect icon indicating copy to clipboard operation
rsconnect copied to clipboard

Published content titles are lowercased

Open scubastevew opened this issue 2 years ago • 8 comments

The the development version of rsconnect sets the name of the content to lowercase.

For example, when publishing to posit.cloud, the content is named EnLS3Mz3UZ and the resulting published content is named enls3mz3uz.

Steps to reproduce:

  1. Create an HTML file that is camel cased
  2. Publish the HTML to posit.cloud or Posit Connect

rsconnect::deployDoc('EnLS3Mz3UZ.html', server='posit.cloud') rsconnect::deployDoc('EnLS3Mz3UZ.html', server='')

What the published content looks like with the development version of rsconnect: Screenshot 2023-10-26 at 1 38 45 PM

What the published content looks like with the CRAN release of rsconnect. Screenshot 2023-10-26 at 1 46 54 PM

scubastevew avatar Oct 26 '23 20:10 scubastevew

I just tried with the latest dev version and it looks ok to me:

Screenshot 2023-10-26 at 16 26 26

But I do wonder if I'm publishing somewhere different to you given that I have "your workspace" and you have "Content".

hadley avatar Oct 26 '23 21:10 hadley

Interesting. My screenshots above were publishing to Posit Connect.

This is what it looks like in my posit.cloud:

Dev version (1.1.1.9000) Screenshot 2023-10-26 at 2 30 10 PM

CRAN release (1.1.1): Screenshot 2023-10-26 at 2 30 14 PM

scubastevew avatar Oct 26 '23 21:10 scubastevew

Oops, I'm an idiot and was accidentially using the CRAN version. I see the same problem as you now 😄

hadley avatar Oct 26 '23 21:10 hadley

Looks like it's happening at https://github.com/rstudio/rsconnect/blob/main/R/title.R#L42, which seems to be by design. I wonder why this path wasn't previously travelled in the CRAN version?

hadley avatar Oct 26 '23 21:10 hadley

@aronatkins I think this might be because you switched from defaultAppName() to generateAppName() in #1021. defaultAppName() is more selective with its munging, only making more extreme modifications when deploying to shinyapps.io.

hadley avatar Oct 26 '23 21:10 hadley

I think this might be because you switched from defaultAppName() to generateAppName() in #1021.

@hadley Yep. That was my expectation, too. @scubastevew and I were chatting privately yesterday and I asked him to file this issue to track the problem.

aronatkins avatar Oct 27 '23 12:10 aronatkins

In 0.8.29, we used generateAppName() when we had an incoming appTitle and no appName: https://github.com/rstudio/rsconnect/blob/v0.8.29/R/deployApp.R#L678

Additionally, 0.8.29 used generateAppName() when there was no appTitle (meaning it fell back to path-based discovery): https://github.com/rstudio/rsconnect/blob/v0.8.29/R/deployApp.R#L735

With 0.8.29, a lower-cased content name is created, meaning that Connect uses that lower-cased name as the initial title.

Starting with rsconnect 1.0.0, we did not lower-case the content name, and the changes for https://github.com/rstudio/rsconnect/pull/1021 shifted us back to using generateAppName(), which down-cases path-derived names.

aronatkins avatar Oct 30 '23 14:10 aronatkins

Update:

shinyapps.io and Connect want name to be lower-cased and normalized. In the shinyapps.io case (and occasionally Connect), the name is used to define part of a URL path. Connect has a separate title field that is used for human-friendly names.

Posit Cloud wants name to be human-friendly; it is more a title than a name.

A summarization of the current behavior:

  • rsconnect::deployDoc("MyReport.Rmd") - computes a name of myreport and does not assign a title. Connect, shinyapps.io, and Posit Cloud all receive a myreport name.
  • rsconnect::deployDoc("MyReport.Rmd", appTitle="MyReport") - computes a name of myreport. Connect, shinyapps.io, and Posit Cloud all receive a myreport name. Connect also receives a MyReport title, which is displayed to the user.
  • IDE push-button deploy of "MyReport.Rmd" provides appName="myreport" and appTitle="MyReport" to rsconnect::deploy*. Connect, shinyapps.io, and Posit Cloud all receive a myreport name. Connect also receives a MyReport title, which is displayed to the user.

The IDE provides both name and title to rsconnect. Posit Cloud deployments currently use name rather than title, but after chatting with @scubastevew, it sounds like the title is more appropriate. The Posit Cloud content name is not used in URLs and should not have the same restrictions as the shinyapps.io content name.

@m-- Will Posit Cloud offer separate names (for URLs and computer-lookups) and titles (human friendly)? Are names supposed to be unique? The IDE currently drops the user-provided title when deploying to Posit Cloud, which was a surprise to me and @scubastevew.

aronatkins avatar Nov 15 '23 19:11 aronatkins