Skip to content

Commit

Permalink
Use url of repo at latest commit as "used" argument in synStore() for…
Browse files Browse the repository at this point in the history
… provenance
  • Loading branch information
pranavanba committed Oct 24, 2023
1 parent 6a81913 commit 1de7e95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sts_synindex_external.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ synapse_manifest_to_upload <-
s3_file_key = gsub("cohort_", "cohort=", s3_file_key))

# Index each file in Synapse
latest_commit <- gh::gh("/repos/:owner/:repo/commits/main", owner = "Sage-Bionetworks", repo = "recover-parquet-external")
latest_commit_tree_url <- latest_commit$html_url %>% stringr::str_replace("commit", "tree")

if(nrow(synapse_manifest_to_upload) > 0){
for(file_number in seq_len(nrow(synapse_manifest_to_upload))){
tmp <- synapse_manifest_to_upload[file_number, c("path", "parent", "s3_file_key")]
Expand All @@ -228,7 +231,7 @@ if(nrow(synapse_manifest_to_upload) > 0){
parentId = tmp$parent,
name = new_fileName)

f <- synStore(f, activity = "Indexing", activityDescription = "Indexing external parquet datasets", used = PARQUET_FOLDER_INTERNAL, executed = "")
f <- synStore(f, activity = "Indexing", activityDescription = "Indexing external parquet datasets", used = PARQUET_FOLDER_INTERNAL, executed = latest_commit_tree_url)

}
}

0 comments on commit 1de7e95

Please sign in to comment.