46 Commits
Author SHA1 Message Date
mvdbeek eef3cc4f25 Merge branch 'release_26.2' into dev 2026-11-27 06:39:22 +01:00
mvdbeek e45af6e254 Merge branch 'release_26.1' into release_26.2 2026-11-27 06:23:10 +01:00
mvdbeek e3c8844874 Merge branch 'release_26.0' into release_26.1 2026-11-27 06:07:52 +01:00
mvdbeekandClaude Opus 5.5 e16e70e816 Expose input extra files path to user-defined tools
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>
2026-11-09 13:57:24 +01:00
John ChiltonandClaude Opus 5.5 8a5f2823b2 Baseline tests for compound paired_or_unpaired and sample_sheet map-over
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>
2026-11-02 19:17:49 -05:00
John ChiltonandClaude Opus 5.5 e4432b439d Test job handler accepts legacy galaxy.json bam_index temp files
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>
2026-11-02 08:01:15 +01:00
John ChiltonandClaude Opus 5.5 7850395774 Baseline tests for option paging
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>
2026-10-22 12:26:26 -04:00
Marius van den Beek 8381e42c56 Merge pull request #23058 from SID-6921/fix-tool-input-matched-validation-22884
Validate matched multi-input expansion errors before async job prep
2026-10-13 16:56:01 +02:00
John Chilton e107d2c438 Test mismatched linked batch lengths fail with 400 across input formats 2026-10-08 12:18:10 -04:00
John ChiltonandClaude Opus 5.5 91503ba53d Test empty select values across input formats and profiles
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>
2026-10-08 08:21:33 -04:00
John ChiltonandClaude Opus 5.5 c60bd636ff Update test_tool_execute identifier expectations for safe_identifier output
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 11:27:22 +02:00
Nicola SoranzoandClaude Sonnet 5 b41f05a995 Add test that job cache is not used for composite datasets with different extra files
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>
2026-09-07 11:52:55 +01:00
John ChiltonandClaude Opus 5 dc22d11a21 Derive optional the same way in the model and at runtime
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
2026-08-25 14:20:52 -04:00
Marius van den Beek 1d7d5d707a Merge pull request #23132 from jmchilton/gxformat2_stateless_artifacts
Add API tests for format2-to-native conversion artifacts
2026-07-17 14:31:25 +02:00
John ChiltonandClaude Opus 4.6 af38460325 Add API tests for format2-to-native conversion artifacts
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>
2026-07-15 13:33:56 -04:00
mvdbeek 073cace495 Add async implicit datatype conversion API tests
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.
2026-06-16 08:05:20 +02:00
mvdbeek e672113e98 Merge branch 'release_26.0' into dev 2026-05-22 21:30:24 +02:00
mvdbeek 50fd6d3a10 Rename test tool to describe shape, not test scenario
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.
2026-05-19 19:50:56 +02:00
mvdbeek c805a73803 Raise ToolInputsNotReady for unpopulated structured_like target
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.
2026-04-30 13:01:31 +02:00
Nicola Soranzo c40e09084e Merge branch 'release_26.0' into dev 2026-04-22 03:54:23 +01:00
mvdbeek 827bb957d4 Merge branch 'release_26.0' into dev 2026-04-02 19:10:27 +02:00
John ChiltonandClaude Opus 4.6 a557064111 Fix optional text default_value handling across input formats
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>
2026-03-27 13:32:38 -04:00
John ChiltonandClaude Opus 4.6 ecb803ddae Skip pydantic validators for optional text params with None/empty values
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>
2026-03-27 13:32:37 -04:00
guerler 9f6de61c95 Fix linting 2026-03-24 12:29:04 +03:00
guerler f8fbf51083 Add dce test 2026-03-24 12:29:04 +03:00
John ChiltonandClaude Opus 4.6 959b6076d6 Fix has_subcollections_of_type endswith to require colon boundary.
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>
2026-03-18 09:57:48 -04:00
John ChiltonandClaude Opus 4.6 7d918fe9e0 Fix compound :paired_or_unpaired handling in has_subcollections_of_type.
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>
2026-03-17 16:38:18 -04:00
John ChiltonandClaude Opus 4.6 bab77ba32d Model DCE in batch params, fix runtime adapt_dataset, migrate tests
- 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>
2026-03-09 10:53:50 -04:00
John ChiltonandClaude Opus 4.6 77056952bd Model map_over_type and DCE in tool parameter schema
- 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>
2026-03-09 10:53:50 -04:00
John ChiltonandClaude Opus 4.6 8f9a57d0e5 Fix workflow implicit mapping of flat collections over paired_or_unpaired
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>
2026-02-26 09:54:15 +01:00
John ChiltonandClaude Opus 4.6 0bc5cba6bb Fix workflow implicit mapping of flat collections over paired_or_unpaired
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>
2026-02-25 09:55:04 -05:00
John Chilton 1bb986cdb1 Add a function tests for multiple selects from user tools. 2026-02-12 15:58:16 -05:00
Nicola Soranzo 8163accbb1 Add `use_cached_job parameter to RequiredTool.execute()` 2026-01-27 16:07:50 +00:00
John Chilton 374cfe7a30 Fix tool request API for multiple select parameters with defaults. 2025-12-10 09:44:08 -05:00
John Chilton 2e4a50a38c Tool Request API... 2025-10-29 16:33:22 -04:00
John Chilton 11dfa6d335 Spelling fix. 2025-10-29 16:31:57 -04:00
John Chilton 28e6e2c6f8 Fix default conditional test parameters...
... for tools using 21.01 input format.
2025-09-22 17:04:38 -04:00
Nicola Soranzo 1d9d93ea50 Merge branch 'release_25.0' into dev 2025-08-07 15:54:38 +01:00
Nicola Soranzo 7f89e0eab9 Code cleanups from pyupgrade
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.
2025-07-31 11:17:22 +01:00
John Chilton da575fe2d0 Fix deferred datasets in multi-data parameters. 2025-07-11 13:44:27 -04:00
John Chilton 505ac8d8d5 Migrate some tool-on-deferred tests to newer style execute tests. 2025-07-11 13:44:26 -04:00
John Chilton 219796f049 Implement paired_or_unpaired collections, list wizards. 2025-05-09 17:39:38 -04:00
John Chilton 6d7842e66f Numerous fixes for tool input format "21.01" parameters. 2024-10-30 10:52:08 -04:00
John Chilton 951ab47f47 More tool tests. 2024-10-22 07:49:37 -04:00
John Chilton d07081d869 tool input format test fixutre 2024-10-22 07:49:37 -04:00
John Chilton 687f3661f1 Migrate various tool execute tests to more declarative style. 2024-10-14 09:40:22 -04:00