Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
4bd52fd
Increment version number to 0.2.4.9000
villegar Oct 19, 2026
136900a
Introduce new module with internal base R functions, %||%
villegar Oct 22, 2026
f6e09fc
Replace spected return size for vapply from "" to character(1)
villegar Oct 22, 2026
0ab8171
Add test for OR helper and updated version of safe_desc
villegar Oct 22, 2026
fda782a
Standardise the format for dates used across the package
villegar Oct 23, 2026
7bfc4ff
Inspect the length of the input for safe_time and return empty if con…
villegar Oct 23, 2026
05586af
Add tests to check multiple scenarios with different input timestamps
villegar Oct 23, 2026
acec187
Update website building with pkgdown, including a custom articules index
villegar Oct 23, 2026
a044203
Replace is_admin_con and is_audit_con with backend_can_audit, this ge…
villegar Oct 27, 2026
f61a648
Add new internal function set_crate_context to reduce code duplicatio…
villegar Oct 27, 2026
2774f36
Update calls to set_crate_context and add tests
villegar Oct 28, 2026
b5cabe7
Add new internal helpers: s3_method_not_available and s3_method_not_i…
villegar Oct 28, 2026
66bc9ad
Introduce helper to generalise backend's name, instead of a hardcoded…
villegar Oct 28, 2026
8254d03
Update tests for report when called for non-existent class and update…
villegar Oct 28, 2026
acd92bc
Add internal S3 generic method, backend_validated, to verify if a bac…
villegar Oct 28, 2026
b2402bb
Add tests to ensure functionality of validate_backend works as expected
villegar Oct 28, 2026
7b263a5
Update s3_method_not_available to include a hint arg and drop out bac…
villegar Oct 29, 2026
0f284fc
Add new helper get_crate_context to extract context of an RO-Crate an…
villegar Oct 29, 2026
366cc4a
Add new helper get_crate_context to extract context of an RO-Crate an…
villegar Oct 29, 2026
cd40a39
Revert changes in date formatting, keep formatting only for later sta…
villegar Oct 29, 2026
54056c9
New build
villegar Oct 29, 2026
4c72809
Update extraction of path from RO-Crate when creating the report
villegar Oct 30, 2026
35f9b07
Add missing attribute, backend_validated to list of accepted attributes
villegar Oct 30, 2026
06c7836
Update calls_to_tbl to filter out elements in the arguments that don'…
villegar Nov 2, 2026
bdf6061
Minor changes, including new version of roxygen2 and replace quotes
villegar Nov 3, 2026
70c2211
Add workflow to checkout for dependencies/updates on GHA workflows
villegar Nov 10, 2026
f2452dd
Integrate lintr in the code base and deploy GHA workflow for PRs
villegar Nov 10, 2026
fd19ace
Run rsonar::sonar_analysis and apply fixes, create internal function …
villegar Nov 10, 2026
492c147
Adjust name of variable in vignette to comply with lintr rules
villegar Nov 10, 2026
8ca4a09
Add new helper module to introduce a project context to reduce number…
villegar Nov 11, 2026
acd9c6f
Remove unused S3 generic methods for extract_safe_*.opal()
villegar Nov 11, 2026
a050bf0
Update DESCRIPTION to move DSMolgenisArmadillo as a suggested package…
villegar Nov 11, 2026
e74bc4a
Minor styling changes
villegar Nov 11, 2026
9eb2f33
Introduce internal helper to reduce duplication in logic for report.*…
villegar Nov 12, 2026
f51aa84
Add new helper functions to extract the project context members and p…
villegar Nov 16, 2026
5723fdc
Add new backend generic to extract project membership and implement m…
villegar Nov 16, 2026
ade6631
Update safe_data and safe_project S3 methods to use the new helpers t…
villegar Nov 16, 2026
d014624
Streamline the report module to reuse more components across the S3 g…
villegar Nov 16, 2026
8877495
Introduce new helper and updated test for report and internal functio…
villegar Nov 16, 2026
8858b67
Add missing local binding
villegar Nov 16, 2026
80ab9e0
Add changes done to the report module
villegar Nov 16, 2026
99b5331
New build
villegar Nov 16, 2026
59ddde0
Pass on project context to add_asset_permissions_to_crate and get_ass…
villegar Nov 18, 2026
69f07ef
Redefine project_context_members to handle context, type and asset name
villegar Nov 18, 2026
0e71e8c
Add permissions to backend_project_members
villegar Nov 18, 2026
a6ed08d
Update function calls to rely on project context
villegar Nov 18, 2026
7657a71
Enable tests
villegar Nov 18, 2026
c5abc9b
Add new tests for new functionality
villegar Nov 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
^CRAN-SUBMISSION$
^\.positai$
^\.claude$
^sonar-fixes\.json$
^quality\.html$
^\.lintr$
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
31 changes: 31 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:

name: lint.yaml

permissions: read-all

jobs:
lint:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::lintr, local::.
needs: lint

- name: Lint
run: lintr::lint_package()
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ inst/R.ignore
cran-comments.md
CRAN-SUBMISSION
.positai
docs
sonar-fixes.json
quality.html
7 changes: 7 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
linters: linters_with_defaults(
object_name_linter = lintr::object_name_linter(
styles = c("snake_case", "camelCase", "dotted.case"),
regexes = c("^[A-Z][[:alnum:]_]*$", "^@timestamp$", "%||%")
))
encoding: "UTF-8"
exclusions: list("inst/R.ignore")
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dsROCrate
Title: 'DataSHIELD' RO-Crate Governance Functions
Version: 0.2.4
Version: 0.2.4.9000
Authors@R: c(
person(given = "Roberto",
family = "Villegas-Diaz",
Expand Down Expand Up @@ -30,6 +30,7 @@ Suggests:
dsBaseClient,
DSI,
DSOpal,
DSMolgenisArmadillo,
fs,
knitr,
MolgenisArmadillo,
Expand All @@ -42,7 +43,6 @@ Roxygen: list(markdown = TRUE)
Imports:
digest,
dplyr,
DSMolgenisArmadillo,
jsonlite,
opalr (>= 3.6.1),
purrr,
Expand All @@ -57,6 +57,6 @@ Imports:
Depends:
R (>= 4.1.0)
VignetteBuilder: knitr
URL: https://github.com/FederatedMethods/dsROCrate
URL: https://github.com/FederatedMethods/dsROCrate, https://federatedmethods.github.io/dsROCrate
BugReports: https://github.com/FederatedMethods/dsROCrate/issues
Config/roxygen2/version: 8.1.0
Config/roxygen2/version: 8.1.1
13 changes: 6 additions & 7 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

S3method(as.data.frame,safe_call)
S3method(as.data.frame,symbol_registry)
S3method(as_tibble,safe_symbol)
S3method(audit,ArmadilloCredentials)
S3method(audit,character)
S3method(audit,cr8tor)
Expand All @@ -12,12 +13,15 @@ S3method(audit,rocrate)
S3method(audit_engine,cr8tor)
S3method(audit_engine,default)
S3method(audit_engine,opal)
S3method(backend_can_audit,opal)
S3method(backend_logs,opal)
S3method(backend_name,opal)
S3method(backend_options,opal)
S3method(backend_packages,opal)
S3method(backend_profile_exists,opal)
S3method(backend_project,opal)
S3method(backend_project_exists,opal)
S3method(backend_project_members,opal)
S3method(backend_project_perms,opal)
S3method(backend_projects,opal)
S3method(backend_resource_perms,opal)
Expand All @@ -27,18 +31,14 @@ S3method(backend_table_perms,opal)
S3method(backend_tables,opal)
S3method(backend_user_exists,opal)
S3method(backend_users,opal)
S3method(backend_validated,opal)
S3method(check_permissions,ArmadilloCredentials)
S3method(check_permissions,default)
S3method(check_permissions,opal)
S3method(extract_safe_data,opal)
S3method(extract_safe_data,rocrate)
S3method(extract_safe_output,opal)
S3method(extract_safe_output,rocrate)
S3method(extract_safe_people,opal)
S3method(extract_safe_people,rocrate)
S3method(extract_safe_project,opal)
S3method(extract_safe_project,rocrate)
S3method(extract_safe_setting,opal)
S3method(extract_safe_setting,rocrate)
S3method(filter_safe_people,opal)
S3method(flatten_safe_data,default)
Expand All @@ -54,8 +54,6 @@ S3method(flatten_safe_setting,rocrate)
S3method(init,ArmadilloCredentials)
S3method(init,opal)
S3method(init,rocrate)
S3method(is_admin_con,opal)
S3method(is_audit_con,opal)
S3method(parse_user_profiles,ArmadilloCredentials)
S3method(parse_user_profiles,opal)
S3method(print,cr8tor_bundle)
Expand Down Expand Up @@ -111,4 +109,5 @@ export(safe_people)
export(safe_project)
export(safe_setting)
importFrom(rocrateR,get_entity)
importFrom(tibble,as_tibble)
importFrom(utils,write.csv)
55 changes: 55 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
# dsROCrate (development version)

## Bug fixes

* Restored the internal `%||%` helper, removed in 0.2.4. Base R only provides
`%||%` from 4.4.0, so the Opal workflow failed on R 4.1 to 4.3. Tables and
resources without a description get the fallback description again (it had
become an empty string).
* Fixed `dateCreated`/`dateModified` of tables and resources being shifted by
the local UTC offset.
* `dateModified` of the `safe_output()` entities is now a UTC string, and the
time stamps in the log file names use UTC.
* `report()` for a list of RO-Crates failed when none of them had permissions on
the tables, and left the servers without permissions out of the overview when
others had some. These servers are now included, with an empty access level.
* `report()` for a path to an RO-Crate (its directory or its
`ro-crate-metadata.json` file) now loads the files it references (e.g., the
logs and mappings), so the Safe Output details are included in the report.
* `report()` for a list of RO-Crates now checks the file path like it does for a
single RO-Crate: it no longer overwrites an existing file unless
`overwrite = TRUE`. If the list has no names, the servers are named
`server_1`, `server_2`, etc.
* The error shown when the directory of the report does not exist now has the
missing spaces in the suggested command.

## Changes

* Errors for unsupported classes and not yet implemented backends are now
consistent across `audit()`, `check_permissions()`, `init()`, `report()` and
the `safe_*()` functions.
* `report()`: the date in the report header is now in UTC.
* `report()` for a list of RO-Crates returns the Safe Project table as
`safe_project`, like it does for a single RO-Crate (`safe_project_tbl` is kept
for now). The unused `diag_width` and `diag_height` arguments were removed.

## Internal Changes

* The requests about a project (if it exists, and its tables and resources) are
made once and shared by `safe_project()` and `safe_data()` through the
RO-Crate, instead of once per function. For `init() |> safe_project() |>
safe_data()` this means 1 request to check the project (was 5) and 1 to list
its tables and resources (was 2 each). The shared requests last as long as the
RO-Crate: run `init()` again to refresh them.
* Added `backend_can_audit()`, replacing `is_admin_con()` and `is_audit_con()`:
checking that a connection can audit now takes 1 request instead of 4.
* `validate_backend()` skips the checks when the RO-Crate was already validated
for the same connection, so `audit()` and `init() |> safe_*()` validate once.
* Added `backend_name()`, `set_crate_context()` and shared error helpers.
* `report()` for a list of RO-Crates reuses the code of the report for a single
RO-Crate: the tables of each RO-Crate are extracted once (they used to be
extracted by a full report of each RO-Crate, which also built a diagram and
wrote a file each time), and the overview of the servers is the combination
of the overview of each RO-Crate. For a list of 2 RO-Crates, 1 diagram is
built (was 3) and 2 RO-Crates are written in the report (was 4).

# dsROCrate 0.2.4

## Bug fixes
Expand Down
15 changes: 5 additions & 10 deletions R/audit.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,17 @@ audit <- function(x, ...) {

#' @export
audit.default <- function(x, ...) {
stop(
sprintf(
"No `audit()` method exists for objects of class: %s.",
paste(class(x), collapse = ", ")
),
call. = FALSE
s3_method_not_available(
"audit",
class = class(x),
hint = "Please provide a supported backend connection object."
)
}

#' @rdname audit
#' @export
audit.ArmadilloCredentials <- function(x, ..., intent = NULL) {
stop(
"The `audit()` for the Armadillo backend is not currently implemented!",
call. = FALSE
)
s3_method_not_implemented("audit", backend = "Armadillo")
}

#' @rdname audit
Expand Down
10 changes: 4 additions & 6 deletions R/audit_engine.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ audit_engine <- function(x, ...) {

#' @export
audit_engine.default <- function(x, ...) {
stop(
sprintf(
"No `audit_engine()` method exists for objects of class: %s.",
paste(class(x), collapse = ", ")
),
call. = FALSE
s3_method_not_available(
"audit_engine",
class = class(x),
hint = "Please provide a supported backend connection object."
)
}

Expand Down
40 changes: 14 additions & 26 deletions R/backend-generic.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
backend_can_audit <- function(x, ...) {
UseMethod("backend_can_audit")
}

backend_logs <- function(x, ...) {
UseMethod("backend_logs")
}

backend_name <- function(x, ...) {
UseMethod("backend_name")
}

backend_options <- function(x, ...) {
UseMethod("backend_options")
}
Expand All @@ -22,6 +30,10 @@ backend_project_exists <- function(x, ...) {
UseMethod("backend_project_exists")
}

backend_project_members <- function(x, ...) {
UseMethod("backend_project_members")
}

backend_project_perms <- function(x, ...) {
UseMethod("backend_project_perms")
}
Expand Down Expand Up @@ -58,32 +70,8 @@ backend_users <- function(x, ...) {
UseMethod("backend_users")
}

#' Verify if connection was created by an administrator user
#'
#' @inheritParams validate_con
#' @param ... Unused, extra arguments.
#'
#' @returns Boolean flag to indicate whether the given connection was created
#' by an administrator user.
#' @keywords internal
#'
#' @noRd
is_admin_con <- function(x, ...) {
UseMethod("is_admin_con")
}

#' Verify if connection was created by an auditor user
#'
#' @inheritParams validate_con
#' @param ... Unused, extra arguments.
#'
#' @returns Boolean flag to indicate whether the given connection was created
#' by an auditor user.
#' @keywords internal
#'
#' @noRd
is_audit_con <- function(x, ...) {
UseMethod("is_audit_con")
backend_validated <- function(x, ...) {
UseMethod("backend_validated")
}

#' Validate backend version
Expand Down
Loading
Loading