Integration tests, framework tests and lib/galaxy_test/conftest.py
imported ApiTestCase, tool/workflow/history mixins and sample sheet
helpers from API test modules. Move them to galaxy_test.base;
api/_framework.py re-exports ApiTestCase for the API tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows stored by Galaxy 25.0 can carry validators the user-defined tool
schema no longer allows, most importantly `type: expression` (a Python
eval) on text inputs. lift_user_tool_source only dropped unknown keys,
so such rows came back "invalid" and could not be loaded at all.
The lift now also removes each validator whose type the parameter no
longer accepts, at any nesting depth (conditional test parameters and
branches, repeats, sections), and reports it in representation_errors
with its path, validator type and input name, e.g.
"inputs.1.validators.0 (unsupported 'expression' validator on input
'text')". Such rows are "lifted" and load without the validator; the
show, index and raw-source endpoints report them as "lifted" too. Only a
row that still fails validation afterwards is "invalid" and refused.
Only a validator with a string type the parameter does not accept is
dropped, and `whens` is traversed only when it is a list. Malformed
values (an unhashable or non-string validator type, a non-list `whens`)
stay in place so validation reports the row as invalid, instead of the
cleanup raising and turning the unprivileged tool list and show
endpoints, which lift every row, into a 500.
The tool form of a lifted user-defined tool now also carries a message
listing what was ignored and asking the user to edit and save the tool
again. The admin documentation describes how stored tools that no
longer match the schema are loaded.
Stored GalaxyUserTool rows went straight into YamlToolSource. Rows
written by older Galaxy versions can hold shapes today's schema rejects,
such as expression validators (evaluated with Python eval) on text
inputs, and the YAML parser honours keys the schema never allowed
(command, base_command/arguments, runtime_version, entry_points,
dynamic_options, ...).
Loading a GalaxyUserTool row now goes through lift_user_tool_source and
builds the tool from the validated model:
- fields the schema no longer accepts are dropped; the tool form payload
reports them as representation_status "lifted" and
representation_errors, the keys the unprivileged tools API already
uses, and the server logs a warning;
- a row that cannot be recovered that way is refused with a message
naming the invalid fields and how to fix the tool. The tool form and
the run endpoint report it, and tool_for_job returns no tool, so the
job handler fails a queued job of such a tool instead of preparing it.
The parser no longer trusts user-defined tools either, so this holds
even for sources that skip the lift: every input source of a
GalaxyUserTool, including repeats, conditional test parameters and
conditional branches, is parsed as untrusted, which refuses unsafe
validators; input parameters may not set dynamic_options; and root keys
outside the user-defined tool schema are refused. empty_field and
no_options validators, which the schema allows and which evaluate
nothing, are now marked safe so untrusted parsing keeps accepting them,
and the unsafe-validator refusal names the validator type.