mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
materialise data manager tools with their conf id
DataManagerTool resolves the registry by the <data_manager id> conf id, which may differ from the tool XML id (test_data_manager_async_submission_with_mismatched_conf_id). Eager threads it through load_hidden_tool(data_manager_id=...); lazy materialisation built the tool from the stored source alone, so DataManagerTool.__init__ fell back to the tool id and exec_after_process failed with 'Invalid data manager requested'. Discovery now records the conf id, the index entry carries it, and _create_tool_from_stored_source restores it at materialise time. Also stamp is_local from the discovered guid — it defaulted True, which kept the ToolConfRepository branch of the shed materialise path dead even with repository metadata present.
This commit is contained in:
@@ -66,6 +66,12 @@ class ToolIndexEntry:
|
||||
# User-facing tags from ``<tool>`` config (distinct from ``labels``).
|
||||
# Surfaced for custom tool filters that bucket tools by tag.
|
||||
tags: list[str] = field(default_factory=list)
|
||||
# ``<data_manager id="...">`` from the data manager conf that references
|
||||
# this tool. The conf id and the tool XML id may differ;
|
||||
# ``DataManagerTool.exec_after_process`` resolves the registry by conf
|
||||
# id, so materialise must restore it (eager threads it through
|
||||
# ``load_hidden_tool``).
|
||||
data_manager_id: str | None = None
|
||||
|
||||
# === Tests (for /api/tools/tests_summary) ===
|
||||
test_count: int = 0
|
||||
@@ -159,6 +165,7 @@ class ToolIndexEntry:
|
||||
"require_login": self.require_login,
|
||||
"tool_type": self.tool_type,
|
||||
"tags": self.tags,
|
||||
"data_manager_id": self.data_manager_id,
|
||||
"test_count": self.test_count,
|
||||
"requirements": self.requirements,
|
||||
"container_requirements": self.container_requirements,
|
||||
@@ -202,6 +209,7 @@ class ToolIndexEntry:
|
||||
require_login=data.get("require_login", False),
|
||||
tool_type=data.get("tool_type", "default"),
|
||||
tags=data.get("tags", []),
|
||||
data_manager_id=data.get("data_manager_id"),
|
||||
test_count=data.get("test_count", 0),
|
||||
requirements=data.get("requirements", []),
|
||||
container_requirements=data.get("container_requirements", []),
|
||||
|
||||
@@ -965,6 +965,13 @@ class LazyToolBox(ToolBox):
|
||||
# eager toolbox does and what callers consult via ``has_tool``
|
||||
# / ``get_tool`` and the ``_tools_by_id`` registry.
|
||||
kwds: dict[str, Any] = {"tool_dir": stored.tool_dir}
|
||||
if entry and entry.data_manager_id:
|
||||
# The registry is keyed by the ``<data_manager id>`` conf id,
|
||||
# which may differ from the tool XML id.
|
||||
# ``DataManagerTool.__init__`` falls back to the tool id when
|
||||
# the kwd is missing and ``exec_after_process`` then can't find
|
||||
# the manager — eager threads this through ``load_hidden_tool``.
|
||||
kwds["data_manager_id"] = entry.data_manager_id
|
||||
if stored.tool_id and "/repos/" in stored.tool_id:
|
||||
kwds["guid"] = stored.tool_id
|
||||
# ``ToolConfRepository`` (lib/galaxy/tool_util/toolbox/base.py:87)
|
||||
|
||||
Reference in New Issue
Block a user