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 short ids in tool panel views. #16664

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/galaxy/tool_util/toolbox/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def __init__(self, toolbox: "AbstractToolBox"):
self.__toolbox = toolbox

def has_tool(self, tool_id: str) -> bool:
return tool_id in self.__toolbox._tools_by_id
toolbox = self.__toolbox
return tool_id in toolbox._tools_by_id or tool_id in toolbox._tools_by_old_id

def get_tool(self, tool_id: str):
return self.__toolbox.get_tool(tool_id)
Expand Down Expand Up @@ -153,6 +154,7 @@ def __init__(
# so each will be present once in the above dictionary. The following
# dictionary can instead hold multiple tools with different versions.
self._tool_versions_by_id = {}
self._tools_by_old_id = {}
self._workflows_by_id = {}
# Cache for tool's to_dict calls specific to toolbox. Invalidates on toolbox reload.
self._tool_to_dict_cache = {}
Expand Down Expand Up @@ -710,9 +712,8 @@ def get_tool(self, tool_id, tool_version=None, get_all_versions=False, exact=Fal
rval.append(lineage_tool)
if not rval:
# still no tool, do a deeper search and try to match by old ids
for tool in self._tools_by_id.values():
if tool.old_id == tool_id:
rval.append(tool)
if tool_id in self._tools_by_old_id:
rval.extend(self._tools_by_old_id[tool_id])
if get_all_versions and tool_id in self._tool_versions_by_id:
for tool in self._tool_versions_by_id[tool_id].values():
if tool not in rval:
Expand Down Expand Up @@ -1152,6 +1153,7 @@ def register_tool(self, tool):
self._tools_by_id[tool_id] = tool
else:
self._tools_by_id[tool_id] = tool
self._tools_by_old_id.setdefault(tool.old_id, []).append(tool)

def package_tool(self, trans, tool_id):
"""
Expand Down
2 changes: 1 addition & 1 deletion test/integration/panel_views_1/custom_6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Custom Panel in a New Section
type: generic
items:
- type: section
name: My Completely New Sectin
name: My Completely New Section
items:
- type: label
text: The Start
Expand Down
Loading