No Story: Persisting workflow and capability JSON fields

SQLAlchemy doesn't persist updates to JSON columns by default (more info here).

There are a few ways to get around this, and we were making a deepcopy of the capability_versions.workflow_metadata field before updating it, but this trick wasn't working for me on the workflow_requests.arguments field. Instead, I opted to flag the column as being modified in the save_entity method which tells SQLAlchemy to persist it. I made the same change to the capability_versions.workflow_metadata field so we don't have to make a deepcopy every time we want to modify it.

To reproduce the issue and see the fix:

Submit a workflow request that runs on the NAASC (use an MOUS for either restore_cms or ud_restore_and_imaging). Without the fix, the workflow_requests.arguments column will not contain the naasc_spool_dir or any other argument updates made between workflow creation and submission. With the fix, the naasc_spool_dir and several other arguments are present/updated.

I've also verified that updates to the capability_versions.workflow_metadata field (i.e. the stage updates and QA notes) still persist with this fix in place.

Edited by Daniel Nemergut

Merge request reports

Loading