datalad / datalad-catalog

Create a user-friendly data catalog from structured metadata
https://datalad-catalog.netlify.app
MIT License
14 stars 12 forks source link

`add` result should/could report ID of added record #316

Closed mih closed 12 months ago

mih commented 1 year ago

I created a new catalog, I added a record, I get:

{"action": "catalog_add", "message": "Metadata items successfully added to catalog", "path": "cat-dir", "status": "ok"}

There is no information on what record was added. However, my next task is set-super, which requires me to specify a dataset ID and a VERSION. IN order to provide this information, I either need to inspect the input file(s), or I need to compare the state of the metadata output directory pre vs post.

I think it would be sensible to include this information in the result.

jsheunis commented 1 year ago

In addition, the current result record is only yielded once at the end of the command execution, and not once per catalog record addition which would be more in line with results handling in datalad core and extensions.

I'm currently working on a major refactor of datalad-catalog commands and entrypoints, and current changes in that PR includes a fix to render results once per catalog addition: https://github.com/datalad/datalad-catalog/pull/309/commits/31662295c4a00846aef6b74b79e30d03984c8bee#diff-25a27b620d6430e66149657933908bf1722b107d7dfc5e34fe2b004644cd95ba

Feels like that would also be a good place to update the result record to include information about the added catalog record.

However, if this change is required sooner, an interim change in current main will be easy enough.

jsheunis commented 12 months ago

Closed by https://github.com/datalad/datalad-catalog/pull/309