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

Save deployment refactoring #702

Merged
merged 8 commits into from
Feb 24, 2023
Merged

Save deployment refactoring #702

merged 8 commits into from
Feb 24, 2023

Conversation

hadley
Copy link
Member

@hadley hadley commented Feb 23, 2023

This is a refactoring that shouldn't change behaviour compared to released rsconnect.

I verified expected behaviour using this script:

  1. Create a new project called testdeploy{random number}
  2. Create empty index.Rmd
  3. Call rsconnect::deployApp().
  4. Deployment should succeed & app opens in browser
  5. Call rsconnect::deployApp() again.
  6. Deployment should succeed & app opens in browser
  7. Run rsconnect::forgetDeployment() and press enter.
  8. Should be prompted to confirm that existing app is the same one.
  9. Call rsconnect::deployApp() again.
  10. Deployment should succeed & app opens in browser

@hadley hadley requested a review from aronatkins February 23, 2023 16:59
@hadley
Copy link
Member Author

hadley commented Feb 23, 2023

I have made a small behaviour change in the interests of making the user feedback more actionable — if you say you don't want to update the existing app, it now creates a new app.

@hadley
Copy link
Member Author

hadley commented Feb 23, 2023

Ooops, I should have tested that before implementing — connect requires unique names.

@hadley
Copy link
Member Author

hadley commented Feb 23, 2023

Re-tested and back to the original behaviour, but with better user feedback.

Copy link
Contributor

@aronatkins aronatkins left a comment

Choose a reason for hiding this comment

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

What is the workflow when rsconnect discovers a default target that has been deleted on the server? The target produced by deploymentTarget has only considered on-disk state, which may be stale?

R/deployApp.R Outdated
app <- client$getApplication(target$appId)
# Use appId from previous deployment
if (!is.null(target$appId)) {
return(client$getApplication(target$appId))
Copy link
Contributor

Choose a reason for hiding this comment

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

What should happen if the target app ID has been deleted? The old flow would leave app = NULL and try some other option.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just tried it out, and I think if the application id no longer exists, then getApplication() will error with a 404. That's probably worth considering in more detail (and I'll add a fall back in case getApplication() does return NULL in other cases), but I think it's out of scope for this PR.

@hadley hadley merged commit 053edbd into main Feb 24, 2023
@hadley hadley deleted the saveDeployment-refactoring branch February 24, 2023 17:01
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.

2 participants