Skip to content

[26.1] Collapse duplicate tool versions in tool panel search results#23155

Open
itisAliRH wants to merge 1 commit into
galaxyproject:release_26.1from
itisAliRH:fix/tool-panel-search-lineage-dedup
Open

[26.1] Collapse duplicate tool versions in tool panel search results#23155
itisAliRH wants to merge 1 commit into
galaxyproject:release_26.1from
itisAliRH:fix/tool-panel-search-lineage-dedup

Conversation

@itisAliRH

Copy link
Copy Markdown
Member

Fixes #23151 (pyGenomeTracks appearing 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 new dedupeResultsByToolLineage helper): 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 existing getVersionlessToolId helper and is a no-op whenever nothing collapses.

Why

On usegalaxy.org, pyGenomeTracks is placed in two panel sections at two versions:

Section Version
Graph/Display Data (graph_display_data) 3.8+galaxy2
Plots (plots) 3.9+galaxy0

The 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?

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    • On an instance where one tool lineage is installed at multiple versions and placed in more than one panel section (e.g. usegalaxy.org's pyGenomeTracks), log in and open the tool panel OR checkout on this PR and use GALAXY_URL="https://usegalaxy.eu/" make client-dev-server.
    1. Switch between Full Tool Panel and My Tools and search the tool name.
    2. Before this change, the tool appears twice; after, it appears once.

License

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

1 participant