rsconnect icon indicating copy to clipboard operation
rsconnect copied to clipboard

forgetDeployment cannot forget documents

Open aronatkins opened this issue 2 years ago • 1 comments

Given a directory containing two standalone Quarto documents; both have been separately deployed.

The rsconnect deployment hierarchy contains:

rsconnect/documents/dangerous.qmd/SERVER1/USER1/dangerous.dcf
rsconnect/documents/index.qmd/SERVER2/USER2/index-name.dcf

Both of these records are enumerated by rsconnect::deployments(), but they cannot be individually removed by rsconnect::forgetDeployment.

aronatkins avatar May 11 '23 12:05 aronatkins

Reprex:

td <- tempfile()
dir.create(td); setwd(td)

writeLines("hi", "bar.qmd")
writeLines("hi", "foo.qmd")

library(rsconnect)

deployDoc("bar.qmd", server = "colorado.posit.co")
deployDoc("foo.qmd", server = "colorado.posit.co")
deployments()

forgetDeployment(name = "bar", account = "account", server = "colorado.posit.co")
#> No deployment of /Users/hadleywickham/Documents/rstudio/rsconnect to 'bar' on colorado.posit.co found.

I think the problem is that forgetDeployments() calls deploymentConfigFile() directly, rather than looking up the deploymentFile from the return value of deployments().

I think we should also make the function specification more flexible so you can just say forgetDeployment(name = "bar") (or maybe even forgetDeployment("bar") by tweaking the argument order), rather than having to spell out all three arguments.

hadley avatar Oct 27 '23 15:10 hadley