rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
133 stars 81 forks source link

Published content titles are lowercased #1022

Open scubastevew opened 11 months ago

scubastevew commented 11 months ago

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

hadley commented 11 months ago

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

scubastevew commented 11 months ago

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

hadley commented 11 months ago

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

hadley commented 11 months ago

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 commented 11 months ago

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

aronatkins commented 11 months ago

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 commented 11 months ago

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 commented 10 months ago

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:

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.