Skip to content

Add --update_ssds_provenance option and its basic implementation - #145

Merged
MBARIMike merged 6 commits into
mbari-org:mainfrom
MBARIMike:main
Apr 3, 2026
Merged

Add --update_ssds_provenance option and its basic implementation#145
MBARIMike merged 6 commits into
mbari-org:mainfrom
MBARIMike:main

Conversation

@MBARIMike

Copy link
Copy Markdown
Collaborator

Applies to #144

Add early return in plot_2column() to avoid creating an empty
_2column_cmocean.png when no instrument variables are present.
The .env file is meant to hold an API token for updating the SSDS_Metadata database with ProcessRun information.
This uses a new provenance.py module for submitting ProcessRun data set provenance information using the CRUD-style REST API of the mooring-ssds project.
Replace the multi-step CRUD orchestration (10–15 round trips: person
lookup, software find-or-create, ProcessRun get-or-create, DataContainer
get-or-create, input/resource linking) with a single POST to the new
/api/process-runs/ endpoint.  The server now resolves or creates all
related entities atomically from natural keys (person_email,
software_name/version, output_uri, input_uris, resources).

Remove all client-side helpers that are no longer needed:
_find_first, find_person_by_email, find_software, find_datacontainer,
find_resource, _create_entity, _find_process_run_by_output, _ensure_link.

Net change: -214 lines.  Public API (get_dods_url, submit_process_run)
and all call sites in process.py are unchanged.

Closes mbari-org#144 (see also: previous junction-table linking bugs fixed while
this endpoint was being developed on the server side)
- Add producer_name and producer_description to submit_process_run()
  and populate them with execution context in _submit_provenance()
- Set software_uristring to the GitHub tree URL at the commit hash
- Add output_dodsurlstring and input_dodsurlstrings with .html suffix
  for browsable OPeNDAP URLs
- Refactor _submit_provenance() to accept base_path separately from
  output_nc, building the full path internally to match --log_file
  convention and produce correct OPeNDAP URLs
@MBARIMike
MBARIMike merged commit 26d58b0 into mbari-org:main Apr 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant