Composite datatypes such as BLAST databases, pbed and velvet keep their
data in the dataset's extra files folder, so a user-defined tool only
reached the primary HTML file through `path`. Add `extra_files_path` to
the runtime input JSON, using the same compute environment rewrite as
`$input.extra_files_path` in XML tools.
The field is only set when the folder exists: rewriting the path makes
Pulsar stage the folder, and staging fails the job if it is missing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Map list:list and list:list:paired over a list:paired_or_unpaired input
with the map_over_type /build lists, as collection_semantics.md
documents. Both fail today with "Cannot split collection in desired
fashion." /build also offers list:list as a map-over onto a sample_sheet
input, which no split can produce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Exercises MinimalJobWrapper passing the job metadata dir to discovery;
fails (failed_metadata) without that kwarg.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin accumulate_with_filter paging of single matches and filtered rows,
and that build's hdca options page splits a nested list's direct and
multirun entries across pages (limit 1), as on dev. Pin that a list and
list:list input runs a list:list whole or mapped over one inner list per
job, FormData resolving a collection value without map_over_type to the
direct entry, and showing no map-over label on dataset inputs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spec [] for multiple selects in every state representation (invalid on
single selects), execute [] across legacy/21.01/request inputs, and pin
the profile cutoffs for value="" in test loading and linting.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Two composite datasets with the same primary file but different extra
files must never be treated as cache-equivalent, regardless of how (or
whether) hash-based job matching handles composite datasets: on current
dev, with no hash-based matching at all, this holds trivially (job
cache only ever matches on identical `dataset_id`); it must continue to
hold under any future implementation, including one that computes a
composite hash covering extra files (see the discussion on
https://github.com/galaxyproject/galaxy/issues/21676), since a correct
composite hash would itself distinguish the differing extra file
content. This makes the test a durable regression guard independent of
which design for hash-based job matching on composite datasets is
eventually implemented.
Also fixes `DescribeJob._wait_for()` to request full job details,
needed for `copied_from_job_id` to be present in the response at all.
Extracted from the (unmerged, not yet pushed further) PR #23429.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
basic.py passes a type-specific default to parse_optional; factory.py called it
bare. Two divergences followed.
genomebuild - GenomeBuildParameter subclasses SelectToolParameter, so runtime
reads parse_optional(self.multiple). The model read parse_optional(), so
`genomebuild multiple="true"` modelled as required. Same shape as the select fix
in #23351, five lines away in the same function.
drill_down - the branch never called parse_optional at all, and
_common_param_kwargs only carries label/help, so an explicit optional="true" was
dropped and the model fell back to the base default. DrillDownParameterModel also
never consulted optional, so honour it in py_type and request_requires_value.
Note multiple does NOT imply optional here: DrillDownSelectToolParameter calls
ToolParameter.__init__, not SelectToolParameter.__init__. Nothing in the tree
sets drill_down optional="true", so this cannot regress an existing tool;
gx_drill_down_exact_optional.xml is added to exercise it.
Also closes coverage gaps left by #23351. The states that actually flipped there
were test_case_xml/test_case_json null, which had no cases; request::null flips
for gx_select_multiple_no_options_validation but not for its single-select
sibling, so that surface is worth asserting. The new tool had no execution
coverage - it now rides the existing multi-select test alongside
gx_select_optional_no_options_validation. Restores the workflow_step question
that was deleted rather than answered: py_type_workflow_step is unconditionally
optional, which is a separate issue from optional-by-default.
Fixes ["hg18", hg19"] in the genomebuild spec - the missing quote made YAML parse
the value as the string 'hg19"'.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G95icoGkoDKbwPotGnvQpk
Verify Galaxy correctly executes workflows whose tool_state contains representation differences from schema-unaware gxformat2 conversion.
Workflow tests cover list-form multiple selects, absent all-None sections, absent empty repeats with and without corrections, a safe-template empty repeat, lowercase JSON booleans, and connection-only section omission. Test data lives in wf_conversion/ with frozen native .ga snapshots and available format2 sources.
Tool execution tests cover explicit empty repeat, absent repeat, repeat instances, and list-form multiple select handling across legacy, 21.01, and request input formats.
Duplication check:
- No exact existing Galaxy test already imports native .ga workflows with gxformat2 conversion-artifact tool_state and executes them.
- Multiple-select coverage is adjacent to existing multi_select workflow/tool tests, but those use normal format2/tool execution paths rather than list-encoded native workflow tool_state.
- Boolean coverage is adjacent to gx_boolean tool tests for JSON booleans, but those do not cover native workflow execution from converted .ga tool_state.
- Repeat coverage is adjacent to existing repeat tools and API tests, but existing tests either require instances, index the first repeat item, or cover min-filled repeats; they do not cover omitted repeat keys in native workflow tool_state.
- The two absent-empty-repeat workflow tests intentionally overlap except for allow_tool_state_corrections, documenting that the flag does not change the current failure mode.
- The connection-only section test is not duplicated elsewhere; it covers omitted section state resolved through input_connections.
The empty_repeat_optional fixture is documented as native-only because wf_tool_state does not contain a companion format2 source.
(cherry picked from commit ef93b9f6bcfe9686069b9af2c9efadc9501a1d35)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add tests exercising implicit datatype conversion via the tool-request (async)
API alongside the legacy (sync) API: a fasta.gz input fed to the
implicit_conversion tool (fasta.gz -> fasta -> tabular), covering uploaded
(src=hda) and deferred datasets, with an explicit precondition that the input
HDA is stored compressed. Adds a TargetHistory.with_dataset_for_test_file()
populator helper to stage a real test-data file with an explicit (compressed)
ext.
Per review: the tool itself has a data input and a paired collection
input with structured_like output -- it doesn't do mapping-over.
Mapping-over is what the regression test does.
When a tool output is declared ``structured_like=<non-mapped collection
input>`` and the user maps the tool over an empty collection,
param_combinations is empty and ExecutionTracker.example_params falls
back to the raw param_template. The non-mapped collection's batch
wrapper there is never substituted with an HDCA, so
sliced_input_collection_structure crashes with
"Referenced input parameter is not a collection." The real trigger
observed in production was an upstream collection that had not finished
populating yet.
Move the representative-params logic onto MappingParameters so the
fallback branch resolves batch wrappers (and bare {src,id} refs) to
HDCA/DCE ORM objects, and raise ToolInputsNotReadyException when the
referenced collection's populated_optimized is False. The scheduler
already handles this exception by retrying, matching the behavior
__expand_collection_parameter has for mapped-over HDCAs.
Also switch sliced_input_collection_structure to derive the
collection_type via get_collection(input_collection) so the DCE path
stays consistent with the existing get_collection call that follows.
Fixes GALAXY-MAIN-4KSCZZZ0015NC.
strictify() and _fill_default_for() in convert.py ignored
parameter.default_value for optional text params, hardcoding None
for absent values. Additionally both used `or` which swallowed
empty string defaults due to Python falsiness.
This caused inconsistent behavior for absent params on tools with
value="" across input formats:
| Input | optional (no default) | optional value="" | optional value="" + regex |
|-------|----------------------|-------------------|--------------------------|
| {} | None | "" | "" |
| None | None | None | None |
| "" | "" | "" | "" |
| valid | value | value | value |
| bad | value | value | fails |
All rows now consistent across legacy, 21.01, and request formats.
Test tools added:
- gx_text_optional_with_empty_default (optional text, value="", no validator)
- gx_text_optional_with_empty_default_regex_validation (the wild case)
- gx_text_optional_regex_validation updated to have no default
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Optional text params with regex (or other) validators would reject
None/"" in request format even though the runtime correctly skips
validation for empty optional params. Add optional flag to validator
chain so None/"" short-circuit before reaching static validators.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The endswith check matched partial type names: e.g.
'list:paired_or_unpaired'.endswith('paired') was True because
'paired' is a suffix of 'paired_or_unpaired'. This incorrectly
reported list:paired_or_unpaired as having subcollections of type
paired (violates PAIRED_OR_UNPAIRED_NOT_CONSUMED_BY_PAIRED_WHEN_MAPPING
in collection_semantics.yml). Fix by requiring ':' prefix in the
endswith check — the exact-match case is already handled by the
equality check above.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
has_subcollections_of_type and effective_collection_type only handled
paired_or_unpaired as an exact match, missing compound suffix cases
like list:paired_or_unpaired. This affected both offline validation
and backend runtime (query.py:can_map_over). Now matches TS editor
logic for collection_semantics.yml examples like
MAPPING_LIST_LIST_OVER_LIST_PAIRED_OR_UNPAIRED.
Also fixes effective_collection_type for non-:paired collections over
paired_or_unpaired (e.g. list over paired_or_unpaired now correctly
returns full type instead of empty string).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add BatchDataDceInstance/Internal for src:"dce" in batch parameter
models (request + request_internal layers)
- Preserve element_identifier when adapt_dataset resolves DCE→HDA
- Standardize model_dump(by_alias=True) across runtime.py and convert.py
instead of manual class_→class rename
- Migrate test_combined_mapping_and_subcollection_mapping and
test_map_over_dce_on_non_multiple_data_param from test_tools.py to
test_tool_execute.py with output content assertions
- Add DCE entries to parameter_specification.yml for gx_data and
gx_data_collection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add map_over_type to batch data instances (request + internal layers),
restricted to src:"hdca" only via discriminated union — map_over_type
is how clients express subcollection mapping intent and is meaningless
on non-collection sources
- Add DCE (src:"dce") to job_internal layer where batch expansion
produces DatasetCollectionElement refs via meta.py
- Fix async __expand_collection_parameter_async to handle DCE for job
rerun scenarios
- Fix runtimeify in convert.py to dispatch on src for DCE refs
- Add parameter specification tests covering map_over_type (request),
DCE (job_internal), and invalid combos (map_over_type on hda rejected)
- Refactor 3 existing subcollection mapping API tests to use
tool_input_format fixture (covers legacy, nested, request formats)
- Add new test_simple_subcollection_mapping API test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The workflow engine failed to map flat list/sample_sheet collections over
paired_or_unpaired tool inputs. The API tool execution path worked because
it explicitly translates paired_or_unpaired to single_datasets and wraps
elements in PromoteCollectionElementToCollectionAdapter. The workflow path
was missing both steps.
Two fixes in workflow/modules.py:
- _find_collections_to_match: translate paired_or_unpaired subcollection
type to single_datasets for flat collections (mirrors basic.py:2675)
- ToolModule.execute callback: wrap flat DCEs in adapter when mapping
type is single_datasets
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The workflow engine failed to map flat list/sample_sheet collections over
paired_or_unpaired tool inputs. The API tool execution path worked because
it explicitly translates paired_or_unpaired to single_datasets and wraps
elements in PromoteCollectionElementToCollectionAdapter. The workflow path
was missing both steps.
Two fixes in workflow/modules.py:
- _find_collections_to_match: translate paired_or_unpaired subcollection
type to single_datasets for flat collections (mirrors basic.py:2675)
- ToolModule.execute callback: wrap flat DCEs in adapter when mapping
type is single_datasets
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Found by running:
```
make pyupgrade
ruff check --fix .
ruff check --preview --unsafe-fixes --select=F401 --fix .
make format
make update-client-api-schema
```
The bulk of the changes are replacements of typing deprecated aliases
such as `Dict` and `List` with the standard library classes. These
aliases became redundant in Python 3.9 when the corresponding
pre-existing classes were enhanced to support `[]`, see
https://docs.python.org/3/library/typing.html#deprecated-aliases
Also:
- Update the `pyupgrade` Makefile target to use `--py38-plus` for the
packages needed by Pulsar, including the new galaxy-tool-util-models
package.