-
Notifications
You must be signed in to change notification settings - Fork 5
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
261: lookup product class when group not explicitly given #263
Conversation
Should be working now. |
@jordanpadams @nutjob4life @tloubrieu-jpl Ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Al,
Now the request:
curl 'http://localhost:8081/products/urn:nasa:pds:insight_rad::2.1/members' --header 'Accept: application/json'
Returns an empty result:
{"summary":{"q":"","hits":0,"took":13,"start":0,"limit":100,"sort":[],"properties":[]},"data":[]}
But we should have a few collections returned with the reference test dataset.
If a LIDVID referenced by the aggregate product is missing from the registry, this will result in a LidVidNotFoundException. and prevent some/all of the found LIDVIDs from being included in the results returned to the user. Such exceptions are caught and logged and do not bubble up to where exceptions are turned into non-200 HTTP responses (this behaviour also occurs in A decision needs to be made on whether it's still (ever) desirable to catch and log such errors without re-throwing. If not, re-throws should be added to each of the three catch blocks, or 341e31b should be reverted and a re-throw added to the original location in I've confirmed that the absence of collection |
@alexdunnjpl I am missing the context for the commit 341e31b but I would tell you that: Otherwise we should have a more explicit error message, saying some of the |
@tloubrieu-jpl isn't it sketchy to serve up known-incomplete data to the user? Currently, if the exception is allowed to bubble up, they're presented with a "$LIDVID does not exist in the registry", which at least tells them what they need to do to successfully make the call (harvest the missing product in question). I can implement it as-described if you're sure, though. |
I confirm that with the branch issue_261, I am getting this error message in logs:
gov.nasa.pds.api.registry.exceptions.LidVidNotFoundException: The lidvid Could not find any LIDVIDs for LID urn:nasa:pds:insight_rad:data_calibrated was not found and the response gives an empty result, which might be what I asked for in my previous comment. I will confirm that by looking into the test database. I believe we need to understand better why these integrity errors appears and then what we should do about it. |
wrapping a function around a for loop is not a value-add
@tloubrieu-jpl implemented as-requested (log warning, return retrievable elements of intended results set) Manually tested |
So @alexdunnjpl , in this case the collection is available in the registry (see request on your local test deployment https://elasticsearch:9200/registry/_doc/urn:nasa:pds:insight_rad:data_calibrated::7.0) but its status is I believe we should definitely then return all the other responses. Another case I am thinking of is a collection where products are added incrementally over time. The latest products arrived might be in a stage status, but the user would need to access all the other products collected so far and in So for ticket 261 I am thinking of 2 fixes:
For later, we can create a ticket where we will inform the user that some of the members where not retrieved. See #270 |
@tloubrieu-jpl Done(ish - let me know if you still prefer your suggested log message to the updated one). |
presence of emoji breaks branch integration testing
Thanks @alexdunnjpl I tested the request and it work as I expected. I still would like the log message to be update since it is not an integrity error. Thanks, Thomas |
Sorry I misread the error message provided by @alexdunnjpl's code update and what is proposed works for me. |
🗒️ Summary
When using products as general, also need to parse the product class from the DB because the expected group is no longer specified (this is a good thing). Modified the member transmuter to handle this condition.
⚙️ Test Data and/or Report
♻️ Related Issues
Closes #261
Closes #268