Skip to content

Commit

Permalink
Added force= option for deleting assets/versions or rejecting probation.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Feb 3, 2025
1 parent 2478ce8 commit 8946fe1
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 19 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: gobbler
Version: 0.3.11
Date: 2025-01-28
Version: 0.3.12
Date: 2025-02-03
Title: Interface to the gobbler service
Description:
Friendly interface to the gobbler service.
Expand Down
6 changes: 4 additions & 2 deletions R/rejectProbation.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#' @param project String containing the project name.
#' @param asset String containing the asset name.
#' @param version String containing the version name.
#' @param force Logical scalar indicating that the asset should be forcibly removed if it contains invalid files.
#' If this needs to be set to \code{TRUE}, users may need to call \code{\link{refreshUsage}} afterwards to correct project-level usage statistics.
#' @inheritParams createProject
#'
#' @return \code{NULL} is invisibly returned upon successful rejection.
Expand Down Expand Up @@ -33,7 +35,7 @@
#' listVersions("test", "probation", registry=info$registry)
#'
#' @export
rejectProbation <- function(project, asset, version, staging, url) {
dump_request(staging, url, "reject_probation", list(project=project, asset=asset, version=version))
rejectProbation <- function(project, asset, version, staging, url, force=FALSE) {
dump_request(staging, url, "reject_probation", list(project=project, asset=asset, version=version, force=force))
invisible(NULL)
}
10 changes: 6 additions & 4 deletions R/removeAsset.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
#'
#' Remove an asset of the project from the registry.
#'
#' @param project String containing the project to remove.
#' @param asset String containing the asset to remove.
#' @param project String specifying the project containing the asset to remove.
#' @param asset String specifying the asset to remove.
#' @param force Logical scalar indicating that the asset should be forcibly removed if it contains invalid files.
#' If this needs to be set to \code{TRUE}, users may need to call \code{\link{refreshUsage}} afterwards to correct project-level usage statistics.
#' @inheritParams createProject
#'
#' @return \code{NULL} is invisibly returned if the asset was successfully removed.
Expand All @@ -29,7 +31,7 @@
#' listAssets("test", registry=info$registry)
#'
#' @export
removeAsset <- function(project, asset, staging, url) {
dump_request(staging, url, "delete_asset", list(project=project, asset=asset))
removeAsset <- function(project, asset, staging, url, force=FALSE) {
dump_request(staging, url, "delete_asset", list(project=project, asset=asset, force=force))
invisible(NULL)
}
11 changes: 7 additions & 4 deletions R/removeVersion.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
#'
#' Remove a version of an asset of a project from the registry.
#'
#' @param project String containing the project to remove.
#' @param asset String containing the asset to remove.
#' @param project String specifying the project containing the version of the asset to remove.
#' @param asset String specifying the asset containing the version to remove.
#' @param version String containing the version of the asset to remove.
#' @param force Logical scalar indicating that the asset should be forcibly removed if it contains invalid files.
#' If this needs to be set to \code{TRUE}, users may need to call \code{\link{refreshUsage}} to correct project-level usage statistics.
#' Similarly, \code{\link{refreshLatest}} may also need to be called.
#' @inheritParams createProject
#'
#' @return \code{NULL} is invisibly returned if the version was successfully removed.
Expand All @@ -30,7 +33,7 @@
#' listVersions("test", "simple", registry=info$registry)
#'
#' @export
removeVersion <- function(project, asset, version, staging, url) {
dump_request(staging, url, "delete_version", list(project=project, asset=asset, version=version))
removeVersion <- function(project, asset, version, staging, url, force=FALSE) {
dump_request(staging, url, "delete_version", list(project=project, asset=asset, version=version, force=force))
invisible(NULL)
}
5 changes: 4 additions & 1 deletion man/rejectProbation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions man/removeAsset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions man/removeVersion.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8946fe1

Please sign in to comment.