Skip to content

Restore analysis adaptor's ability to store/update web_data

Created by: james-monkeyshines


When the 'evil eval' for making hashes out of strings was removed from the main adaptor code, it was added to the AnalysisAdaptor, to cater for the last remaining usage in the API, analysis.web_data. At this time the inverse operation was also removed, for stringifying a hash to be inserted or updated in the database. I believe this to be incorrect; there is a test for correct storage of web_data, but due to a bug in the test, it was not working properly; storage in the db was never tested, because data would always be retrieved from a cache instead.

Note that this relates to, and effectively reverts the code changes there; it is not intended (or useful) for an update to delete web_data from the object.

Use case

As a general principle, 'store' functions should store all of an object's data, rather than silently omit bits. In particular, EG and Production pipelines extract analysis data from the production db and insert it into core dbs, via the API - without this fix, the web_data is always set to NULL, which causes problems down the road. This is mitigated for some teams by the practice of synchronising production and core dbs, but others (VectorBase, WormBase) do not do this. I think it is better practice for pipelines to add all of the analysis data when the relevant pipeline is run, rather than relying on a script to be run at a later date to synchronise from the production db; this change supports that practice.


'store' and 'update' methods (and consequently EG and Production pipelines) work as expected.

Possible Drawbacks

None I can think of.


Have you added/modified unit tests to test the changes? Yes

If so, do the tests pass/fail? Pass

Have you run the entire test suite and no regression was detected? Yes

Merge request reports