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

Posit Connect manifests should provide files as an object, not an array #815

Open
toph-allen opened this issue Dec 14, 2023 · 0 comments
Open

Comments

@toph-allen
Copy link
Contributor

Manifests for pins deployed to Connect have files fields that are flat arrays.

"files":["data.csv","data.rds","index.html"]

However, Connect's manifests have files in a JSON object, where the keys are the file names and the values are the checksums, like so:

"files": {
  "data.csv": {
    "checksum": "553e83c5e7e7d606ac0657ce3f805512"
  },
  "data.rds": {
    "checksum": "553e83c5e7e7d606ac0657ce3f805512"
  },
  "index.html": {
    "checksum": "553e83c5e7e7d606ac0657ce3f805512"
  }
}

So, for example, rsconnect-python cannot deploy manifests that Pins produces.

In the code: pins:::rsc_bundle_manifest provides the files as a flat array, and references rsconnect::createAppManifest.

# Extracted from rsconnect:::createAppManifest
rsc_bundle_manifest <- function(board, path) {
files <- fs::path_rel(fs::dir_ls(path, recurse = TRUE, type = "file"), path)

In rsconnect::createAppManifest:

https://github.com/rstudio/rsconnect/blob/d8c89dd9dd68fef6192fb4eef008ade1d65507ad/R/bundle.R#L150-L160

  # build the list of files to checksum
  files <- list.files(appDir, recursive = TRUE, all.files = TRUE,
                      full.names = FALSE)

  # provide checksums for all files
  filelist <- list()
  for (file in files) {
    filepath <- file.path(appDir, file)
    checksum <- list(checksum = fileMD5(filepath))
    filelist[[file]] <- I(checksum)
  }
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

No branches or pull requests

1 participant