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

Add an option to require unique app names #538

Closed
scottmmjackson opened this issue Sep 7, 2021 · 5 comments · Fixed by #713
Closed

Add an option to require unique app names #538

scottmmjackson opened this issue Sep 7, 2021 · 5 comments · Fixed by #713
Labels
deploy ⛹️ feature a feature request or enhancement

Comments

@scottmmjackson
Copy link
Contributor

Our app name generator allows an operation mode wherein unique app names are required:

https://github.com/rstudio/rsconnect/blob/main/R/title.R#L32

However, every call site for this function in deployApp passes "FALSE" to that parameter.

We should add an option to permit changing this behavior such that non-unique names produce deployment errors.

@hadley
Copy link
Member

hadley commented Feb 21, 2023

If we're automatically generating the app name, shouldn't we always make it unique? i.e. is there some reason we need to make this a user facing argument?

@hadley hadley added feature a feature request or enhancement deploy ⛹️ labels Feb 21, 2023
@aronatkins
Copy link
Contributor

The only remaining exception is bookdown.org, which uses the content name to automatically construct its vanity URL. See bookdown::publish_book

@hadley
Copy link
Member

hadley commented Feb 23, 2023

Hmmm, I think different parts of rsconnect make different assumptions about what should happen if there's an existing deployment with the current name:

  • generateAppName() assumes we want to create a new deployment.
  • deployApp() assumes that we want to reuse an existing deployment if it exists.

I think we need to pick one of these two principles and stick to it, otherwise the package is going to inevitably be inconsistent.

(Personally, I'd be in favour of assuming we want to update an existing deployment, and minimise as much of the appName magic as possible in favour of giving the user a clear error message and forcing them to pick their own appName.)

@hadley
Copy link
Member

hadley commented Feb 24, 2023

And it occurs to me that the default appName should probably use appPrimaryDoc if set. Currently if you're publishing a bunch of individual documents from a common directory, they'll all have the same default appName.

@hadley
Copy link
Member

hadley commented Feb 25, 2023

Oooh, but it does, implicitly, because generateAppName() is passed recordPath, not appDir.

hadley added a commit that referenced this issue Feb 25, 2023
* No longer use `appTitle`
* Make the reasoning behind use of `recordPath` more clear
* Only munge for shinyApps
* Deprecates `generateAppName()`

Fixes #538
hadley added a commit that referenced this issue Feb 28, 2023
* No longer use `appTitle`
* Make the reasoning behind use of `recordPath` more clear
* Only munge for shinyApps

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

Successfully merging a pull request may close this issue.

3 participants