From a497375b38cb6f93b671a0859133b22d436f1bbc Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Mon, 7 Oct 2024 17:38:42 +0100 Subject: [PATCH 01/13] Updates to actions --- .github/workflows/test-build.yaml | 17 +++++------------ DESCRIPTION | 2 +- NEWS.md | 4 ++-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index f9c71393..305e93e6 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -17,14 +17,14 @@ jobs: fail-fast: false matrix: config: -# - {os: windows-latest, r: 'release'} -# - {os: macOS-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: macOS-latest, r: 'release'} - {os: ubuntu-latest, r: 'release'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 - uses: r-lib/actions/setup-r@v2 with: @@ -37,7 +37,7 @@ jobs: rcmdcheck remotes - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.9' architecture: 'x64' @@ -64,6 +64,7 @@ jobs: cd ${{ github.workspace }} fair init --ci fair registry start + shell: bash - name: Install R API system requirements (macOS-latest) if: runner.os == 'macOS' @@ -71,14 +72,6 @@ jobs: rm '/usr/local/bin/gfortran' brew install hdf5 brew install gdal - - name: Install R API system requirements (ubuntu-20.04) - if: matrix.config.os == 'ubuntu-20.04' - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")') - - name: Check env: _R_CHECK_CRAN_INCOMING_: false diff --git a/DESCRIPTION b/DESCRIPTION index 279871c6..ab7e1cfc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: rDataPipeline Title: Functions to Interact with the 'FAIR Data Pipeline' -Version: 0.6.0 +Version: 0.60.0 Authors@R: c(person("Sonia", "Mitchell", email = "sonia.mitchell@glasgow.ac.uk", role = c("aut"), comment = c(ORCID = "0000-0003-1536-2066")), person("Ryan", "Field", email = "ryan.field@glasgow.ac.uk", role = c("cre", "aut"), diff --git a/NEWS.md b/NEWS.md index 78f25321..a46a24db 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,7 @@ # NEWS -# rDataPipeline v0.6.0 +# rDataPipeline v0.60.0 ## Improvements: - Updates to work with latest versions of R + Updates to work with latest version of data registry - v0.54.1 - Initial release - v0.54.2 From db752e91597597d37955d531515bbaea8cee11bd Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Mon, 7 Oct 2024 17:43:31 +0100 Subject: [PATCH 02/13] Use newer python --- .github/workflows/test-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index 305e93e6..539f693d 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -39,8 +39,8 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: '3.9' - architecture: 'x64' + python-version: '3.12' + #architecture: 'x64' - name: Install local registry run: curl -fsSL https://data.scrc.uk/static/localregistry.sh | /bin/bash -s -- -b main - name: Checkout FAIRDataPipeline/FAIR-CLI From 21cd1c87ace1237d9025bb0ec247735efe90ee72 Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Mon, 7 Oct 2024 17:49:43 +0100 Subject: [PATCH 03/13] Move registry install in actions --- .github/workflows/test-build.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index 539f693d..8b76c05e 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -41,8 +41,6 @@ jobs: with: python-version: '3.12' #architecture: 'x64' - - name: Install local registry - run: curl -fsSL https://data.scrc.uk/static/localregistry.sh | /bin/bash -s -- -b main - name: Checkout FAIRDataPipeline/FAIR-CLI uses: actions/checkout@v3 with: @@ -62,6 +60,7 @@ jobs: poetry install source .venv/bin/activate cd ${{ github.workspace }} + fair registry install --version main fair init --ci fair registry start shell: bash @@ -69,7 +68,6 @@ jobs: - name: Install R API system requirements (macOS-latest) if: runner.os == 'macOS' run : | - rm '/usr/local/bin/gfortran' brew install hdf5 brew install gdal - name: Check From f0ef370009fb1fdcfa8fe3fca1966231a7d81479 Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Mon, 7 Oct 2024 18:01:38 +0100 Subject: [PATCH 04/13] Use batch for windows CI --- .github/workflows/test-build.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index 8b76c05e..54b70fa7 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -54,7 +54,7 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true - - name: Install and initialise FAIR CLI + - name: Install and initialise FAIR CLI on Mac / Ubuntu run: | cd ../FAIR-CLI poetry install @@ -63,7 +63,19 @@ jobs: fair registry install --version main fair init --ci fair registry start - shell: bash + if: runner.os != 'Windows' + + - name: Install and initialise FAIR CLI on windows + run: | + cd ../FAIR-CLI + poetry install + .venv/bin/activate.bat + cd ${{ github.workspace }} + fair registry install --version main + fair init --ci + fair registry start + if: runner.os == 'Windows' + shell: cmd - name: Install R API system requirements (macOS-latest) if: runner.os == 'macOS' From c27ac7e21a1feb6e322ac767280d908b7717486b Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Mon, 7 Oct 2024 18:07:47 +0100 Subject: [PATCH 05/13] Use poetry agnostic venv --- .github/workflows/test-build.yaml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index 54b70fa7..d8eacde6 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -54,28 +54,16 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true - - name: Install and initialise FAIR CLI on Mac / Ubuntu + - name: Install and initialise FAIR CLI run: | cd ../FAIR-CLI poetry install - source .venv/bin/activate + source $VENV cd ${{ github.workspace }} fair registry install --version main fair init --ci fair registry start - if: runner.os != 'Windows' - - - name: Install and initialise FAIR CLI on windows - run: | - cd ../FAIR-CLI - poetry install - .venv/bin/activate.bat - cd ${{ github.workspace }} - fair registry install --version main - fair init --ci - fair registry start - if: runner.os == 'Windows' - shell: cmd + shell: bash - name: Install R API system requirements (macOS-latest) if: runner.os == 'macOS' From 6e5b1a0ea6df7f2a221d16cf409958d83909cf11 Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Mon, 7 Oct 2024 18:18:25 +0100 Subject: [PATCH 06/13] Escape workspace --- .github/workflows/test-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index d8eacde6..db23ee6f 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -59,7 +59,7 @@ jobs: cd ../FAIR-CLI poetry install source $VENV - cd ${{ github.workspace }} + cd '${{ github.workspace }}' fair registry install --version main fair init --ci fair registry start From a8694a0ee9cc0c66837124dad4a00b5b41ec2bdb Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Mon, 7 Oct 2024 18:47:20 +0100 Subject: [PATCH 07/13] Fix windows token path --- .github/workflows/test-build.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index db23ee6f..14a82881 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -65,6 +65,13 @@ jobs: fair registry start shell: bash + - name: Copy token on windows + run: | + mkdir -p C:/Users/runneradmin/Documents/.fair/registry/ + cp C:/Users/runneradmin/.fair/registry/token C:/Users/runneradmin/Documents/.fair/registry/token + shell: bash + if: runner.os == 'Windows' + - name: Install R API system requirements (macOS-latest) if: runner.os == 'macOS' run : | From 9758ab300b83291dd9e9b4f22ae4c770f534f987 Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Mon, 7 Oct 2024 19:07:01 +0100 Subject: [PATCH 08/13] use loopback in tests --- .github/workflows/test-coverage.yaml | 2 +- R/check_dataproduct_exists.R | 2 +- R/check_exists.R | 2 +- R/create_config.R | 2 +- R/fair_init.R | 2 +- R/fair_run.R | 2 +- R/get_dataproduct.R | 2 +- R/get_entity.R | 2 +- R/get_entry.R | 2 +- R/get_existing.R | 2 +- R/get_fields.R | 2 +- R/get_id.R | 2 +- R/get_tables.R | 2 +- R/get_url.R | 2 +- R/new_author.R | 2 +- R/new_code_repo_release.R | 2 +- R/new_code_run.R | 2 +- R/new_data_product.R | 2 +- R/new_external_object.R | 2 +- R/new_file_type.R | 2 +- R/new_issue.R | 2 +- R/new_keyword.R | 2 +- R/new_licence.R | 2 +- R/new_namespace.R | 2 +- R/new_object.R | 2 +- R/new_object_component.R | 2 +- R/new_quality_controlled.R | 2 +- R/new_storage_location.R | 2 +- R/new_storage_root.R | 2 +- R/new_user_author.R | 2 +- R/post_data.R | 2 +- man/fair_init.Rd | 2 +- man/fair_run.Rd | 2 +- man/get_dataproduct.Rd | 2 +- man/get_entry.Rd | 2 +- man/get_existing.Rd | 2 +- man/get_fields.Rd | 2 +- man/get_id.Rd | 2 +- man/get_tables.Rd | 2 +- man/get_url.Rd | 2 +- man/new_author.Rd | 2 +- man/new_code_repo_release.Rd | 2 +- man/new_code_run.Rd | 2 +- man/new_data_product.Rd | 2 +- man/new_external_object.Rd | 2 +- man/new_file_type.Rd | 2 +- man/new_issue.Rd | 2 +- man/new_keyword.Rd | 2 +- man/new_licence.Rd | 2 +- man/new_namespace.Rd | 2 +- man/new_object.Rd | 2 +- man/new_object_component.Rd | 2 +- man/new_quality_controlled.Rd | 2 +- man/new_storage_location.Rd | 2 +- man/new_storage_root.Rd | 2 +- man/new_user_author.Rd | 2 +- tests/testthat.R | 2 +- 57 files changed, 57 insertions(+), 57 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 514eef2b..ac2dfc34 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -59,7 +59,7 @@ jobs: rDataPipeline::fair_init( name = "Sonia Mitchell", identifier = "https://orcid.org/0000-0003-1536-2066", - endpoint = "http://localhost:8000/api/") + endpoint = "http://127.0.0.1:8000:8000/api/") shell: Rscript {0} - name: Test coverage env: diff --git a/R/check_dataproduct_exists.R b/R/check_dataproduct_exists.R index f4f7fcba..61b04835 100644 --- a/R/check_dataproduct_exists.R +++ b/R/check_dataproduct_exists.R @@ -21,7 +21,7 @@ check_dataproduct_exists <- function(write_dataproduct, namespace = write_namespace_id), endpoint = endpoint) - write_namespace_url <- file.path("http://localhost:8000", "api", + write_namespace_url <- file.path("http://127.0.0.1:8000:8000", "api", "namespace", write_namespace_id) write_namespace <- get_entity(write_namespace_url)$name diff --git a/R/check_exists.R b/R/check_exists.R index 3ace9e98..00f61575 100644 --- a/R/check_exists.R +++ b/R/check_exists.R @@ -14,7 +14,7 @@ check_exists <- function(table, query) { - output <- httr::GET(paste0("http://localhost:8000/api/", table, ""), + output <- httr::GET(paste0("http://127.0.0.1:8000:8000/api/", table, ""), query = query) if (any(names(output) == "status_code")) { diff --git a/R/create_config.R b/R/create_config.R index 24428804..aecdc07b 100644 --- a/R/create_config.R +++ b/R/create_config.R @@ -33,7 +33,7 @@ create_config <- function(path, # Generate run_metadata block run_metadata <- list(description = description, - local_data_registry_url = "http://localhost:8000/api/", + local_data_registry_url = "http://127.0.0.1:8000:8000/api/", remote_data_registry_url = "https://data.scrc.uk/api/", default_input_namespace = input_namespace, default_output_namespace = output_namespace, diff --git a/R/fair_init.R b/R/fair_init.R index 49ba7037..1a9ceb38 100644 --- a/R/fair_init.R +++ b/R/fair_init.R @@ -11,7 +11,7 @@ #' fair_init <- function(name, identifier, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { user_url <- get_url(table = "users", query = list(username = "admin"), diff --git a/R/fair_run.R b/R/fair_run.R index 0ad72493..bea63e8f 100644 --- a/R/fair_run.R +++ b/R/fair_run.R @@ -7,7 +7,7 @@ #' @export #' fair_run <- function(path = "config.yaml", - endpoint = "http://localhost:8000/api/", + endpoint = "http://127.0.0.1:8000:8000/api/", skip = FALSE) { # Save names in data store diff --git a/R/get_dataproduct.R b/R/get_dataproduct.R index 9c506f45..80660726 100644 --- a/R/get_dataproduct.R +++ b/R/get_dataproduct.R @@ -10,7 +10,7 @@ get_dataproduct <- function(data_product, version, namespace, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { # Get provenance URL namespace_entry <- get_entry("namespace", list(name = namespace), diff --git a/R/get_entity.R b/R/get_entity.R index 70b5be6a..b6e4f061 100644 --- a/R/get_entity.R +++ b/R/get_entity.R @@ -11,7 +11,7 @@ get_entity <- function(url) { # Sometimes an error is returned from the local registry: # "Error in curl::curl_fetch_memory(url, handle = handle) : - # Failed to connect to localhost port 8000: Connection refused" + # Failed to connect to 127.0.0.1:8000 port 8000: Connection refused" # Repeating the action works eventually... continue <- TRUE while (continue) { diff --git a/R/get_entry.R b/R/get_entry.R index e1b480fd..0b2f94a0 100644 --- a/R/get_entry.R +++ b/R/get_entry.R @@ -10,7 +10,7 @@ #' @export #' @family get functions #' -get_entry <- function(table, query, endpoint = "http://localhost:8000/api/") { +get_entry <- function(table, query, endpoint = "http://127.0.0.1:8000:8000/api/") { key <- get_token() h <- c(Authorization = paste("token", key)) diff --git a/R/get_existing.R b/R/get_existing.R index 9226455e..7484a380 100644 --- a/R/get_existing.R +++ b/R/get_existing.R @@ -19,7 +19,7 @@ get_existing <- function(table, limit_results = TRUE, detail = "all", - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { if (!check_table_exists(table)) usethis::ui_stop(paste( diff --git a/R/get_fields.R b/R/get_fields.R index dff0de3a..2b5efc62 100644 --- a/R/get_fields.R +++ b/R/get_fields.R @@ -10,7 +10,7 @@ #' @return Returns a \code{data.frame} of fields and their attributes set to #' "none" #' -get_fields <- function(table, endpoint = "http://localhost:8000/api/") { +get_fields <- function(table, endpoint = "http://127.0.0.1:8000:8000/api/") { # Add token to options request header key <- get_token() diff --git a/R/get_id.R b/R/get_id.R index 354734dd..55ce60a2 100644 --- a/R/get_id.R +++ b/R/get_id.R @@ -14,7 +14,7 @@ #' get_id <- function(table, query = list(), - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { output <- get_entry(table, query, endpoint) diff --git a/R/get_tables.R b/R/get_tables.R index b125dd1a..a5c9c554 100644 --- a/R/get_tables.R +++ b/R/get_tables.R @@ -6,7 +6,7 @@ #' @return a character vector of tables #' @keywords internal #' -get_tables <- function(endpoint = "http://localhost:8000/api/") { +get_tables <- function(endpoint = "http://127.0.0.1:8000:8000/api/") { httr::GET(endpoint) %>% httr::content(as = "text", encoding = "UTF-8") %>% diff --git a/R/get_url.R b/R/get_url.R index 7a2b9997..b605d619 100644 --- a/R/get_url.R +++ b/R/get_url.R @@ -14,7 +14,7 @@ #' get_url <- function(table, query = list(), - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { output <- get_entry(table = table, query = query, diff --git a/R/new_author.R b/R/new_author.R index 842f4e3b..4ba749fa 100644 --- a/R/new_author.R +++ b/R/new_author.R @@ -15,7 +15,7 @@ #' new_author <- function(name, identifier, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { data <- list() diff --git a/R/new_code_repo_release.R b/R/new_code_repo_release.R index bfaf55e5..e87d61d2 100644 --- a/R/new_code_repo_release.R +++ b/R/new_code_repo_release.R @@ -19,7 +19,7 @@ new_code_repo_release <- function(name, version, object_url, website, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { data <- list(name = name, version = version, diff --git a/R/new_code_run.R b/R/new_code_run.R index c36226e4..aabaef56 100644 --- a/R/new_code_run.R +++ b/R/new_code_run.R @@ -31,7 +31,7 @@ new_code_run <- function(run_date, submission_script_url, inputs_urls = list(), outputs_urls = list(), - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { data <- list(run_date = run_date, inputs = inputs_urls, diff --git a/R/new_data_product.R b/R/new_data_product.R index 831d96f5..3e7db4d5 100644 --- a/R/new_data_product.R +++ b/R/new_data_product.R @@ -19,7 +19,7 @@ new_data_product <- function(name, version, object_url, namespace_url, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { post_data(table = "data_product", data = list(name = name, diff --git a/R/new_external_object.R b/R/new_external_object.R index 665a3ffa..3b1ccfeb 100644 --- a/R/new_external_object.R +++ b/R/new_external_object.R @@ -30,7 +30,7 @@ new_external_object <- function(doi_or_unique_name, description, data_product_url, original_store_url, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { data <- list(doi_or_unique_name = doi_or_unique_name, release_date = release_date, diff --git a/R/new_file_type.R b/R/new_file_type.R index bd3b2e96..df0e8bf8 100644 --- a/R/new_file_type.R +++ b/R/new_file_type.R @@ -12,7 +12,7 @@ #' new_file_type <- function(name, extension, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { post_data(table = "file_type", data = list(name = name, diff --git a/R/new_issue.R b/R/new_issue.R index 68478b01..c7667bbe 100644 --- a/R/new_issue.R +++ b/R/new_issue.R @@ -16,7 +16,7 @@ new_issue <- function(severity, description, component_issues, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { post_data(table = "issue", data = list(severity = severity, diff --git a/R/new_keyword.R b/R/new_keyword.R index 884ef6e2..f9c6fac6 100644 --- a/R/new_keyword.R +++ b/R/new_keyword.R @@ -16,7 +16,7 @@ new_keyword <- function(object_url, keyphrase, identifier, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { data <- list(object = object_url, keyphrase = keyphrase) diff --git a/R/new_licence.R b/R/new_licence.R index bb003794..eca96b9c 100644 --- a/R/new_licence.R +++ b/R/new_licence.R @@ -13,7 +13,7 @@ #' new_licence <- function(object_url, licence_info, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { post_data(table = "licence", data = list(object = object_url, diff --git a/R/new_namespace.R b/R/new_namespace.R index aacf7284..5c0ec90b 100644 --- a/R/new_namespace.R +++ b/R/new_namespace.R @@ -16,7 +16,7 @@ new_namespace <- function(name, full_name, website, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { data <- list(name = name) diff --git a/R/new_object.R b/R/new_object.R index 9b1bdfcc..a9ff3ed4 100644 --- a/R/new_object.R +++ b/R/new_object.R @@ -20,7 +20,7 @@ new_object <- function(description, storage_location_url, authors_url, file_type_url, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { data <- list() diff --git a/R/new_object_component.R b/R/new_object_component.R index 28a9eed4..018b8c26 100644 --- a/R/new_object_component.R +++ b/R/new_object_component.R @@ -30,7 +30,7 @@ new_object_component <- function(object_url, description, whole_object = FALSE, issues_urls, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { data <- list(object = object_url, name = name, diff --git a/R/new_quality_controlled.R b/R/new_quality_controlled.R index 2b5935e2..043c5965 100644 --- a/R/new_quality_controlled.R +++ b/R/new_quality_controlled.R @@ -11,7 +11,7 @@ #' @family new functions #' new_quality_controlled <- function(object_url, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { post_data(table = "quality_controlled", data = list(object = object_url), diff --git a/R/new_storage_location.R b/R/new_storage_location.R index bac6080b..2da9beeb 100644 --- a/R/new_storage_location.R +++ b/R/new_storage_location.R @@ -21,7 +21,7 @@ new_storage_location <- function(path, hash, public, storage_root_url, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { data <- list(path = path, hash = hash, storage_root = storage_root_url) diff --git a/R/new_storage_root.R b/R/new_storage_root.R index a07977ec..1c56dff7 100644 --- a/R/new_storage_root.R +++ b/R/new_storage_root.R @@ -15,7 +15,7 @@ #' new_storage_root <- function(root, local, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { data <- list(root = root) diff --git a/R/new_user_author.R b/R/new_user_author.R index 3b4de05a..6a1238d9 100644 --- a/R/new_user_author.R +++ b/R/new_user_author.R @@ -14,7 +14,7 @@ #' new_user_author <- function(user_url, author_url, - endpoint = "http://localhost:8000/api/") { + endpoint = "http://127.0.0.1:8000:8000/api/") { data <- list(user = user_url, author = author_url) diff --git a/R/post_data.R b/R/post_data.R index d7b25578..f0fbc7fb 100644 --- a/R/post_data.R +++ b/R/post_data.R @@ -22,7 +22,7 @@ post_data <- function(table, data, endpoint) { # Sometimes an error is returned from the local registry: # "Error in curl::curl_fetch_memory(url, handle = handle) : - # Failed to connect to localhost port 8000: Connection refused" + # Failed to connect to 127.0.0.1:8000 port 8000: Connection refused" # Repeating the action works eventually... continue <- TRUE while (continue) { diff --git a/man/fair_init.Rd b/man/fair_init.Rd index dd1c9b8e..046097cf 100644 --- a/man/fair_init.Rd +++ b/man/fair_init.Rd @@ -4,7 +4,7 @@ \alias{fair_init} \title{fair_init} \usage{ -fair_init(name, identifier, endpoint = "http://localhost:8000/api/") +fair_init(name, identifier, endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{name}{a \code{string} specifying the full name or organisation name of diff --git a/man/fair_run.Rd b/man/fair_run.Rd index 7ad5e9ed..a2016293 100644 --- a/man/fair_run.Rd +++ b/man/fair_run.Rd @@ -6,7 +6,7 @@ \usage{ fair_run( path = "config.yaml", - endpoint = "http://localhost:8000/api/", + endpoint = "http://127.0.0.1:8000:8000/api/", skip = FALSE ) } diff --git a/man/get_dataproduct.Rd b/man/get_dataproduct.Rd index e6e9495b..efe5ec15 100644 --- a/man/get_dataproduct.Rd +++ b/man/get_dataproduct.Rd @@ -8,7 +8,7 @@ get_dataproduct( data_product, version, namespace, - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/get_entry.Rd b/man/get_entry.Rd index fac8306e..c027509e 100644 --- a/man/get_entry.Rd +++ b/man/get_entry.Rd @@ -4,7 +4,7 @@ \alias{get_entry} \title{Return all fields associated with a table entry in the data registry} \usage{ -get_entry(table, query, endpoint = "http://localhost:8000/api/") +get_entry(table, query, endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{table}{a \code{string} specifying the name of the table} diff --git a/man/get_existing.Rd b/man/get_existing.Rd index 3996fc6d..108fe48c 100644 --- a/man/get_existing.Rd +++ b/man/get_existing.Rd @@ -8,7 +8,7 @@ get_existing( table, limit_results = TRUE, detail = "all", - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/get_fields.Rd b/man/get_fields.Rd index feceba21..c835ef5f 100644 --- a/man/get_fields.Rd +++ b/man/get_fields.Rd @@ -4,7 +4,7 @@ \alias{get_fields} \title{Get fields from table} \usage{ -get_fields(table, endpoint = "http://localhost:8000/api/") +get_fields(table, endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{table}{a \code{string} specifying the name of the table} diff --git a/man/get_id.Rd b/man/get_id.Rd index c3d9d500..c39b095d 100644 --- a/man/get_id.Rd +++ b/man/get_id.Rd @@ -4,7 +4,7 @@ \alias{get_id} \title{Get ID} \usage{ -get_id(table, query = list(), endpoint = "http://localhost:8000/api/") +get_id(table, query = list(), endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{table}{a \code{string} specifying the name of the table} diff --git a/man/get_tables.Rd b/man/get_tables.Rd index 4a6b19c4..7b0885fc 100644 --- a/man/get_tables.Rd +++ b/man/get_tables.Rd @@ -4,7 +4,7 @@ \alias{get_tables} \title{Get tables from registry} \usage{ -get_tables(endpoint = "http://localhost:8000/api/") +get_tables(endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{endpoint}{a \code{string} specifying the registry endpoint} diff --git a/man/get_url.Rd b/man/get_url.Rd index 6895e797..d0166a3d 100644 --- a/man/get_url.Rd +++ b/man/get_url.Rd @@ -4,7 +4,7 @@ \alias{get_url} \title{Get URL} \usage{ -get_url(table, query = list(), endpoint = "http://localhost:8000/api/") +get_url(table, query = list(), endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{table}{a \code{string} specifying the name of the table} diff --git a/man/new_author.Rd b/man/new_author.Rd index 9c8f540a..e4356cae 100644 --- a/man/new_author.Rd +++ b/man/new_author.Rd @@ -4,7 +4,7 @@ \alias{new_author} \title{Post entry to author table} \usage{ -new_author(name, identifier, endpoint = "http://localhost:8000/api/") +new_author(name, identifier, endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{name}{a \code{string} specifying the full name or organisation name of diff --git a/man/new_code_repo_release.Rd b/man/new_code_repo_release.Rd index 72e713bb..f7b7d973 100644 --- a/man/new_code_repo_release.Rd +++ b/man/new_code_repo_release.Rd @@ -9,7 +9,7 @@ new_code_repo_release( version, object_url, website, - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/new_code_run.Rd b/man/new_code_run.Rd index 8ee2ca86..4247e32d 100644 --- a/man/new_code_run.Rd +++ b/man/new_code_run.Rd @@ -12,7 +12,7 @@ new_code_run( submission_script_url, inputs_urls = list(), outputs_urls = list(), - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/new_data_product.Rd b/man/new_data_product.Rd index e6830e2b..3a585a06 100644 --- a/man/new_data_product.Rd +++ b/man/new_data_product.Rd @@ -9,7 +9,7 @@ new_data_product( version, object_url, namespace_url, - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/new_external_object.Rd b/man/new_external_object.Rd index e7fa9cb9..3aaee275 100644 --- a/man/new_external_object.Rd +++ b/man/new_external_object.Rd @@ -12,7 +12,7 @@ new_external_object( description, data_product_url, original_store_url, - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/new_file_type.Rd b/man/new_file_type.Rd index 2414b493..464e296c 100644 --- a/man/new_file_type.Rd +++ b/man/new_file_type.Rd @@ -4,7 +4,7 @@ \alias{new_file_type} \title{Post entry to file_type table} \usage{ -new_file_type(name, extension, endpoint = "http://localhost:8000/api/") +new_file_type(name, extension, endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{name}{a \code{string} specifying the name of the file type} diff --git a/man/new_issue.Rd b/man/new_issue.Rd index 9eef914d..e84523ca 100644 --- a/man/new_issue.Rd +++ b/man/new_issue.Rd @@ -8,7 +8,7 @@ new_issue( severity, description, component_issues, - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/new_keyword.Rd b/man/new_keyword.Rd index 403ddc10..f9192883 100644 --- a/man/new_keyword.Rd +++ b/man/new_keyword.Rd @@ -8,7 +8,7 @@ new_keyword( object_url, keyphrase, identifier, - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/new_licence.Rd b/man/new_licence.Rd index 6634961a..406d14d9 100644 --- a/man/new_licence.Rd +++ b/man/new_licence.Rd @@ -4,7 +4,7 @@ \alias{new_licence} \title{Post entry to licence table} \usage{ -new_licence(object_url, licence_info, endpoint = "http://localhost:8000/api/") +new_licence(object_url, licence_info, endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{object_url}{a \code{string} specifying the URL of an \code{object}} diff --git a/man/new_namespace.Rd b/man/new_namespace.Rd index 4ddbb1ca..4ab6d6ce 100644 --- a/man/new_namespace.Rd +++ b/man/new_namespace.Rd @@ -8,7 +8,7 @@ new_namespace( name, full_name, website, - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/new_object.Rd b/man/new_object.Rd index e464433d..a1c2f770 100644 --- a/man/new_object.Rd +++ b/man/new_object.Rd @@ -9,7 +9,7 @@ new_object( storage_location_url, authors_url, file_type_url, - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/new_object_component.Rd b/man/new_object_component.Rd index 32f65e59..e4ebcc9a 100644 --- a/man/new_object_component.Rd +++ b/man/new_object_component.Rd @@ -10,7 +10,7 @@ new_object_component( description, whole_object = FALSE, issues_urls, - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/new_quality_controlled.Rd b/man/new_quality_controlled.Rd index 3cb35c8a..78016e7e 100644 --- a/man/new_quality_controlled.Rd +++ b/man/new_quality_controlled.Rd @@ -4,7 +4,7 @@ \alias{new_quality_controlled} \title{Post entry to quality_controlled table} \usage{ -new_quality_controlled(object_url, endpoint = "http://localhost:8000/api/") +new_quality_controlled(object_url, endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{object_url}{a \code{string} specifying the URL of an \code{object}} diff --git a/man/new_storage_location.Rd b/man/new_storage_location.Rd index f10b423f..b6e9c62d 100644 --- a/man/new_storage_location.Rd +++ b/man/new_storage_location.Rd @@ -9,7 +9,7 @@ new_storage_location( hash, public, storage_root_url, - endpoint = "http://localhost:8000/api/" + endpoint = "http://127.0.0.1:8000:8000/api/" ) } \arguments{ diff --git a/man/new_storage_root.Rd b/man/new_storage_root.Rd index 5ef25fdc..97b23028 100644 --- a/man/new_storage_root.Rd +++ b/man/new_storage_root.Rd @@ -4,7 +4,7 @@ \alias{new_storage_root} \title{Post entry to storage_root table} \usage{ -new_storage_root(root, local, endpoint = "http://localhost:8000/api/") +new_storage_root(root, local, endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{root}{a \code{string} specifying the URI of a diff --git a/man/new_user_author.Rd b/man/new_user_author.Rd index ca60a064..780a8209 100644 --- a/man/new_user_author.Rd +++ b/man/new_user_author.Rd @@ -4,7 +4,7 @@ \alias{new_user_author} \title{Post entry to user_author table} \usage{ -new_user_author(user_url, author_url, endpoint = "http://localhost:8000/api/") +new_user_author(user_url, author_url, endpoint = "http://127.0.0.1:8000:8000/api/") } \arguments{ \item{user_url}{a \code{string} specifying the URL of an existing diff --git a/tests/testthat.R b/tests/testthat.R index df120ffe..9b14a638 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -5,7 +5,7 @@ library(rDataPipeline) # registry and CLI being installed and will therefore fail. if (Sys.getenv("_RUN_TESTS_") != "") { - Sys.setenv(FDP_endpoint = "http://localhost:8000/api/") + Sys.setenv(FDP_endpoint = "http://127.0.0.1:8000:8000/api/") endpoint <- Sys.getenv("FDP_endpoint") testthat::test_check("rDataPipeline") } From 2523d2252f436ca573ecf0982e70ea2676f0f6fa Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Mon, 7 Oct 2024 19:16:38 +0100 Subject: [PATCH 09/13] Fix port number --- .github/workflows/test-coverage.yaml | 2 +- R/check_dataproduct_exists.R | 2 +- R/check_exists.R | 2 +- R/create_config.R | 2 +- R/fair_init.R | 2 +- R/fair_run.R | 2 +- R/get_dataproduct.R | 2 +- R/get_entry.R | 2 +- R/get_existing.R | 2 +- R/get_fields.R | 2 +- R/get_id.R | 2 +- R/get_tables.R | 2 +- R/get_url.R | 2 +- R/new_author.R | 2 +- R/new_code_repo_release.R | 2 +- R/new_code_run.R | 2 +- R/new_data_product.R | 2 +- R/new_external_object.R | 2 +- R/new_file_type.R | 2 +- R/new_issue.R | 2 +- R/new_keyword.R | 2 +- R/new_licence.R | 2 +- R/new_namespace.R | 2 +- R/new_object.R | 2 +- R/new_object_component.R | 2 +- R/new_quality_controlled.R | 2 +- R/new_storage_location.R | 2 +- R/new_storage_root.R | 2 +- R/new_user_author.R | 2 +- R/post_data.R | 2 +- man/fair_init.Rd | 2 +- man/fair_run.Rd | 2 +- man/get_dataproduct.Rd | 2 +- man/get_entry.Rd | 2 +- man/get_existing.Rd | 2 +- man/get_fields.Rd | 2 +- man/get_id.Rd | 2 +- man/get_tables.Rd | 2 +- man/get_url.Rd | 2 +- man/new_author.Rd | 2 +- man/new_code_repo_release.Rd | 2 +- man/new_code_run.Rd | 2 +- man/new_data_product.Rd | 2 +- man/new_external_object.Rd | 2 +- man/new_file_type.Rd | 2 +- man/new_issue.Rd | 2 +- man/new_keyword.Rd | 2 +- man/new_licence.Rd | 2 +- man/new_namespace.Rd | 2 +- man/new_object.Rd | 2 +- man/new_object_component.Rd | 2 +- man/new_quality_controlled.Rd | 2 +- man/new_storage_location.Rd | 2 +- man/new_storage_root.Rd | 2 +- man/new_user_author.Rd | 2 +- tests/testthat.R | 2 +- 56 files changed, 56 insertions(+), 56 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index ac2dfc34..ebb0a3ef 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -59,7 +59,7 @@ jobs: rDataPipeline::fair_init( name = "Sonia Mitchell", identifier = "https://orcid.org/0000-0003-1536-2066", - endpoint = "http://127.0.0.1:8000:8000/api/") + endpoint = "http://127.0.0.1:8000/api/") shell: Rscript {0} - name: Test coverage env: diff --git a/R/check_dataproduct_exists.R b/R/check_dataproduct_exists.R index 61b04835..696ff132 100644 --- a/R/check_dataproduct_exists.R +++ b/R/check_dataproduct_exists.R @@ -21,7 +21,7 @@ check_dataproduct_exists <- function(write_dataproduct, namespace = write_namespace_id), endpoint = endpoint) - write_namespace_url <- file.path("http://127.0.0.1:8000:8000", "api", + write_namespace_url <- file.path("http://127.0.0.1:8000", "api", "namespace", write_namespace_id) write_namespace <- get_entity(write_namespace_url)$name diff --git a/R/check_exists.R b/R/check_exists.R index 00f61575..94da5196 100644 --- a/R/check_exists.R +++ b/R/check_exists.R @@ -14,7 +14,7 @@ check_exists <- function(table, query) { - output <- httr::GET(paste0("http://127.0.0.1:8000:8000/api/", table, ""), + output <- httr::GET(paste0("http://127.0.0.1:8000/api/", table, ""), query = query) if (any(names(output) == "status_code")) { diff --git a/R/create_config.R b/R/create_config.R index aecdc07b..a1cb93dc 100644 --- a/R/create_config.R +++ b/R/create_config.R @@ -33,7 +33,7 @@ create_config <- function(path, # Generate run_metadata block run_metadata <- list(description = description, - local_data_registry_url = "http://127.0.0.1:8000:8000/api/", + local_data_registry_url = "http://127.0.0.1:8000/api/", remote_data_registry_url = "https://data.scrc.uk/api/", default_input_namespace = input_namespace, default_output_namespace = output_namespace, diff --git a/R/fair_init.R b/R/fair_init.R index 1a9ceb38..1666bff4 100644 --- a/R/fair_init.R +++ b/R/fair_init.R @@ -11,7 +11,7 @@ #' fair_init <- function(name, identifier, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { user_url <- get_url(table = "users", query = list(username = "admin"), diff --git a/R/fair_run.R b/R/fair_run.R index bea63e8f..3be69ccb 100644 --- a/R/fair_run.R +++ b/R/fair_run.R @@ -7,7 +7,7 @@ #' @export #' fair_run <- function(path = "config.yaml", - endpoint = "http://127.0.0.1:8000:8000/api/", + endpoint = "http://127.0.0.1:8000/api/", skip = FALSE) { # Save names in data store diff --git a/R/get_dataproduct.R b/R/get_dataproduct.R index 80660726..669f6340 100644 --- a/R/get_dataproduct.R +++ b/R/get_dataproduct.R @@ -10,7 +10,7 @@ get_dataproduct <- function(data_product, version, namespace, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { # Get provenance URL namespace_entry <- get_entry("namespace", list(name = namespace), diff --git a/R/get_entry.R b/R/get_entry.R index 0b2f94a0..bf6e56e3 100644 --- a/R/get_entry.R +++ b/R/get_entry.R @@ -10,7 +10,7 @@ #' @export #' @family get functions #' -get_entry <- function(table, query, endpoint = "http://127.0.0.1:8000:8000/api/") { +get_entry <- function(table, query, endpoint = "http://127.0.0.1:8000/api/") { key <- get_token() h <- c(Authorization = paste("token", key)) diff --git a/R/get_existing.R b/R/get_existing.R index 7484a380..539f57a0 100644 --- a/R/get_existing.R +++ b/R/get_existing.R @@ -19,7 +19,7 @@ get_existing <- function(table, limit_results = TRUE, detail = "all", - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { if (!check_table_exists(table)) usethis::ui_stop(paste( diff --git a/R/get_fields.R b/R/get_fields.R index 2b5efc62..a4a1f88a 100644 --- a/R/get_fields.R +++ b/R/get_fields.R @@ -10,7 +10,7 @@ #' @return Returns a \code{data.frame} of fields and their attributes set to #' "none" #' -get_fields <- function(table, endpoint = "http://127.0.0.1:8000:8000/api/") { +get_fields <- function(table, endpoint = "http://127.0.0.1:8000/api/") { # Add token to options request header key <- get_token() diff --git a/R/get_id.R b/R/get_id.R index 55ce60a2..e5859ca7 100644 --- a/R/get_id.R +++ b/R/get_id.R @@ -14,7 +14,7 @@ #' get_id <- function(table, query = list(), - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { output <- get_entry(table, query, endpoint) diff --git a/R/get_tables.R b/R/get_tables.R index a5c9c554..4b6b625a 100644 --- a/R/get_tables.R +++ b/R/get_tables.R @@ -6,7 +6,7 @@ #' @return a character vector of tables #' @keywords internal #' -get_tables <- function(endpoint = "http://127.0.0.1:8000:8000/api/") { +get_tables <- function(endpoint = "http://127.0.0.1:8000/api/") { httr::GET(endpoint) %>% httr::content(as = "text", encoding = "UTF-8") %>% diff --git a/R/get_url.R b/R/get_url.R index b605d619..e9e8a42a 100644 --- a/R/get_url.R +++ b/R/get_url.R @@ -14,7 +14,7 @@ #' get_url <- function(table, query = list(), - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { output <- get_entry(table = table, query = query, diff --git a/R/new_author.R b/R/new_author.R index 4ba749fa..4c65ca57 100644 --- a/R/new_author.R +++ b/R/new_author.R @@ -15,7 +15,7 @@ #' new_author <- function(name, identifier, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { data <- list() diff --git a/R/new_code_repo_release.R b/R/new_code_repo_release.R index e87d61d2..011e51cd 100644 --- a/R/new_code_repo_release.R +++ b/R/new_code_repo_release.R @@ -19,7 +19,7 @@ new_code_repo_release <- function(name, version, object_url, website, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { data <- list(name = name, version = version, diff --git a/R/new_code_run.R b/R/new_code_run.R index aabaef56..1e463899 100644 --- a/R/new_code_run.R +++ b/R/new_code_run.R @@ -31,7 +31,7 @@ new_code_run <- function(run_date, submission_script_url, inputs_urls = list(), outputs_urls = list(), - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { data <- list(run_date = run_date, inputs = inputs_urls, diff --git a/R/new_data_product.R b/R/new_data_product.R index 3e7db4d5..010b8b95 100644 --- a/R/new_data_product.R +++ b/R/new_data_product.R @@ -19,7 +19,7 @@ new_data_product <- function(name, version, object_url, namespace_url, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { post_data(table = "data_product", data = list(name = name, diff --git a/R/new_external_object.R b/R/new_external_object.R index 3b1ccfeb..d251b9ac 100644 --- a/R/new_external_object.R +++ b/R/new_external_object.R @@ -30,7 +30,7 @@ new_external_object <- function(doi_or_unique_name, description, data_product_url, original_store_url, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { data <- list(doi_or_unique_name = doi_or_unique_name, release_date = release_date, diff --git a/R/new_file_type.R b/R/new_file_type.R index df0e8bf8..885d5123 100644 --- a/R/new_file_type.R +++ b/R/new_file_type.R @@ -12,7 +12,7 @@ #' new_file_type <- function(name, extension, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { post_data(table = "file_type", data = list(name = name, diff --git a/R/new_issue.R b/R/new_issue.R index c7667bbe..7fa54fd7 100644 --- a/R/new_issue.R +++ b/R/new_issue.R @@ -16,7 +16,7 @@ new_issue <- function(severity, description, component_issues, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { post_data(table = "issue", data = list(severity = severity, diff --git a/R/new_keyword.R b/R/new_keyword.R index f9c6fac6..d8b87927 100644 --- a/R/new_keyword.R +++ b/R/new_keyword.R @@ -16,7 +16,7 @@ new_keyword <- function(object_url, keyphrase, identifier, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { data <- list(object = object_url, keyphrase = keyphrase) diff --git a/R/new_licence.R b/R/new_licence.R index eca96b9c..11006fe6 100644 --- a/R/new_licence.R +++ b/R/new_licence.R @@ -13,7 +13,7 @@ #' new_licence <- function(object_url, licence_info, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { post_data(table = "licence", data = list(object = object_url, diff --git a/R/new_namespace.R b/R/new_namespace.R index 5c0ec90b..a15a267f 100644 --- a/R/new_namespace.R +++ b/R/new_namespace.R @@ -16,7 +16,7 @@ new_namespace <- function(name, full_name, website, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { data <- list(name = name) diff --git a/R/new_object.R b/R/new_object.R index a9ff3ed4..4cbe6c6a 100644 --- a/R/new_object.R +++ b/R/new_object.R @@ -20,7 +20,7 @@ new_object <- function(description, storage_location_url, authors_url, file_type_url, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { data <- list() diff --git a/R/new_object_component.R b/R/new_object_component.R index 018b8c26..08f9da7f 100644 --- a/R/new_object_component.R +++ b/R/new_object_component.R @@ -30,7 +30,7 @@ new_object_component <- function(object_url, description, whole_object = FALSE, issues_urls, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { data <- list(object = object_url, name = name, diff --git a/R/new_quality_controlled.R b/R/new_quality_controlled.R index 043c5965..38eab741 100644 --- a/R/new_quality_controlled.R +++ b/R/new_quality_controlled.R @@ -11,7 +11,7 @@ #' @family new functions #' new_quality_controlled <- function(object_url, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { post_data(table = "quality_controlled", data = list(object = object_url), diff --git a/R/new_storage_location.R b/R/new_storage_location.R index 2da9beeb..4ff75e14 100644 --- a/R/new_storage_location.R +++ b/R/new_storage_location.R @@ -21,7 +21,7 @@ new_storage_location <- function(path, hash, public, storage_root_url, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { data <- list(path = path, hash = hash, storage_root = storage_root_url) diff --git a/R/new_storage_root.R b/R/new_storage_root.R index 1c56dff7..76619210 100644 --- a/R/new_storage_root.R +++ b/R/new_storage_root.R @@ -15,7 +15,7 @@ #' new_storage_root <- function(root, local, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { data <- list(root = root) diff --git a/R/new_user_author.R b/R/new_user_author.R index 6a1238d9..ce81dfd2 100644 --- a/R/new_user_author.R +++ b/R/new_user_author.R @@ -14,7 +14,7 @@ #' new_user_author <- function(user_url, author_url, - endpoint = "http://127.0.0.1:8000:8000/api/") { + endpoint = "http://127.0.0.1:8000/api/") { data <- list(user = user_url, author = author_url) diff --git a/R/post_data.R b/R/post_data.R index f0fbc7fb..af432d56 100644 --- a/R/post_data.R +++ b/R/post_data.R @@ -22,7 +22,7 @@ post_data <- function(table, data, endpoint) { # Sometimes an error is returned from the local registry: # "Error in curl::curl_fetch_memory(url, handle = handle) : - # Failed to connect to 127.0.0.1:8000 port 8000: Connection refused" + # Failed to connect to 127.0.0.1 port 8000: Connection refused" # Repeating the action works eventually... continue <- TRUE while (continue) { diff --git a/man/fair_init.Rd b/man/fair_init.Rd index 046097cf..c7ea660b 100644 --- a/man/fair_init.Rd +++ b/man/fair_init.Rd @@ -4,7 +4,7 @@ \alias{fair_init} \title{fair_init} \usage{ -fair_init(name, identifier, endpoint = "http://127.0.0.1:8000:8000/api/") +fair_init(name, identifier, endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{name}{a \code{string} specifying the full name or organisation name of diff --git a/man/fair_run.Rd b/man/fair_run.Rd index a2016293..fa8b6464 100644 --- a/man/fair_run.Rd +++ b/man/fair_run.Rd @@ -6,7 +6,7 @@ \usage{ fair_run( path = "config.yaml", - endpoint = "http://127.0.0.1:8000:8000/api/", + endpoint = "http://127.0.0.1:8000/api/", skip = FALSE ) } diff --git a/man/get_dataproduct.Rd b/man/get_dataproduct.Rd index efe5ec15..e242024d 100644 --- a/man/get_dataproduct.Rd +++ b/man/get_dataproduct.Rd @@ -8,7 +8,7 @@ get_dataproduct( data_product, version, namespace, - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/get_entry.Rd b/man/get_entry.Rd index c027509e..d6491167 100644 --- a/man/get_entry.Rd +++ b/man/get_entry.Rd @@ -4,7 +4,7 @@ \alias{get_entry} \title{Return all fields associated with a table entry in the data registry} \usage{ -get_entry(table, query, endpoint = "http://127.0.0.1:8000:8000/api/") +get_entry(table, query, endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{table}{a \code{string} specifying the name of the table} diff --git a/man/get_existing.Rd b/man/get_existing.Rd index 108fe48c..d5fcea67 100644 --- a/man/get_existing.Rd +++ b/man/get_existing.Rd @@ -8,7 +8,7 @@ get_existing( table, limit_results = TRUE, detail = "all", - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/get_fields.Rd b/man/get_fields.Rd index c835ef5f..7d240918 100644 --- a/man/get_fields.Rd +++ b/man/get_fields.Rd @@ -4,7 +4,7 @@ \alias{get_fields} \title{Get fields from table} \usage{ -get_fields(table, endpoint = "http://127.0.0.1:8000:8000/api/") +get_fields(table, endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{table}{a \code{string} specifying the name of the table} diff --git a/man/get_id.Rd b/man/get_id.Rd index c39b095d..92d753c0 100644 --- a/man/get_id.Rd +++ b/man/get_id.Rd @@ -4,7 +4,7 @@ \alias{get_id} \title{Get ID} \usage{ -get_id(table, query = list(), endpoint = "http://127.0.0.1:8000:8000/api/") +get_id(table, query = list(), endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{table}{a \code{string} specifying the name of the table} diff --git a/man/get_tables.Rd b/man/get_tables.Rd index 7b0885fc..b5b8ff7b 100644 --- a/man/get_tables.Rd +++ b/man/get_tables.Rd @@ -4,7 +4,7 @@ \alias{get_tables} \title{Get tables from registry} \usage{ -get_tables(endpoint = "http://127.0.0.1:8000:8000/api/") +get_tables(endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{endpoint}{a \code{string} specifying the registry endpoint} diff --git a/man/get_url.Rd b/man/get_url.Rd index d0166a3d..0b2484cd 100644 --- a/man/get_url.Rd +++ b/man/get_url.Rd @@ -4,7 +4,7 @@ \alias{get_url} \title{Get URL} \usage{ -get_url(table, query = list(), endpoint = "http://127.0.0.1:8000:8000/api/") +get_url(table, query = list(), endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{table}{a \code{string} specifying the name of the table} diff --git a/man/new_author.Rd b/man/new_author.Rd index e4356cae..278a2352 100644 --- a/man/new_author.Rd +++ b/man/new_author.Rd @@ -4,7 +4,7 @@ \alias{new_author} \title{Post entry to author table} \usage{ -new_author(name, identifier, endpoint = "http://127.0.0.1:8000:8000/api/") +new_author(name, identifier, endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{name}{a \code{string} specifying the full name or organisation name of diff --git a/man/new_code_repo_release.Rd b/man/new_code_repo_release.Rd index f7b7d973..2c5f6673 100644 --- a/man/new_code_repo_release.Rd +++ b/man/new_code_repo_release.Rd @@ -9,7 +9,7 @@ new_code_repo_release( version, object_url, website, - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/new_code_run.Rd b/man/new_code_run.Rd index 4247e32d..1b19938e 100644 --- a/man/new_code_run.Rd +++ b/man/new_code_run.Rd @@ -12,7 +12,7 @@ new_code_run( submission_script_url, inputs_urls = list(), outputs_urls = list(), - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/new_data_product.Rd b/man/new_data_product.Rd index 3a585a06..efd29a5e 100644 --- a/man/new_data_product.Rd +++ b/man/new_data_product.Rd @@ -9,7 +9,7 @@ new_data_product( version, object_url, namespace_url, - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/new_external_object.Rd b/man/new_external_object.Rd index 3aaee275..bf811df5 100644 --- a/man/new_external_object.Rd +++ b/man/new_external_object.Rd @@ -12,7 +12,7 @@ new_external_object( description, data_product_url, original_store_url, - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/new_file_type.Rd b/man/new_file_type.Rd index 464e296c..e8d4f969 100644 --- a/man/new_file_type.Rd +++ b/man/new_file_type.Rd @@ -4,7 +4,7 @@ \alias{new_file_type} \title{Post entry to file_type table} \usage{ -new_file_type(name, extension, endpoint = "http://127.0.0.1:8000:8000/api/") +new_file_type(name, extension, endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{name}{a \code{string} specifying the name of the file type} diff --git a/man/new_issue.Rd b/man/new_issue.Rd index e84523ca..09e0c49a 100644 --- a/man/new_issue.Rd +++ b/man/new_issue.Rd @@ -8,7 +8,7 @@ new_issue( severity, description, component_issues, - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/new_keyword.Rd b/man/new_keyword.Rd index f9192883..50f6ef2f 100644 --- a/man/new_keyword.Rd +++ b/man/new_keyword.Rd @@ -8,7 +8,7 @@ new_keyword( object_url, keyphrase, identifier, - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/new_licence.Rd b/man/new_licence.Rd index 406d14d9..f033b72f 100644 --- a/man/new_licence.Rd +++ b/man/new_licence.Rd @@ -4,7 +4,7 @@ \alias{new_licence} \title{Post entry to licence table} \usage{ -new_licence(object_url, licence_info, endpoint = "http://127.0.0.1:8000:8000/api/") +new_licence(object_url, licence_info, endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{object_url}{a \code{string} specifying the URL of an \code{object}} diff --git a/man/new_namespace.Rd b/man/new_namespace.Rd index 4ab6d6ce..56468af8 100644 --- a/man/new_namespace.Rd +++ b/man/new_namespace.Rd @@ -8,7 +8,7 @@ new_namespace( name, full_name, website, - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/new_object.Rd b/man/new_object.Rd index a1c2f770..75925419 100644 --- a/man/new_object.Rd +++ b/man/new_object.Rd @@ -9,7 +9,7 @@ new_object( storage_location_url, authors_url, file_type_url, - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/new_object_component.Rd b/man/new_object_component.Rd index e4ebcc9a..18551853 100644 --- a/man/new_object_component.Rd +++ b/man/new_object_component.Rd @@ -10,7 +10,7 @@ new_object_component( description, whole_object = FALSE, issues_urls, - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/new_quality_controlled.Rd b/man/new_quality_controlled.Rd index 78016e7e..691f8860 100644 --- a/man/new_quality_controlled.Rd +++ b/man/new_quality_controlled.Rd @@ -4,7 +4,7 @@ \alias{new_quality_controlled} \title{Post entry to quality_controlled table} \usage{ -new_quality_controlled(object_url, endpoint = "http://127.0.0.1:8000:8000/api/") +new_quality_controlled(object_url, endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{object_url}{a \code{string} specifying the URL of an \code{object}} diff --git a/man/new_storage_location.Rd b/man/new_storage_location.Rd index b6e9c62d..39af80c9 100644 --- a/man/new_storage_location.Rd +++ b/man/new_storage_location.Rd @@ -9,7 +9,7 @@ new_storage_location( hash, public, storage_root_url, - endpoint = "http://127.0.0.1:8000:8000/api/" + endpoint = "http://127.0.0.1:8000/api/" ) } \arguments{ diff --git a/man/new_storage_root.Rd b/man/new_storage_root.Rd index 97b23028..fa9e8b90 100644 --- a/man/new_storage_root.Rd +++ b/man/new_storage_root.Rd @@ -4,7 +4,7 @@ \alias{new_storage_root} \title{Post entry to storage_root table} \usage{ -new_storage_root(root, local, endpoint = "http://127.0.0.1:8000:8000/api/") +new_storage_root(root, local, endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{root}{a \code{string} specifying the URI of a diff --git a/man/new_user_author.Rd b/man/new_user_author.Rd index 780a8209..298e8144 100644 --- a/man/new_user_author.Rd +++ b/man/new_user_author.Rd @@ -4,7 +4,7 @@ \alias{new_user_author} \title{Post entry to user_author table} \usage{ -new_user_author(user_url, author_url, endpoint = "http://127.0.0.1:8000:8000/api/") +new_user_author(user_url, author_url, endpoint = "http://127.0.0.1:8000/api/") } \arguments{ \item{user_url}{a \code{string} specifying the URL of an existing diff --git a/tests/testthat.R b/tests/testthat.R index 9b14a638..6ea95e19 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -5,7 +5,7 @@ library(rDataPipeline) # registry and CLI being installed and will therefore fail. if (Sys.getenv("_RUN_TESTS_") != "") { - Sys.setenv(FDP_endpoint = "http://127.0.0.1:8000:8000/api/") + Sys.setenv(FDP_endpoint = "http://127.0.0.1:8000/api/") endpoint <- Sys.getenv("FDP_endpoint") testthat::test_check("rDataPipeline") } From 902c8cb897e14e015fbe35003fc8bd666b3ea640 Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Tue, 8 Oct 2024 08:17:59 +0100 Subject: [PATCH 10/13] Fix always in workflow --- .github/workflows/test-build.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index 14a82881..5ff699d0 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -40,9 +40,8 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.12' - #architecture: 'x64' - name: Checkout FAIRDataPipeline/FAIR-CLI - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: FAIRDataPipeline/FAIR-CLI path: FAIR-CLI @@ -86,7 +85,7 @@ jobs: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") shell: Rscript {0} - name: Show testthat output - if: always() + if: ${{ !cancelled() }} run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true shell: bash - name: Upload check results From 3465ae84efb7d9d5a189d4fa9efffdf0db72b29a Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Tue, 8 Oct 2024 08:19:50 +0100 Subject: [PATCH 11/13] Remove email address --- DESCRIPTION | 2 +- man/rDataPipeline-package.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ab7e1cfc..93f84c98 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rDataPipeline Title: Functions to Interact with the 'FAIR Data Pipeline' Version: 0.60.0 -Authors@R: c(person("Sonia", "Mitchell", email = "sonia.mitchell@glasgow.ac.uk", +Authors@R: c(person("Sonia", "Mitchell", role = c("aut"), comment = c(ORCID = "0000-0003-1536-2066")), person("Ryan", "Field", email = "ryan.field@glasgow.ac.uk", role = c("cre", "aut"), comment = c(ORCID = "0000-0002-4424-9890"))) diff --git a/man/rDataPipeline-package.Rd b/man/rDataPipeline-package.Rd index 1677ed67..2d498540 100644 --- a/man/rDataPipeline-package.Rd +++ b/man/rDataPipeline-package.Rd @@ -26,7 +26,7 @@ Useful links: Authors: \itemize{ - \item Sonia Mitchell \email{sonia.mitchell@glasgow.ac.uk} (\href{https://orcid.org/0000-0003-1536-2066}{ORCID}) + \item Sonia Mitchell (\href{https://orcid.org/0000-0003-1536-2066}{ORCID}) } } From 539a1a6c9956fdf896fb42769395c6be7eec241e Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Tue, 8 Oct 2024 08:40:13 +0100 Subject: [PATCH 12/13] Update Artifact version --- .github/workflows/test-build.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index 5ff699d0..19f14876 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -3,9 +3,6 @@ on: branches: - '*' workflow_dispatch: -# pull_request: -# branches: -# - master jobs: R-CMD-check: @@ -89,8 +86,10 @@ jobs: run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true shell: bash - name: Upload check results - if: failure() - uses: actions/upload-artifact@main + if: ${{ failure() }} + uses: actions/upload-artifact@v4 with: name: ${{ runner.os }}-r${{ matrix.config.r }}-results path: check + overwrite: true + include-hidden-files: true From 24d43e44ff156dc173ef2c98d77f586f9f5c91e4 Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Tue, 8 Oct 2024 08:43:58 +0100 Subject: [PATCH 13/13] Update cache version in workflow --- .github/workflows/pkgdown.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 56332955..ed654130 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -14,7 +14,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 @@ -32,7 +32,7 @@ jobs: shell: Rscript {0} - name: Restore R package cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.R_LIBS_USER }} key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}