Files
galaxy/test/functional/tools/sample_data_manager_conf.xml
T
mvdbeek 56417baef9 Fix HDA leak in tool form for data managers (#22674)
When a user already has a ``data_manager_json`` bundle in their history
for a given tool data table, ``DynamicOptions.get_user_options`` builds
a synthetic options row from that bundle.

A 2025-02-18 refactor (172ef05f26, "Skip bundles that don't match data
table definition") moved ``field_entry.append(hda)`` from the end of the
row-building loop to the beginning. That shifted every declared column
index by one and put the HDA at position 0. ``get_options`` then reads
``fields[self.columns[<col>]]`` to find the option's name / value and
expects the HDA at ``fields[-1]`` — so it ends up wiring the raw HDA
into the option's ``value`` field. The unserialized HDA then crashed
``/api/tools/{id}/build`` for the data manager's own form with:

  TypeError: Object of type HistoryDatasetAssociation is not JSON serializable

Move the HDA append back after the column loop where get_options
expects it.

Regression covered by a new API test in a ``require_admin_user=True``
test class that runs ``data_manager_select`` in bundle mode to produce a
real ``data_manager_json`` bundle, then calls the build endpoint and
asserts the synthetic option is present.
2026-05-20 09:01:49 +02:00

27 lines
1013 B
XML

<data_managers tool_path="test/functional/tools">
<data_manager tool_file="data_manager.xml" id="test_data_manager" version="1.0">
<data_table name="testbeta">
<output>
<column name="value" />
<column name="path" output_ref="out_file" >
<move type="directory" relativize_symlinks="True">
<target base="${GALAXY_DATA_MANAGER_DATA_PATH}">testbeta/${value}</target>
</move>
<value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/testbeta/${value}/${path}</value_translation>
<value_translation type="function">abspath</value_translation>
</column>
</output>
</data_table>
</data_manager>
<data_manager tool_file="data_manager_select.xml" id="data_manager_select" version="1.0">
<data_table name="test_fasta_indexes">
<output>
<column name="value" />
<column name="dbkey" />
<column name="name" />
<column name="path" output_ref="out_file" />
</output>
</data_table>
</data_manager>
</data_managers>