Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix new r #205

Merged
merged 13 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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') }}
Expand Down
48 changes: 22 additions & 26 deletions .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ on:
branches:
- '*'
workflow_dispatch:
# pull_request:
# branches:
# - master

jobs:
R-CMD-check:
Expand All @@ -17,14 +14,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:
Expand All @@ -37,14 +34,11 @@ jobs:
rcmdcheck
remotes

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
- name: Install local registry
run: curl -fsSL https://data.scrc.uk/static/localregistry.sh | /bin/bash -s -- -b main
python-version: '3.12'
- name: Checkout FAIRDataPipeline/FAIR-CLI
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: FAIRDataPipeline/FAIR-CLI
path: FAIR-CLI
Expand All @@ -60,25 +54,25 @@ jobs:
run: |
cd ../FAIR-CLI
poetry install
source .venv/bin/activate
cd ${{ github.workspace }}
source $VENV
cd '${{ github.workspace }}'
fair registry install --version main
fair init --ci
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 : |
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
Expand All @@ -88,12 +82,14 @@ 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
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
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/")
shell: Rscript {0}
- name: Test coverage
env:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rDataPipeline
Title: Functions to Interact with the 'FAIR Data Pipeline'
Version: 0.6.0
Authors@R: c(person("Sonia", "Mitchell", email = "[email protected]",
Version: 0.60.0
Authors@R: c(person("Sonia", "Mitchell",
role = c("aut"), comment = c(ORCID = "0000-0003-1536-2066")),
person("Ryan", "Field", email = "[email protected]", role = c("cre", "aut"),
comment = c(ORCID = "0000-0002-4424-9890")))
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/check_dataproduct_exists.R
Original file line number Diff line number Diff line change
Expand Up @@ -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", "api",
"namespace", write_namespace_id)
write_namespace <- get_entity(write_namespace_url)$name

Expand Down
2 changes: 1 addition & 1 deletion R/check_exists.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/", table, ""),
query = query)

if (any(names(output) == "status_code")) {
Expand Down
2 changes: 1 addition & 1 deletion R/create_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/",
remote_data_registry_url = "https://data.scrc.uk/api/",
default_input_namespace = input_namespace,
default_output_namespace = output_namespace,
Expand Down
2 changes: 1 addition & 1 deletion R/fair_init.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#'
fair_init <- function(name,
identifier,
endpoint = "http://localhost:8000/api/") {
endpoint = "http://127.0.0.1:8000/api/") {

user_url <- get_url(table = "users",
query = list(username = "admin"),
Expand Down
2 changes: 1 addition & 1 deletion R/fair_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @export
#'
fair_run <- function(path = "config.yaml",
endpoint = "http://localhost:8000/api/",
endpoint = "http://127.0.0.1:8000/api/",
skip = FALSE) {

# Save names in data store
Expand Down
2 changes: 1 addition & 1 deletion R/get_dataproduct.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
get_dataproduct <- function(data_product,
version,
namespace,
endpoint = "http://localhost:8000/api/") {
endpoint = "http://127.0.0.1:8000/api/") {
# Get provenance URL
namespace_entry <- get_entry("namespace",
list(name = namespace),
Expand Down
2 changes: 1 addition & 1 deletion R/get_entity.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/get_entry.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {

key <- get_token()
h <- c(Authorization = paste("token", key))
Expand Down
2 changes: 1 addition & 1 deletion R/get_existing.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {

if (!check_table_exists(table))
usethis::ui_stop(paste(
Expand Down
2 changes: 1 addition & 1 deletion R/get_fields.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {

# Add token to options request header
key <- get_token()
Expand Down
2 changes: 1 addition & 1 deletion R/get_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#'
get_id <- function(table,
query = list(),
endpoint = "http://localhost:8000/api/") {
endpoint = "http://127.0.0.1:8000/api/") {

output <- get_entry(table, query, endpoint)

Expand Down
2 changes: 1 addition & 1 deletion R/get_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {

httr::GET(endpoint) %>%
httr::content(as = "text", encoding = "UTF-8") %>%
Expand Down
2 changes: 1 addition & 1 deletion R/get_url.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#'
get_url <- function(table,
query = list(),
endpoint = "http://localhost:8000/api/") {
endpoint = "http://127.0.0.1:8000/api/") {

output <- get_entry(table = table,
query = query,
Expand Down
2 changes: 1 addition & 1 deletion R/new_author.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#'
new_author <- function(name,
identifier,
endpoint = "http://localhost:8000/api/") {
endpoint = "http://127.0.0.1:8000/api/") {

data <- list()

Expand Down
2 changes: 1 addition & 1 deletion R/new_code_repo_release.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {

data <- list(name = name,
version = version,
Expand Down
2 changes: 1 addition & 1 deletion R/new_code_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {

data <- list(run_date = run_date,
inputs = inputs_urls,
Expand Down
2 changes: 1 addition & 1 deletion R/new_data_product.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {

post_data(table = "data_product",
data = list(name = name,
Expand Down
2 changes: 1 addition & 1 deletion R/new_external_object.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {

data <- list(doi_or_unique_name = doi_or_unique_name,
release_date = release_date,
Expand Down
2 changes: 1 addition & 1 deletion R/new_file_type.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#'
new_file_type <- function(name,
extension,
endpoint = "http://localhost:8000/api/") {
endpoint = "http://127.0.0.1:8000/api/") {

post_data(table = "file_type",
data = list(name = name,
Expand Down
2 changes: 1 addition & 1 deletion R/new_issue.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
new_issue <- function(severity,
description,
component_issues,
endpoint = "http://localhost:8000/api/") {
endpoint = "http://127.0.0.1:8000/api/") {

post_data(table = "issue",
data = list(severity = severity,
Expand Down
2 changes: 1 addition & 1 deletion R/new_keyword.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
new_keyword <- function(object_url,
keyphrase,
identifier,
endpoint = "http://localhost:8000/api/") {
endpoint = "http://127.0.0.1:8000/api/") {

data <- list(object = object_url,
keyphrase = keyphrase)
Expand Down
2 changes: 1 addition & 1 deletion R/new_licence.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
new_licence <- function(object_url,
licence_info,
endpoint = "http://localhost:8000/api/") {
endpoint = "http://127.0.0.1:8000/api/") {

post_data(table = "licence",
data = list(object = object_url,
Expand Down
2 changes: 1 addition & 1 deletion R/new_namespace.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
new_namespace <- function(name,
full_name,
website,
endpoint = "http://localhost:8000/api/") {
endpoint = "http://127.0.0.1:8000/api/") {

data <- list(name = name)

Expand Down
2 changes: 1 addition & 1 deletion R/new_object.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {

data <- list()

Expand Down
2 changes: 1 addition & 1 deletion R/new_object_component.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {

data <- list(object = object_url,
name = name,
Expand Down
2 changes: 1 addition & 1 deletion R/new_quality_controlled.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {

post_data(table = "quality_controlled",
data = list(object = object_url),
Expand Down
2 changes: 1 addition & 1 deletion R/new_storage_location.R
Original file line number Diff line number Diff line change
Expand Up @@ -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/api/") {
data <- list(path = path,
hash = hash,
storage_root = storage_root_url)
Expand Down
2 changes: 1 addition & 1 deletion R/new_storage_root.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#'
new_storage_root <- function(root,
local,
endpoint = "http://localhost:8000/api/") {
endpoint = "http://127.0.0.1:8000/api/") {

data <- list(root = root)

Expand Down
Loading
Loading