podaac / cumulus-cnm-response-task

Other
1 stars 4 forks source link

CNM Schema 1.6.1 Collection object not handled #232

Open thursto77 opened 1 year ago

thursto77 commented 1 year ago

Expected Behavior

The CNMResponse::getCollection method in CNMResponse.java should correctly handle the case where the collection field is a JSON object with name/version fields. The ability to choose either a simple string or JSON object for the collection field is a new feature of the CNM 1.6.1 schema.

https://github.com/podaac/cumulus-cnm-response-task/blob/develop/src/main/java/gov/nasa/cumulus/CNMResponse.java#L312

https://github.com/podaac/cloud-notification-message-schema

collection | yes | The collection to which the granule belongs. | This may be used if a generic SNS topic for multiple providers.It can be either a string for the collection short name (e.g. GLDAS_NOAH025_3H ), or a JSON object including the collection name and version (e.g. {"name":"GLDAS_NOAH025_3H", "version":"2.0"} ). -- | -- | -- | --

Actual Behavior

When generating the CNM Response for a CNM Notification message based on the latest 1.6.1 schema, the CNMResponse::getCollection method assumes the collection is a JSON string type and returns "Unknown/Missing". This propagates to the collection attribute of the response message.

Steps to Reproduce the Problem

  1. Process the sample message linked below
  2. Examine the CNM Response message and see the Unknown/Missing value for the collection in the message attributes

https://github.com/podaac/cloud-notification-message-schema/blob/master/samples/cumulus_sns_v1.6_notification_collection_obj.json

Specifications

Background

I'm a developer working on the CLARREO Pathfinder project at LARC where we are interfacing with a recent cumulus deployment at the ASDC and came across this issue.

Thoughts

Not totally sure what the "correct" handling should be. Should it just pull the collection name from the collection/name field and use that? or should there be a new "version" attribute as well?

skorper commented 1 year ago

Thank you for reporting this issue @thursto77. We will address this in the upcoming PI and will keep you updated.