galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.37k stars 992 forks source link

Consolidate `state_details` and `contents_states` in histories API #17785

Open davelopez opened 5 months ago

davelopez commented 5 months ago

From Backend-WG Matrix channel discussion:

When serializing histories, the difference between state_details (https://github.com/galaxyproject/galaxy/blob/3083b5ed384398bddd5d8d835b43c5bde3cd1328/lib/galaxy/managers/histories.py#L852) and contents_states (https://github.com/galaxyproject/galaxy/blob/3083b5ed384398bddd5d8d835b43c5bde3cd1328/lib/galaxy/managers/histories.py#L858) seems to be that state_details only takes HDA states into account while contents_states takes both HDA and HDCA states. There are also a bunch of 9-year-old "remove this" comments around those serializers 😓 Also, state_details seems to be unused in the UI but used in many tests, while contents_states is used in the UI but not in any test...

Proposed solution in chat:

Let's try removing state_details and maybe state_ids as well if possible.

nsoranzo commented 5 months ago

More from the Matrix discussion and some further investigation:

Both state_details and state_ids are exposed in BioBlend.objects History objects. These objects are generated from the query /api/histories/<encoded_history_id> without parameters (i.e. the default detailed view).

Currently state_details, state_ids and contents_states are all dictionaries with dataset states as keys but return different things, e.g.:

Then there's contents_active which is a dictionary with keys deleted, hidden and active, and includes both hdas and hdcas.

Not sure how, but it would be good to consolidate these.