Files
galaxy/lib
mvdbeek 3d1f2eefb2 toolbox: split panel-view shape from show-endpoint to_dict
The lazy ``to_dict`` fast path was short-circuiting *both* the
panel-view walk (intended) *and* the ``/api/tools/{id}`` show endpoint
(unintended) — they're indistinguishable at the ``to_dict(io_details=
False, link_details=False)`` callsite. ``test_legacy_biotools_xref_
injection`` caught it: the show endpoint returned the entry-shape
dict and no longer carried ``xrefs``.

Split the two call sites at the API rather than the parameter:

* ``Tool.to_panel_entry(trans)`` — new method, returns the cheap
  entry-shape dict (id/name/version/description/labels/edam/panel
  section/link). ``LazyTool`` overrides it to skip materialise.
* ``AbstractToolBox.get_tool_to_dict`` calls ``to_panel_entry`` when
  ``tool_help=False`` (the panel-view default); ``tool_help=True``
  still falls through to ``to_dict`` so the help payload renders.
* ``LazyTool.to_dict`` always materialises now — it's the
  ``/api/tools/{id}`` contract and must ship ``xrefs`` / ``versions``
  / ``is_workflow_compatible`` / ``tool_shed_repository`` / etc. The
  materialise-failure fallback now reuses ``to_panel_entry``.

Net effect: ``/api/tool_panels/{view}`` and ``/api/tools?in_panel=
true`` stay materialise-free for the lazy toolbox; ``/api/tools/{id}``
serves the full show-endpoint dict in both modes.
2026-07-28 17:27:21 +02:00
..
2026-07-22 08:11:31 +03:00