Repository navigation
Create/update superseded_by references when submitting WorkflowExecutions and their DataObjects - #1403
Conversation
eecavanna
changed the base branch from
main
to
1333-modify-applicable-workflowexecution-and-dataobject-records-with-superseded_by-upon-metadata-deletion
March 12, 2026 07:33
eecavanna
marked this pull request as ready for review
March 18, 2026 20:23
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the POST /workflows/workflow_executions endpoint to automatically manage superseded_by links when submitting WorkflowExecution records and their associated DataObject outputs, aligning submission-time behavior with the schema’s supersession model.
Changes:
- Add submission-time logic to infer predecessor/successor WFEs from versioned WFE IDs and update
superseded_byon WFEs and output DataObjects. - Add library helpers for parsing WFE IDs, deriving predecessor/successor IDs, building regex patterns, and bulk-updating
DataObject.superseded_by. - Expand endpoint request body schema metadata (FastAPI
Body(...)title/description/examples) and add instrumentation viaduration_logger.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
nmdc_runtime/api/endpoints/workflows.py |
Implements supersession-chain updates during WFE submission and enhances request-body schema metadata. |
nmdc_runtime/api/endpoints/lib/workflow_executions.py |
Introduces helper utilities for WFE ID parsing/derivation and updating DataObject.superseded_by. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+288
to
+295
| submitted_wfe["superseded_by"] = successor_wfe_id | ||
| update_superseded_by_field_of_data_objects_having_id_in_list( | ||
| data_object_ids=submitted_wfe.get("has_output", []), | ||
| data_object_list=submitted_dobjs, | ||
| data_object_set_collection=data_object_set, | ||
| superseded_by=successor_wfe_id, | ||
| client_session=None, | ||
| ) |
Comment on lines
+324
to
+327
| workflow_execution_set.update_one( | ||
| {"id": predecessor_wfe_id}, | ||
| {"$set": {"superseded_by": submitted_wfe_id}}, | ||
| ) |
eecavanna
merged commit Mar 18, 2026
537f0fe
into
1333-modify-applicable-workflowexecution-and-dataobject-records-with-superseded_by-upon-metadata-deletion
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
🌳 The base branch of this pull request is NOT
main. 🌳On this branch, I updated the
POST /workflows/workflow_executionsAPI endpoint so that it creates/updates/deletes thesuperseded_byreferences when submittingWorkflowExecutions andDataObjects.Details
I have not added tests yet—I'll add those after merging this into the other feature branch (which is about WFE deletion, as opposed to WFE submission), https://github.com/microbiomedata/nmdc-runtime/tree/1333-modify-applicable-workflowexecution-and-dataobject-records-with-superseded_by-upon-metadata-deletion.
Related issue(s)
Fixes #1332
Related subsystem(s)
docsdirectory)Testing
I have not tested these changes yet. I will do so on the base branch (which is not
main).Documentation
docsdirectory)Maintainability
study_id: str)# TODOor# FIXMEblackto format all the Python files I created/modified