[26.1] Collapse duplicate tool versions in tool panel search results#23155
Open
itisAliRH wants to merge 1 commit into
Open
[26.1] Collapse duplicate tool versions in tool panel search results#23155itisAliRH wants to merge 1 commit into
itisAliRH wants to merge 1 commit into
Conversation
An instance may install and place more than one version of the same tool, sometimes across different panel sections. A name search matched every installed version and kept each placed version, so the tool surfaced as a duplicate in the results (seen on usegalaxy.org for pyGenomeTracks: 3.8+galaxy2 in "Graph/Display Data" and 3.9+galaxy0 in "Plots"). Collapse search results by tool lineage in `searchTools`, keeping the first (highest-ranked) occurrence and pruning the sectioned result panel so any section left empty is dropped. Reuses the existing `getVersionlessToolId` helper. Adds regression tests. Refs galaxyproject#23151
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.
Fixes #23151 (
pyGenomeTracksappearing twice in the tool panel search on usegalaxy.org).What
Collapse tool-panel search results by tool lineage so a tool installed at more than one version — even when placed in more than one panel section — surfaces as a single result. The de-duplication happens in
searchTools(via a newdedupeResultsByToolLineagehelper): it keeps the first (highest-ranked) occurrence per lineage and prunes the sectioned result panel so any section left empty by a dropped version is removed. It reuses the existinggetVersionlessToolIdhelper and is a no-op whenever nothing collapses.Why
On usegalaxy.org,
pyGenomeTracksis placed in two panel sections at two versions:graph_display_data)3.8+galaxy2plots)3.9+galaxy0The tool panel loads every installed version into its searchable set (
/api/tools?in_panel=false, keyed by fully-versioned id). A search for the tool name matched every installed version; results were then filtered to the versions actually placed in the panel (two here), and the result assembly never collapsed by lineage — so the tool rendered twice. It reads most obviously in the My Tools view, which renders results flat (no section headers), matching the reporter's observation that it disappears when logged out / in incognito.This is distinct from #23045, which fixed a recent-tools version-duplication path; the search-result assembly did not have equivalent lineage handling.
The underlying instance data (the same tool placed in two sections) is an instance tool-configuration matter for usegalaxy.org, but the client should not render the tool as a duplicate regardless — that's what this PR addresses.
How to test the changes?
pyGenomeTracks), log in and open the tool panel OR checkout on this PR and useGALAXY_URL="https://usegalaxy.eu/" make client-dev-server.License