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

--no-review argument has potential to be confused with -n (node ID) argument #305

Closed collinss-jpl closed 2 years ago

collinss-jpl commented 2 years ago

🐛 Describe the bug

During operation of the PDS DOI Service, an operator mistakenly provided -no-review (with one leading hyphen), instead of --no-review (with two leading hyphens) when trying to release records. This caused argparser to interpret -no-review as -n o-review (setting node ID to o-review). The definition of the node ID argument should be modified to prevent this potential collision.

📜 To Reproduce

Steps to reproduce the behavior:

  1. Using any installation of the DOI service, attempt release of a record, providing the incorrect -no-review flag
  2. The submission should result in an exception being thrown with this error message:
pds_doi_service.core.entities.exceptions.UnknownNodeException: node_id O-REVIEW is not found in permissible nodes dict_keys(['ATM', 'ENG', 'GEO', 'IMG', 'NAIF', 'PPI', 'RS', 'RMS', 'SBN'])

🕵️ Expected behavior

The service argparser should instead return an error stating that -no-review is an unrecognized argument, before attempting any submissions:

usage: pds_doi_cmd.py [-h] {reserve,update,release,check,list} ...
pds_doi_cmd.py: error: unrecognized arguments: -no-review

📚 Version of Software Used

2.1.1

🩺 Test Data / Additional context

🏞Screenshots

🖥 System Info


🦄 Related requirements

⚙️ Engineering Details