From efd598802ebfb471194cc2785327dcf585a11543 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sat, 4 Jul 2026 10:44:16 +0200 Subject: [PATCH] materialise data manager tools with their conf id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DataManagerTool resolves the registry by the 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. --- lib/galaxy/tool_source_store/index.py | 8 ++++++++ lib/galaxy/tools/lazy_toolbox.py | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/lib/galaxy/tool_source_store/index.py b/lib/galaxy/tool_source_store/index.py index 97f826668f1..88c89fe225b 100644 --- a/lib/galaxy/tool_source_store/index.py +++ b/lib/galaxy/tool_source_store/index.py @@ -66,6 +66,12 @@ class ToolIndexEntry: # User-facing tags from ```` config (distinct from ``labels``). # Surfaced for custom tool filters that bucket tools by tag. tags: list[str] = field(default_factory=list) + # ```` 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", []), diff --git a/lib/galaxy/tools/lazy_toolbox.py b/lib/galaxy/tools/lazy_toolbox.py index b9ea14faa1f..9a037bb366e 100644 --- a/lib/galaxy/tools/lazy_toolbox.py +++ b/lib/galaxy/tools/lazy_toolbox.py @@ -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 ```` 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)