Skip to content

[26.0] Hide hidden tools in the tool form#22215

Merged
mvdbeek merged 8 commits intogalaxyproject:release_26.0from
bgruening:hidden_tools
Apr 21, 2026
Merged

[26.0] Hide hidden tools in the tool form#22215
mvdbeek merged 8 commits intogalaxyproject:release_26.0from
bgruening:hidden_tools

Conversation

@bgruening
Copy link
Copy Markdown
Member

fixes hopefully: #22214

@mvdbeek
Copy link
Copy Markdown
Member

mvdbeek commented Mar 23, 2026

ERROR    galaxy.web.framework.decorators:decorators.py:356 Uncaught exception in exposed API method:
Traceback (most recent call last):
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/web/framework/decorators.py", line 341, in decorator
    rval = func(self, trans, *args, **kwargs)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/webapps/galaxy/api/workflows.py", line 353, in workflow_dict
    ret_dict = self.workflow_contents_manager.workflow_to_dict(
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/managers/workflows.py", line 951, in workflow_to_dict
    wf_dict = self._workflow_to_dict_run(trans, stored, workflow=workflow, history=history or trans.history)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/managers/workflows.py", line 1061, in _workflow_to_dict_run
    step_model = tool.to_json(
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/tools/__init__.py", line 3130, in to_json
    "versions": self.visible_tool_versions,
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/tools/__init__.py", line 1175, in visible_tool_versions
    return [tool.version for tool in self.tool_versions if not tool.hidden]
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/tools/__init__.py", line 1175, in <listcomp>
    return [tool.version for tool in self.tool_versions if not tool.hidden]
AttributeError: 'str' object has no attribute 'hidden'

You'd probably have to go through the tool lineage to find the hidden tools ?

@ahmedhamidawan ahmedhamidawan changed the title [26.0] hide hidden tools in the tool form [26.0] Hide hidden tools in the tool form Mar 23, 2026
@ahmedhamidawan ahmedhamidawan modified the milestones: 26.1, 26.0 Mar 23, 2026
@bgruening
Copy link
Copy Markdown
Member Author

Thanks @mvdbeek I tried this in my last commit.

@mvdbeek mvdbeek self-requested a review March 24, 2026 14:58
@ahmedhamidawan ahmedhamidawan modified the milestones: 26.0, 26.1 Apr 6, 2026
mvdbeek added 3 commits April 15, 2026 12:26
Both callers only use the `tool` and (in one case) `tools` return values;
the SelectField built for `tool_version_select_field` is discarded by
every caller. Replace with direct `toolbox.get_tool(...)` calls and drop
the now-unused `__build_tool_version_select_field` helper.
Keep `versions` as the full lineage list and surface a parallel
`hidden_versions` array so clients can decide themselves whether to
hide them. Replaces the silent rewrite of `versions` to
`visible_tool_versions`, which dropped information that admins and
other clients may still want.
Use the new `hidden_versions` field from the tool build response to
drop hidden entries from the version dropdown. The currently selected
version is kept in the list even if hidden, so users linked directly
to a hidden version can still see what they are on.
@mvdbeek
Copy link
Copy Markdown
Member

mvdbeek commented Apr 15, 2026

I've dropped the unused get_tool_components method and added a new field to the API so we don't break the existing contract. Available versions are now filtered based on the hidden versions.

Copy link
Copy Markdown
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.

Still OK for you @bgruening ?

The API test `test_show_lists_hidden_versions_separately` hits
`GET /tools/{id}` (Tool.to_dict), not `/build`. Mirror the build
response so show also carries the full `versions` list plus the
parallel `hidden_versions` array.
@bgruening
Copy link
Copy Markdown
Member Author

ofc, much more elaborated now. Thanks. Sorry that I dropped the ball here. Forget about this bug already.

tool_cache is keyed by the unversioned tool id, so looking up a
lineage version via tool_cache.get_tool_by_id("tool/0.1") always
returned None and hidden_tool_versions came back empty. Look up
each lineage version through toolbox._tool_versions_by_id, which
is keyed exactly that way (tool_id -> {version: Tool}).
The test_section_multi panel section was curated to hold a single
lineage so test_only_latest_version_in_panel could assert a precise
count. Adding a second lineage inside the section broke that invariant.
The hidden-versions tools remain registered at the toolbox root, which
is all the API tests (@skip_without_tool) require.
@mvdbeek mvdbeek merged commit b190e61 into galaxyproject:release_26.0 Apr 21, 2026
54 of 58 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in Galaxy Dev - weeklies Apr 21, 2026
@itisAliRH itisAliRH deleted the hidden_tools branch April 24, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

3 participants