Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collection drilling #16819

Merged
merged 9 commits into from
Oct 11, 2023
Merged

Conversation

davelopez
Copy link
Contributor

Fixes #16785

This should fix the selenium test failure:

FAILED lib/galaxy_test/selenium/test_history_multi_view.py::TestHistoryMultiView::test_list_list_display - selenium.common.exceptions.TimeoutException: Message: Failed waiting on history item 3 to become visible, visible datasets include [#dataset-f06d708dacad69d8,#dataset-da92407cb46a61f3]. Timeout waiting on CSS selector [.multi-history-panel .content-item[data-hid="3"]] to become visible.

The important stuff is in the function onViewSubCollection inside CollectionPanel.vue. I'm not 100% sure this is how we are supposed to query the elements of a sub-collection i.e. by calling /api/dataset_collections/{hdca_id}/contents/{collection_id} where hdca_id is the top HDCA in the history and collection_id is the DatasetCollection ID in DCObject, but it works on my tests... it is still a little fuzzy in my head how sub-collections work 😅

It also fixes the store by using a composed key [hdca_id + collection_id] to store and retrieve elements from a collection, since just using the collection ID can create collisions between HDCAs (top level) and sub-collections (DCOs).

How to test the changes?

  • This is a refactoring of components with existing test coverage.

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@github-actions github-actions bot added this to the 23.2 milestone Oct 9, 2023
@mvdbeek
Copy link
Member

mvdbeek commented Oct 9, 2023

I am not sure if this is the right way to handle collections ... that it isn't obvious to me doesn't mean it's not the right way to do this, but maybe a quick summary helps you make the right choice ?

Generally speaking we have 3 concepts:

  • HistoryDatasetCollectionAssociation:
    • Top level history item that has a one-to-one reference to a History and a DatasetCollection
  • DatasetCollection:
    • Contains a one-to-many reference to DatasetCollectionElement items
  • DatasetCollectionElement:
    • Links a parent collection (via dataset_collection_id) to its elements. The elements can be:
      • HistoryDatasetAssociation ("hda", via hda_id)
      • LibraryDatasetDatasetAssociation ("ldda", via ldda_id (we're not using this thankfully ... 😅 ))
      • DatasetCollection ("child_collection", via child_collection_id ... this is how nested collections work)

Ideally it'd always be clear what the item is that you're dealing with. I hope that helps clarify how you want to handle this.

@davelopez
Copy link
Contributor Author

Thank you so much for the summary! I really appreciate it. I will try to think a bit more about how to handle this with this information 👍

@davelopez davelopez marked this pull request as draft October 9, 2023 15:23
This is just to make the handling of top level HDCAs and sub-collections more consistent for fetching and storing elements in the store.
For storing and retrieving collection elements we only need to use the DatasetCollection ID whether the collection entry is an HDCA or a sub-collection.
Whether we are fetching elements for a top level HDCA or a sub-collection we need to provide the top HDCA ID and the DatasetCollection ID to fetch their elements.
@davelopez
Copy link
Contributor Author

Thanks again @mvdbeek!
I have a clearer idea of how collections work internally now. I've refactored and added a bit of docs here and there. Hopefully, it all makes more sense now. If not, please let me know and I'll give it another shot.

@davelopez davelopez marked this pull request as ready for review October 10, 2023 12:39
Copy link
Member

@mvdbeek mvdbeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! I'd love if this was closer to the API and we didn't have to invent additional models like SubCollection, but maybe that would require having a better way to access elements of a collection.

@davelopez davelopez marked this pull request as draft October 10, 2023 13:56
- Make sure the computed properties are of the right type or error out.
- Rename onViewSubCollection to onViewDatasetCollectionElement.
@davelopez davelopez marked this pull request as ready for review October 10, 2023 16:29
@mvdbeek mvdbeek merged commit 7d58fac into galaxyproject:dev Oct 11, 2023
19 checks passed
@davelopez davelopez deleted the fix_collection_drilling branch October 11, 2023 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drilling down sub-collections in the UI can be stuck in a loop in some circumstances
2 participants