NASA-PDS / doi-service

Service and tools for generating DOIs for PDS bundles, collections, and data sets
https://nasa-pds.github.io/doi-service
Other
2 stars 3 forks source link

As a user, I want to release a DOI with a label that does not contain the DOI #344

Closed jordanpadams closed 1 year ago

jordanpadams commented 1 year ago

💪 Motivation

...so that I can release a DOI for a product even if it doesn't contain the DOI in the label

📖 Additional Details

Older versions of the PDS4 Information Model do NOT allow DOIs to be included in a label.

⚖️ Acceptance Criteria

Given a product label which lidvid has been previously reserved but without a doi defined in the label When I perform post the label for release Then I expect to get a warning saying the doi is missing in the label

Given a product label which lidvid has not been previously reserved and without a doi defined in the label When I perform post the label for release Then I expect to get a critical error saying the doi is missing in the label, the doi need to be reserved first

⚙️ Engineering Details

tloubrieu-jpl commented 1 year ago

We can raise a warning if it is missing

tloubrieu-jpl commented 1 year ago

Hi @jordanpadams, @rsjoyner

I am converting the error related to missing doi in the PDS4 label as a warning.

But now I am wondering what should happen when the doi is missing in the label:

  1. if the doi record is already in the database we can retrieve it from the lidvid or PDS3 identifier. This assumes there is a single lidid per DOI, I think this is safe to assume.
  2. if the doi record is not in the database we can: a. raise an error b. OR create a doi directly in draft status (and skip the reserve step)

I think 2b. would be eventually better since it will give more flexibility to the users but it is a bigger update in the code and I don't want to mess what was already tested/used by @rsjoyner.

My proposal is then to develop 1 and 2a and create a ticket for 2b.

jordanpadams commented 1 year ago

@tloubrieu-jpl agreed on your approach. Most future DOIs will want to reserve than come back and release at a later date

tloubrieu-jpl commented 1 year ago

@jordanpadams , @rsjoyner

When I look at the unit tests, there is a case where we update the lidvid (the version actually) associated to a DOI. I believe that is something the @rsjoyner had to do. If we need that, we should rethink the way we do it without having the DOI in the PDS4 label.

Or one option would be to, in case we have both PDS identifier and DOI in the label, to prioritize the DOI (so that we can update the lidvid). If DOI is missing, obviously we use the PDS identifier to match with the preexisting DOI (e.g. reserved).

That will make the code and the readability of the software behavior more complex though.

tloubrieu-jpl commented 1 year ago

This requirement was not validated by B13.0 I&T

tloubrieu-jpl commented 1 year ago

@gxtchen @viviant100 I was able to validate this ticket with the latest version of the doi-service.

I added the acceptance criteria since the reason for the failure of this test in I&T is most likely the lack details describing what to expect here.

viviant100 commented 1 year ago

@tloubrieu-jpl what's the version of doi-service you used to validate?

viviant100 commented 1 year ago

@gxtchen - @tloubrieu-jpl suggests to use doi-service v2.4.0-dev for testing.