diff --git a/R/compare.R b/R/compare.R index ffbcbea7..4ae3e588 100644 --- a/R/compare.R +++ b/R/compare.R @@ -41,7 +41,7 @@ compare_filesets <- function(target, current) { orderly_compare_packets <- function(target, current, location = NULL, allow_remote = NULL, - pull_metadata = FALSE, + fetch_metadata = FALSE, root = NULL) { root <- root_open(root, require_orderly = FALSE) validate_outpack_id(target, call = environment()) @@ -49,9 +49,9 @@ orderly_compare_packets <- function(target, current, options <- build_search_options(location = location, allow_remote = allow_remote, - pull_metadata = pull_metadata) + fetch_metadata = fetch_metadata) - if (options$pull_metadata) { + if (options$fetch_metadata) { orderly_location_fetch_metadata(options$location, root = root) } @@ -115,7 +115,7 @@ compare_file_contents <- function(cmp, files) { # very straightforward, and covers the case where the file only exists # remotely transparent. # - # pull_metadata is intentionally hardcoded to FALSE, regardless of what the + # fetch_metadata is intentionally hardcoded to FALSE, regardless of what the # user may have specified as an argument to orderly_compare_packets: the # latter would have already pulled the files once, and we don't need to do it # again. @@ -124,7 +124,7 @@ compare_file_contents <- function(cmp, files) { files = files, location = cmp$search_options$location, allow_remote = cmp$search_options$allow_remote, - pull_metadata = FALSE, + fetch_metadata = FALSE, root = cmp$root) orderly_copy_files(cmp$current$id, @@ -132,7 +132,7 @@ compare_file_contents <- function(cmp, files) { files = files, location = cmp$search_options$location, allow_remote = cmp$search_options$allow_remote, - pull_metadata = FALSE, + fetch_metadata = FALSE, root = cmp$root) diff --git a/R/interactive.R b/R/interactive.R index 00ba070d..846272fa 100644 --- a/R/interactive.R +++ b/R/interactive.R @@ -81,10 +81,10 @@ detect_orderly_interactive_path <- function( ##' @export orderly_interactive_set_search_options <- function(location = NULL, allow_remote = NULL, - pull_metadata = FALSE) { + fetch_metadata = FALSE) { options <- build_search_options(location = location, allow_remote = allow_remote, - pull_metadata = pull_metadata) + fetch_metadata = fetch_metadata) .interactive$search_options <- options } diff --git a/R/location.R b/R/location.R index 628ada1f..2bc55e2f 100644 --- a/R/location.R +++ b/R/location.R @@ -396,7 +396,7 @@ orderly_location_pull_metadata <- function(...) { orderly_location_pull <- function(expr, name = NULL, location = NULL, - pull_metadata = FALSE, + fetch_metadata = FALSE, recursive = NULL, options = NULL, root = NULL) { @@ -410,14 +410,14 @@ orderly_location_pull <- function(expr, name = name, location = location, allow_remote = TRUE, - pull_metadata = pull_metadata, + fetch_metadata = fetch_metadata, root = root) } if (length(ids) == 0 || (length(ids) == 1 && is.na(ids))) { - if (!pull_metadata) { + if (!fetch_metadata) { hint <- c(i = paste("Did you forget to pull metadata? You can do this", - "by using the argument {.code pull_metadata = TRUE}", + "by using the argument {.code fetch_metadata = TRUE}", "in the call to 'orderly_location_pull()', or", "by running 'orderly_location_fetch_metadata()'")) } else { diff --git a/R/metadata.R b/R/metadata.R index 8b06c757..2fcc425f 100644 --- a/R/metadata.R +++ b/R/metadata.R @@ -305,7 +305,7 @@ orderly_dependency <- function(name, query, files) { parameters = ctx$parameters, location = search_options$location, allow_remote = search_options$allow_remote, - pull_metadata = search_options$pull_metadata, + fetch_metadata = search_options$fetch_metadata, envir = ctx$envir, root = ctx$root) } diff --git a/R/outpack_helpers.R b/R/outpack_helpers.R index 533500a3..32d97ae4 100644 --- a/R/outpack_helpers.R +++ b/R/outpack_helpers.R @@ -82,7 +82,7 @@ ##' @export orderly_copy_files <- function(expr, files, dest, overwrite = TRUE, name = NULL, location = NULL, - allow_remote = NULL, pull_metadata = FALSE, + allow_remote = NULL, fetch_metadata = FALSE, parameters = NULL, options = NULL, envir = parent.frame(), root = NULL) { @@ -92,7 +92,7 @@ orderly_copy_files <- function(expr, files, dest, overwrite = TRUE, ## allow_remote later in error messages. options <- build_search_options(location = location, allow_remote = allow_remote, - pull_metadata = pull_metadata) + fetch_metadata = fetch_metadata) ## Validate files and dest early; it gives a better error where this ## was not provided with names. @@ -112,7 +112,7 @@ orderly_copy_files <- function(expr, files, dest, overwrite = TRUE, parameters = parameters, location = options$location, allow_remote = options$allow_remote, - pull_metadata = options$pull_metadata, + fetch_metadata = options$fetch_metadata, root = root) if (length(id) > 1) { cli::cli_abort( diff --git a/R/outpack_packet.R b/R/outpack_packet.R index 6a3026f9..2669c089 100644 --- a/R/outpack_packet.R +++ b/R/outpack_packet.R @@ -177,7 +177,7 @@ outpack_packet_use_dependency <- function(packet, query, files, envir = envir, location = search_options$location, allow_remote = search_options$allow_remote, - pull_metadata = search_options$pull_metadata, + fetch_metadata = search_options$fetch_metadata, root = packet$root) if (is.na(id)) { explanation <- orderly_query_explain( @@ -201,7 +201,7 @@ outpack_packet_use_dependency <- function(packet, query, files, result <- orderly_copy_files(id, files = files, dest = packet$path, location = search_options$location, allow_remote = search_options$allow_remote, - pull_metadata = search_options$pull_metadata, + fetch_metadata = search_options$fetch_metadata, overwrite = overwrite, envir = envir, root = packet$root) diff --git a/R/outpack_tools.R b/R/outpack_tools.R index f6424fdc..c15036e4 100644 --- a/R/outpack_tools.R +++ b/R/outpack_tools.R @@ -198,7 +198,8 @@ ##' ##' @export orderly_metadata_extract <- function(expr = NULL, name = NULL, location = NULL, - allow_remote = NULL, pull_metadata = FALSE, + allow_remote = NULL, + fetch_metadata = FALSE, extract = NULL, options = NULL, root = NULL) { root <- root_open(root, require_orderly = FALSE) @@ -211,7 +212,7 @@ orderly_metadata_extract <- function(expr = NULL, name = NULL, location = NULL, name = name, location = location, allow_remote = allow_remote, - pull_metadata = pull_metadata, + fetch_metadata = fetch_metadata, root = root) } extract <- parse_extract(extract, environment()) diff --git a/R/query_explain.R b/R/query_explain.R index 8c20d02b..476a079f 100644 --- a/R/query_explain.R +++ b/R/query_explain.R @@ -25,7 +25,7 @@ orderly_query_explain <- function(expr, name = NULL, scope = NULL, found <- orderly_search(query, parameters = parameters, envir = envir, location = location, allow_remote = allow_remote, - pull_metadata = FALSE, + fetch_metadata = FALSE, root = root) query_simplified <- query_simplify(query) ret <- list(found = found, @@ -40,7 +40,7 @@ orderly_query_explain <- function(expr, name = NULL, scope = NULL, envir = envir, location = location, allow_remote = allow_remote, - pull_metadata = FALSE, + fetch_metadata = FALSE, root = root) ret$parts[[name]] <- list( name = name, diff --git a/R/query_index.R b/R/query_index.R index ac287698..5fb6abbb 100644 --- a/R/query_index.R +++ b/R/query_index.R @@ -86,7 +86,7 @@ query_index <- R6::R6Class( new_query_index <- function(root, options) { root <- root_open(root, require_orderly = FALSE) - if (options$pull_metadata) { + if (options$fetch_metadata) { orderly_location_fetch_metadata(options$location, root = root) } idx <- root$index$data() diff --git a/R/query_search.R b/R/query_search.R index 31fbaf25..e28dcc13 100644 --- a/R/query_search.R +++ b/R/query_search.R @@ -21,7 +21,7 @@ ##' ##' @param options **DEPRECATED**. Please don't use this any more, and ##' instead use the arguments `location`, `allow_remote` and -##' `pull_metadata` directly. +##' `fetch_metadata` directly. ##' ##' @return A character vector of matching ids. In the case of no ##' match from a query returning a single value (e.g., `latest(...)` @@ -32,14 +32,14 @@ orderly_search <- function(expr, name = NULL, scope = NULL, subquery = NULL, parameters = NULL, envir = parent.frame(), location = NULL, allow_remote = NULL, - pull_metadata = FALSE, options = NULL, + fetch_metadata = FALSE, options = NULL, root = NULL) { root <- root_open(root, require_orderly = FALSE) compatibility_fix_options(options, "orderly_search") query <- as_orderly_query(expr, name, scope, subquery) options <- build_search_options(location = location, allow_remote = allow_remote, - pull_metadata = pull_metadata) + fetch_metadata = fetch_metadata) validate_parameters(parameters, environment()) orderly_query_eval(query, parameters, envir, options, root, call = environment()) @@ -64,9 +64,9 @@ orderly_search <- function(expr, name = NULL, scope = NULL, subquery = NULL, ##' you might pull a large quantity of data. The default is `NULL`. This is ##' `TRUE` if remote locations are listed explicitly as a character ##' vector in the `location` argument, or if you have specified -##' `pull_metadata = TRUE`, otherwise `FALSE`. +##' `fetch_metadata = TRUE`, otherwise `FALSE`. ##' -##' @param pull_metadata Logical, indicating if we should pull +##' @param fetch_metadata Logical, indicating if we should pull ##' metadata immediately before the search. If `location` is given, ##' then we will pass this through to ##' [orderly2::orderly_location_fetch_metadata] to filter locations @@ -76,7 +76,7 @@ orderly_search <- function(expr, name = NULL, scope = NULL, subquery = NULL, ##' needlessly slow. ##' ##' @return An object of class `orderly_search_options` which should -##' not be modified after creation (but see note about `pull_metadata`) +##' not be modified after creation (but see note about `fetch_metadata`) ##' ##' @export orderly_search_options <- function(location = NULL, @@ -85,7 +85,8 @@ orderly_search_options <- function(location = NULL, cli::cli_warn( c("Use of 'orderly_search_options' is deprecated", i = paste("You should just pass these arguments directly into functions", - "that previously accepted 'options'")), + "that previously accepted 'options'"), + i = "Please note that 'pull_metadata' has become 'fetch_metadata'"), .frequency = "regularly", .frequency_id = "orderly_search_options") build_search_options(location, allow_remote, pull_metadata) @@ -99,7 +100,7 @@ compatibility_fix_options <- function(options, name, cli::cli_warn( c("Use of '{arg}' in '{name}()' is deprecated and will be removed soon", i = paste("Please pass the arguments to options ('location',", - "'allow_remote' and 'pull_metadata') directly to '{name}'"), + "'allow_remote' and 'fetch_metadata') directly to '{name}'"), "!" = paste("If you have {.strong also} passed these options in", "to your function I am about to silently overwrite them")), .frequency = "regularly", @@ -111,22 +112,23 @@ compatibility_fix_options <- function(options, name, build_search_options <- function(location = NULL, allow_remote = NULL, - pull_metadata = FALSE, call = parent.frame()) { + fetch_metadata = FALSE, + call = parent.frame()) { if (!is.null(location)) { assert_character(location, call = call) } has_remote_location <- !is.null(location) && length(setdiff(location, c("local", "orphan")) > 0) - assert_scalar_logical(pull_metadata, call = call) + assert_scalar_logical(fetch_metadata, call = call) if (is.null(allow_remote)) { - allow_remote <- has_remote_location || pull_metadata + allow_remote <- has_remote_location || fetch_metadata } else { assert_scalar_logical(allow_remote, call = call) } ret <- list(location = location, allow_remote = allow_remote, - pull_metadata = pull_metadata) + fetch_metadata = fetch_metadata) class(ret) <- "orderly_search_options" ret } diff --git a/R/run.R b/R/run.R index 1eebb233..15b20662 100644 --- a/R/run.R +++ b/R/run.R @@ -35,7 +35,7 @@ ##' ##' @section Which packets might be selected from locations?: ##' -##' The arguments `location`, `allow_remote` and `pull_metadata` +##' The arguments `location`, `allow_remote` and `fetch_metadata` ##' control where outpack searches for packets with the given query ##' and if anything might be moved over the network (or from one ##' outpack archive to another). By default everything is resolved @@ -48,7 +48,7 @@ ##' same content anywhere else in an unpacked packet we will reuse ##' the same content without re-fetching. ##' -##' If `pull_metadata = TRUE`, then we will refresh location metadata +##' If `fetch_metadata = TRUE`, then we will refresh location metadata ##' before pulling, and the `location` argument controls which ##' locations are pulled from. ##' @@ -68,7 +68,7 @@ ##' as they currently exist on production right now with the options: ##' ##' ``` -##' location = "production", pull_metadata = TRUE +##' location = "production", fetch_metadata = TRUE ##' ``` ##' ##' which updates your current metadata from production, then runs @@ -127,7 +127,7 @@ ##' ##' @param search_options **DEPRECATED**. Please don't use this any ##' more, and instead use the arguments `location`, `allow_remote` -##' and `pull_metadata` directly. +##' and `fetch_metadata` directly. ##' ##' @param root The path to the root directory, or `NULL` (the ##' default) to search for one from the current working @@ -155,7 +155,7 @@ ##' fs::dir_delete(path) orderly_run <- function(name, parameters = NULL, envir = NULL, echo = TRUE, location = NULL, allow_remote = NULL, - pull_metadata = FALSE, search_options = NULL, + fetch_metadata = FALSE, search_options = NULL, root = NULL) { env_root_src <- Sys.getenv("ORDERLY_SRC_ROOT", NA_character_) root <- root_open(root, require_orderly = is.na(env_root_src), @@ -181,7 +181,7 @@ orderly_run <- function(name, parameters = NULL, envir = NULL, echo = TRUE, search_options <- build_search_options(location = location, allow_remote = allow_remote, - pull_metadata = pull_metadata) + fetch_metadata = fetch_metadata) id <- outpack_id() path <- file.path(root_src, "draft", name, id) diff --git a/R/validate.R b/R/validate.R index 3f1aa861..e67f0cb0 100644 --- a/R/validate.R +++ b/R/validate.R @@ -57,7 +57,7 @@ orderly_validate_archive <- function(expr = NULL, name = NULL, name = name, location = "local", allow_remote = FALSE, - pull_metadata = FALSE, + fetch_metadata = FALSE, root = root) } diff --git a/man/orderly_compare_packets.Rd b/man/orderly_compare_packets.Rd index c1cb8abf..7e407528 100644 --- a/man/orderly_compare_packets.Rd +++ b/man/orderly_compare_packets.Rd @@ -9,7 +9,7 @@ orderly_compare_packets( current, location = NULL, allow_remote = NULL, - pull_metadata = FALSE, + fetch_metadata = FALSE, root = NULL ) } @@ -28,9 +28,9 @@ only to a location that we have metadata from). If this is you might pull a large quantity of data. The default is \code{NULL}. This is \code{TRUE} if remote locations are listed explicitly as a character vector in the \code{location} argument, or if you have specified -\code{pull_metadata = TRUE}, otherwise \code{FALSE}.} +\code{fetch_metadata = TRUE}, otherwise \code{FALSE}.} -\item{pull_metadata}{Logical, indicating if we should pull +\item{fetch_metadata}{Logical, indicating if we should pull metadata immediately before the search. If \code{location} is given, then we will pass this through to \link{orderly_location_fetch_metadata} to filter locations diff --git a/man/orderly_copy_files.Rd b/man/orderly_copy_files.Rd index 2f786406..e2c0f73c 100644 --- a/man/orderly_copy_files.Rd +++ b/man/orderly_copy_files.Rd @@ -12,7 +12,7 @@ orderly_copy_files( name = NULL, location = NULL, allow_remote = NULL, - pull_metadata = FALSE, + fetch_metadata = FALSE, parameters = NULL, options = NULL, envir = parent.frame(), @@ -70,9 +70,9 @@ only to a location that we have metadata from). If this is you might pull a large quantity of data. The default is \code{NULL}. This is \code{TRUE} if remote locations are listed explicitly as a character vector in the \code{location} argument, or if you have specified -\code{pull_metadata = TRUE}, otherwise \code{FALSE}.} +\code{fetch_metadata = TRUE}, otherwise \code{FALSE}.} -\item{pull_metadata}{Logical, indicating if we should pull +\item{fetch_metadata}{Logical, indicating if we should pull metadata immediately before the search. If \code{location} is given, then we will pass this through to \link{orderly_location_fetch_metadata} to filter locations @@ -86,7 +86,7 @@ into the query (using the \verb{this:} prefix)} \item{options}{\strong{DEPRECATED}. Please don't use this any more, and instead use the arguments \code{location}, \code{allow_remote} and -\code{pull_metadata} directly.} +\code{fetch_metadata} directly.} \item{envir}{Optionally, an environment to substitute into the query (using the \verb{environment:} prefix). The default here is to diff --git a/man/orderly_interactive_set_search_options.Rd b/man/orderly_interactive_set_search_options.Rd index bc848049..13996fbb 100644 --- a/man/orderly_interactive_set_search_options.Rd +++ b/man/orderly_interactive_set_search_options.Rd @@ -7,7 +7,7 @@ orderly_interactive_set_search_options( location = NULL, allow_remote = NULL, - pull_metadata = FALSE + fetch_metadata = FALSE ) } \arguments{ @@ -21,9 +21,9 @@ only to a location that we have metadata from). If this is you might pull a large quantity of data. The default is \code{NULL}. This is \code{TRUE} if remote locations are listed explicitly as a character vector in the \code{location} argument, or if you have specified -\code{pull_metadata = TRUE}, otherwise \code{FALSE}.} +\code{fetch_metadata = TRUE}, otherwise \code{FALSE}.} -\item{pull_metadata}{Logical, indicating if we should pull +\item{fetch_metadata}{Logical, indicating if we should pull metadata immediately before the search. If \code{location} is given, then we will pass this through to \link{orderly_location_fetch_metadata} to filter locations diff --git a/man/orderly_location_fetch_metadata.Rd b/man/orderly_location_fetch_metadata.Rd new file mode 100644 index 00000000..fddf77f0 --- /dev/null +++ b/man/orderly_location_fetch_metadata.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/location.R +\name{orderly_location_fetch_metadata} +\alias{orderly_location_fetch_metadata} +\title{Fetch metadata from a location} +\usage{ +orderly_location_fetch_metadata(location = NULL, root = NULL) +} +\arguments{ +\item{location}{The name of a location to pull from (see +\link{orderly_location_list} for possible values). If not +given, pulls from all locations. The "local" and "orphan" +locations are always up to date and pulling metadata from them +does nothing.} + +\item{root}{The path to the root directory, or \code{NULL} (the +default) to search for one from the current working +directory. This function does not require that the directory is +configured for orderly, and can be any \code{outpack} root (see +\link{orderly_init} for details).} +} +\value{ +Nothing +} +\description{ +Fetch metadata from a location, updating the index. This should +always be relatively quick as it updates only small files that +contain information about what can be found in remote packets. +} diff --git a/man/orderly_location_pull.Rd b/man/orderly_location_pull.Rd index 7352a7ba..5c43fb92 100644 --- a/man/orderly_location_pull.Rd +++ b/man/orderly_location_pull.Rd @@ -8,7 +8,7 @@ orderly_location_pull( expr, name = NULL, location = NULL, - pull_metadata = FALSE, + fetch_metadata = FALSE, recursive = NULL, options = NULL, root = NULL @@ -24,7 +24,7 @@ will be intersected with \code{scope} arg and is a shorthand way of running \item{location}{Optional vector of locations to pull from. We might in future expand this to allow wildcards or exceptions.} -\item{pull_metadata}{Logical, indicating if we should pull +\item{fetch_metadata}{Logical, indicating if we should pull metadata immediately before the search. If \code{location} is given, then we will pass this through to \link{orderly_location_fetch_metadata} to filter locations @@ -41,7 +41,7 @@ we default to the value given by the the configuration option \item{options}{\strong{DEPRECATED}. Please don't use this any more, and instead use the arguments \code{location}, \code{allow_remote} and -\code{pull_metadata} directly.} +\code{fetch_metadata} directly.} \item{root}{The path to the root directory, or \code{NULL} (the default) to search for one from the current working diff --git a/man/orderly_metadata_extract.Rd b/man/orderly_metadata_extract.Rd index 696a075c..a0fd1ff4 100644 --- a/man/orderly_metadata_extract.Rd +++ b/man/orderly_metadata_extract.Rd @@ -9,7 +9,7 @@ orderly_metadata_extract( name = NULL, location = NULL, allow_remote = NULL, - pull_metadata = FALSE, + fetch_metadata = FALSE, extract = NULL, options = NULL, root = NULL @@ -32,9 +32,9 @@ only to a location that we have metadata from). If this is you might pull a large quantity of data. The default is \code{NULL}. This is \code{TRUE} if remote locations are listed explicitly as a character vector in the \code{location} argument, or if you have specified -\code{pull_metadata = TRUE}, otherwise \code{FALSE}.} +\code{fetch_metadata = TRUE}, otherwise \code{FALSE}.} -\item{pull_metadata}{Logical, indicating if we should pull +\item{fetch_metadata}{Logical, indicating if we should pull metadata immediately before the search. If \code{location} is given, then we will pass this through to \link{orderly_location_fetch_metadata} to filter locations @@ -48,7 +48,7 @@ named. See Details for the format.} \item{options}{\strong{DEPRECATED}. Please don't use this any more, and instead use the arguments \code{location}, \code{allow_remote} and -\code{pull_metadata} directly.} +\code{fetch_metadata} directly.} \item{root}{The path to the root directory, or \code{NULL} (the default) to search for one from the current working diff --git a/man/orderly_query_explain.Rd b/man/orderly_query_explain.Rd index a1fb9a7b..0814a7da 100644 --- a/man/orderly_query_explain.Rd +++ b/man/orderly_query_explain.Rd @@ -47,7 +47,7 @@ only to a location that we have metadata from). If this is you might pull a large quantity of data. The default is \code{NULL}. This is \code{TRUE} if remote locations are listed explicitly as a character vector in the \code{location} argument, or if you have specified -\code{pull_metadata = TRUE}, otherwise \code{FALSE}.} +\code{fetch_metadata = TRUE}, otherwise \code{FALSE}.} \item{root}{The path to the root directory, or \code{NULL} (the default) to search for one from the current working diff --git a/man/orderly_run.Rd b/man/orderly_run.Rd index d0f79c3d..d49a2bfe 100644 --- a/man/orderly_run.Rd +++ b/man/orderly_run.Rd @@ -11,7 +11,7 @@ orderly_run( echo = TRUE, location = NULL, allow_remote = NULL, - pull_metadata = FALSE, + fetch_metadata = FALSE, search_options = NULL, root = NULL ) @@ -42,9 +42,9 @@ only to a location that we have metadata from). If this is you might pull a large quantity of data. The default is \code{NULL}. This is \code{TRUE} if remote locations are listed explicitly as a character vector in the \code{location} argument, or if you have specified -\code{pull_metadata = TRUE}, otherwise \code{FALSE}.} +\code{fetch_metadata = TRUE}, otherwise \code{FALSE}.} -\item{pull_metadata}{Logical, indicating if we should pull +\item{fetch_metadata}{Logical, indicating if we should pull metadata immediately before the search. If \code{location} is given, then we will pass this through to \link{orderly_location_fetch_metadata} to filter locations @@ -55,7 +55,7 @@ needlessly slow.} \item{search_options}{\strong{DEPRECATED}. Please don't use this any more, and instead use the arguments \code{location}, \code{allow_remote} -and \code{pull_metadata} directly.} +and \code{fetch_metadata} directly.} \item{root}{The path to the root directory, or \code{NULL} (the default) to search for one from the current working @@ -107,7 +107,7 @@ can specify the search options (root specific) with \section{Which packets might be selected from locations?}{ -The arguments \code{location}, \code{allow_remote} and \code{pull_metadata} +The arguments \code{location}, \code{allow_remote} and \code{fetch_metadata} control where outpack searches for packets with the given query and if anything might be moved over the network (or from one outpack archive to another). By default everything is resolved @@ -119,7 +119,7 @@ not locally present this might not be needed - if you have the same content anywhere else in an unpacked packet we will reuse the same content without re-fetching. -If \code{pull_metadata = TRUE}, then we will refresh location metadata +If \code{fetch_metadata = TRUE}, then we will refresh location metadata before pulling, and the \code{location} argument controls which locations are pulled from. } @@ -141,7 +141,7 @@ all locations \emph{except} local default behaviour). In addition, you could resolve dependencies as they currently exist on production right now with the options: -\if{html}{\out{
}}\preformatted{location = "production", pull_metadata = TRUE +\if{html}{\out{
}}\preformatted{location = "production", fetch_metadata = TRUE }\if{html}{\out{
}} which updates your current metadata from production, then runs diff --git a/man/orderly_search.Rd b/man/orderly_search.Rd index d43c9421..00653b94 100644 --- a/man/orderly_search.Rd +++ b/man/orderly_search.Rd @@ -13,7 +13,7 @@ orderly_search( envir = parent.frame(), location = NULL, allow_remote = NULL, - pull_metadata = FALSE, + fetch_metadata = FALSE, options = NULL, root = NULL ) @@ -49,9 +49,9 @@ only to a location that we have metadata from). If this is you might pull a large quantity of data. The default is \code{NULL}. This is \code{TRUE} if remote locations are listed explicitly as a character vector in the \code{location} argument, or if you have specified -\code{pull_metadata = TRUE}, otherwise \code{FALSE}.} +\code{fetch_metadata = TRUE}, otherwise \code{FALSE}.} -\item{pull_metadata}{Logical, indicating if we should pull +\item{fetch_metadata}{Logical, indicating if we should pull metadata immediately before the search. If \code{location} is given, then we will pass this through to \link{orderly_location_fetch_metadata} to filter locations @@ -62,7 +62,7 @@ needlessly slow.} \item{options}{\strong{DEPRECATED}. Please don't use this any more, and instead use the arguments \code{location}, \code{allow_remote} and -\code{pull_metadata} directly.} +\code{fetch_metadata} directly.} \item{root}{The path to the root directory, or \code{NULL} (the default) to search for one from the current working diff --git a/man/orderly_search_options.Rd b/man/orderly_search_options.Rd index 1c5997a2..a0bea1b0 100644 --- a/man/orderly_search_options.Rd +++ b/man/orderly_search_options.Rd @@ -21,9 +21,9 @@ only to a location that we have metadata from). If this is you might pull a large quantity of data. The default is \code{NULL}. This is \code{TRUE} if remote locations are listed explicitly as a character vector in the \code{location} argument, or if you have specified -\code{pull_metadata = TRUE}, otherwise \code{FALSE}.} +\code{fetch_metadata = TRUE}, otherwise \code{FALSE}.} -\item{pull_metadata}{Logical, indicating if we should pull +\item{fetch_metadata}{Logical, indicating if we should pull metadata immediately before the search. If \code{location} is given, then we will pass this through to \link{orderly_location_fetch_metadata} to filter locations @@ -34,7 +34,7 @@ needlessly slow.} } \value{ An object of class \code{orderly_search_options} which should -not be modified after creation (but see note about \code{pull_metadata}) +not be modified after creation (but see note about \code{fetch_metadata}) } \description{ Options for controlling how packet searches are carried out, for diff --git a/tests/testthat/test-compare.R b/tests/testthat/test-compare.R index 09a3ad1c..b6deea64 100644 --- a/tests/testthat/test-compare.R +++ b/tests/testthat/test-compare.R @@ -118,7 +118,7 @@ test_that("Can compare packets from remote", { "Packet .* not found in outpack index") result <- orderly_compare_packets(id1, id2, root = here, - pull_metadata = TRUE) + fetch_metadata = TRUE) expect_snapshot(orderly_comparison_explain(result, "files"), transform = scrub_packets(id1, id2)) diff --git a/tests/testthat/test-location.R b/tests/testthat/test-location.R index 4a97991b..49c90f65 100644 --- a/tests/testthat/test-location.R +++ b/tests/testthat/test-location.R @@ -972,7 +972,7 @@ test_that("can pull packets as a result of a query", { orderly_location_pull( "parameter:i < 3", name = "data", - pull_metadata = TRUE, + fetch_metadata = TRUE, root = root$dst$path)) expect_setequal(ids_moved, ids[1:2]) }) diff --git a/tests/testthat/test-outpack-packet.R b/tests/testthat/test-outpack-packet.R index 23bd338f..57d7b25e 100644 --- a/tests/testthat/test-outpack-packet.R +++ b/tests/testthat/test-outpack-packet.R @@ -740,7 +740,7 @@ test_that("can pull in dependency when not found, if requested", { expect_equal(nrow(root$a$index$data()$location), 0) expect_equal(length(root$a$index$data()$unpacked), 0) - options <- build_search_options(pull_metadata = TRUE, allow_remote = TRUE) + options <- build_search_options(fetch_metadata = TRUE, allow_remote = TRUE) suppressMessages( outpack_packet_use_dependency(p_a, query, c("data.rds" = "data.rds"), search_options = options)) diff --git a/tests/testthat/test-outpack-tools.R b/tests/testthat/test-outpack-tools.R index 588201e9..5470bb54 100644 --- a/tests/testthat/test-outpack-tools.R +++ b/tests/testthat/test-outpack-tools.R @@ -372,7 +372,7 @@ test_that("can differentiate remote metadata", { expect_equal(nrow(d3), 0) d4 <- orderly_metadata_extract(root = root, allow_remote = TRUE, - pull_metadata = TRUE) + fetch_metadata = TRUE) expect_equal(names(d4), c("id", "local", "location", "name", "parameters")) expect_equal(nrow(d4), 8) expect_equal(d4$local, rep(c(TRUE, FALSE), c(5, 3))) diff --git a/tests/testthat/test-query-search.R b/tests/testthat/test-query-search.R index f112dc86..553a7676 100644 --- a/tests/testthat/test-query-search.R +++ b/tests/testthat/test-query-search.R @@ -5,24 +5,24 @@ test_that("can construct search options", { unclass(defaults), list(location = NULL, allow_remote = FALSE, - pull_metadata = FALSE)) + fetch_metadata = FALSE)) opts <- build_search_options(location = c("x", "y"), - pull_metadata = TRUE) + fetch_metadata = TRUE) expect_s3_class(opts, "orderly_search_options") expect_mapequal( unclass(opts), list(location = c("x", "y"), allow_remote = TRUE, - pull_metadata = TRUE)) + fetch_metadata = TRUE)) }) -test_that("pull_metadata implies allow_remote", { - opts <- build_search_options(pull_metadata = TRUE) +test_that("fetch_metadata implies allow_remote", { + opts <- build_search_options(fetch_metadata = TRUE) expect_equal(opts, build_search_options(location = NULL, allow_remote = TRUE, - pull_metadata = TRUE)) + fetch_metadata = TRUE)) }) @@ -866,7 +866,7 @@ test_that("allow search before query", { character(0)) expect_equal( orderly_search(quote(name == "data"), root = root$a, - pull_metadata = TRUE, allow_remote = TRUE), + fetch_metadata = TRUE, allow_remote = TRUE), ids) expect_setequal(names(root$a$index$data()$metadata), ids) }) diff --git a/vignettes/collaboration.Rmd b/vignettes/collaboration.Rmd index 1f614145..2e9c49c8 100644 --- a/vignettes/collaboration.Rmd +++ b/vignettes/collaboration.Rmd @@ -176,7 +176,7 @@ Bob can now query for packets available on the server: ```{r, as = "bob", orderly_root = path_bob} orderly2::orderly_metadata_extract( name = "data", - allow_remote = TRUE, pull_metadata = TRUE) + allow_remote = TRUE, fetch_metadata = TRUE) ``` Having seen there is a new "data" packet here, he can pull this down locally (TODO: mrc-4414 makes this nicer): diff --git a/vignettes/dependencies.Rmd b/vignettes/dependencies.Rmd index 451e567a..bfea5270 100644 --- a/vignettes/dependencies.Rmd +++ b/vignettes/dependencies.Rmd @@ -264,7 +264,7 @@ There are three components here that affect how packets are selected * `location`: is a character vector of locations, matching your location names. Only packets that can be found at these locations will be considered. So if you have a mix of locally created packets as well as ones that other people can see, specifying `location = "server"` would limit to packets that are available on the server, which means that you will end up with dependencies that you colleagues would also get. * `allow_remote`: controls if we are willing to download files from a location in order to satisfy a dependency. If `TRUE`, then when you run the report, it might download files if more recent packets are available on a location than what you have locally. -* `pull_metadata`: only has an effect if `allow_remote` is also `TRUE`; this causes the metadata to be refreshed before dependency resolution. +* `fetch_metadata`: only has an effect if `allow_remote` is also `TRUE`; this causes the metadata to be refreshed before dependency resolution. There is further discussion of the details in `?orderly_run`