Skip to content

Add EML object as an alternative option for metadata_path #85

Merged
jagoldstein merged 16 commits intoNCEAS:masterfrom
isteves:publish_update2
May 14, 2018
Merged

Add EML object as an alternative option for metadata_path #85
jagoldstein merged 16 commits intoNCEAS:masterfrom
isteves:publish_update2

Conversation

@isteves
Copy link
Contributor

@isteves isteves commented May 9, 2018

Update to publish_update to also accept EML objects

@@ -367,6 +367,15 @@ publish_update <- function(mn,
# Get the metadata doc
message("Getting metadata from the MN.")
eml <- EML::read_eml(rawToChar(dataone::getObject(mn, metadata_pid)), asText = TRUE)
Copy link
Contributor

@maier-m maier-m May 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to close this if statement correct? or better use else if

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking into it.

isteves and others added 6 commits May 9, 2018 13:32
Added `cache: packages` back in
@isteves helpfully noted that the Travis CI builds started failing a while ago in NCEAS#86. The failures indicate issues with Ubuntu PPAs and nothing to do with our tools. Though this happened around the time R 3.5.0 was released, which is a backwards incompatible R release indue to the introduction of ALTREP. This is:

1. My attempt to fix that so all the Travis builds pass
2. Reduce the deps arcticdatautils requires to install. ncdf4 and yaml are not packages that _need_ to be installed to get started using it so they should be in Suggests
#' @param parent_child_pids (character) Optional. Resource map identifier(s) of child packages in the parent package. \code{resource_map_pid} should not be included. Not optional if the parent package contains other child packages.
#' @param child_pids (character) Optional. Child packages resource map PIDs.
#' @param metadata_path (character) Optional. Path to a metadata file to update with. If this is not set, the existing metadata document will be used.
#' @param metadata_path (character or eml) Optional. An eml class object or a path to a metadata file to update with. If this is not set, the existing metadata document will be used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can/should this arg name get changed now that it's not just a path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to change the name so that it could remain backwards-compatible. But if our preference is to make it friendlier for new users, then a name change makes sense

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's probably more important.

@isteves
Copy link
Contributor Author

isteves commented May 14, 2018

Updated with @amoeba's Travis changes so that Travis is 😺

@jagoldstein jagoldstein merged commit ad7c63a into NCEAS:master May 14, 2018

} else if(class(metadata_path) == "eml") {
# If an eml object is provided, use it directly after validating
if(!eml_validate(metadata_path)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isteves Maybe move this out of the call here so that eml always gets validated wether or not is an R object or from disk. Also maybe add a message so users know that eml is being validated in case it takes a non-trivial amount of time.

laijasmine pushed a commit that referenced this pull request Oct 2, 2020
Add EML object as an alternative option for metadata_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants