Commit Graph

89135 Commits

Author SHA1 Message Date
mvdbeek 8b4e488319 Fix HDCA shown as unavailable on tool form rerun
After 6a9323a79 (Fix HDCA lost in tool form on rerun), visible HDCAs
in the current history were incorrectly added to the job_input_values
fallback section with a "(not in current history)" label. This happened
because active_visible_datasets_and_roles only iterates HDAs, so HDCAs
were never removed from job_input_values during matching. The HDCA then
appeared twice in the form: once correctly from the dataset collections
section, and once as a "keep" option with wrong state.

Skip HDCAs in the fallback loop when they are active, visible, and in
the current history — they are already properly handled by the
active_visible_dataset_collections loop below.

Fixes `lib/galaxy_test/selenium/test_tool_form.py::TestToolForm::test_rerun_dataset_collection_element - selenium.common.exceptions.TimeoutException: Message: Timeout waiting on CSS selector [.dataset-collection-panel] to become present.`
2026-03-29 13:23:46 +02:00
mvdbeek ee12b2a096 Raise MessageException instead of generic Exception in rules_dsl
Fixes #22100. When a regular expression fails to match in apply_regex(),
the generic Exception was not caught by the API layer, resulting in an
unhandled server error. Using MessageException ensures the error message
is properly surfaced to users.
2026-03-29 12:56:08 +02:00
mvdbeek 9d034431f9 URL-encode tool ID in shed_tool_static image paths
Tool IDs with special characters (e.g., "EMBOSS: isochore47") were
embedded into URL paths without percent-encoding. The space would be
lost in transit through RST→HTML→browser, causing the server to
reconstruct a GUID that didn't match any tool.

Apply urllib.parse.quote(safe="/") to the entire route_to_images path
so special characters are properly percent-encoded. The WSGI layer
auto-decodes PATH_INFO before routing, so the controller receives
the correct values.

Fixes https://github.com/galaxyproject/galaxy/issues/22126
2026-03-29 12:56:08 +02:00
mvdbeek 3c3cc8ae20 Fix AttributeError when invalid tool ID passed to shed_tool_static
Return a 404 instead of crashing with an unhandled AttributeError when
toolbox.get_tool() returns None for an invalid/unknown tool GUID.

Fixes https://github.com/galaxyproject/galaxy/issues/22126
2026-03-29 12:56:08 +02:00
mvdbeek 3a9eb28d85 Add regression test for passing list DCE into dynamic options 2026-03-29 12:56:08 +02:00
mvdbeek ebd5ea2913 Fix nested DatasetCollectionElement in dynamic options
When a DatasetCollectionElement containing an LDDA or nested child
collection (rather than an HDA) was used as a reference for dynamic
option filtering, _get_ref_data() failed to normalize it into a list,
causing "TypeError: 'DatasetCollectionElement' object is not iterable".

Use DatasetCollectionElement.dataset_instances which correctly returns
a list of dataset instances for all element types (HDA, LDDA, or
nested collections).

Fixes galaxyproject#22099
2026-03-29 12:56:08 +02:00
mvdbeek b24071b399 Fix string formatting for logging library 2026-03-29 12:53:14 +02:00
mvdbeek e4197e2467 Offload AsyncClient construction to worker thread
https://github.com/encode/httpx/discussions/3707
2026-03-29 12:53:14 +02:00
mvdbeek db721c0c11 Fix mapped dynamic collection outputs missing with extended metadata
Commit 4172b9b5 ("Fix AttributeError serializing implicit output
collections during job prep") excluded all output_dataset_collections
from io_dicts when exclude_implicit_outputs=True. This broke mapped
dynamic collection outputs because their per-job DCs were no longer
serialized to outputs_new, so set_metadata.py could not discover and
populate them.

Selectively include output_dataset_collections where the name is not
in out_data — this excludes shared DCs for mapped dataset outputs
(which have N precreated elements with uninitialized sentinels) while
including per-job DCs for mapped collection outputs.

Add integration tests verifying no duplicate collection elements in
both non-mapped and mapped dynamic collection outputs with extended
metadata.
2026-03-29 12:53:14 +02:00
Nate Coraor d6a1797cdc Allow admin to override $GALAXY_MEMORY_MB 2026-03-29 12:53:14 +02:00
Dannon Baker c0cf972f89 TEMP, FOR TEST, Add frequencymap 2026-03-29 12:53:14 +02:00
mvdbeek 5e3abb9247 Require containerization for user defined and interative tools 2026-03-29 12:53:14 +02:00
mvdbeek 881a77b7b3 Don't fail job on failing to read secret 2026-03-29 12:53:13 +02:00
mvdbeek 6f810171cb Log expression evaluation error 2026-03-29 12:53:13 +02:00
mvdbeek 737a2d972d Disable recursive requests for now 2026-03-29 12:53:13 +02:00
Nate Coraor 68f0426bdf Log JobMappingExceptions at error level rather than debug 2026-03-29 12:53:13 +02:00
mvdbeek cfdbc06bd6 Debug VGP handler issue 2026-03-29 12:53:13 +02:00
mvdbeek d73030bf85 Temporary, ignore S3 object store failed init 2026-03-29 12:53:13 +02:00
mvdbeek 3ca472c33a Merge branch 'release_25.1' into release_26.0 2026-03-29 12:49:11 +02:00
Marius van den Beek 94fddfa29f Merge pull request #22275 from mvdbeek/fix_transaction_begun_when_purging_anon_history
[26.0] Fix purge for anon histories
2026-03-29 12:26:03 +02:00
Marius van den Beek 6f7b361bd0 Merge pull request #22284 from mvdbeek/fail_early_no_route_match
[26.0] Fail early wehn no route match is found
2026-03-29 12:25:13 +02:00
Marius van den Beek 1ea3db20d6 Merge pull request #22290 from mvdbeek/fix_job_search_hdca_25.1
[25.1] Fix flaky job search for HDCA inputs on PostgreSQL
2026-03-29 12:24:17 +02:00
mvdbeek 4c74687991 Fix flaky job search for HDCA inputs on PostgreSQL
The job search HDCA signature comparison was non-deterministic because
`func.array_agg(column, order_by=column)` silently drops the `order_by`
keyword argument in SQLAlchemy, generating `array_agg(col)` instead of
`array_agg(col ORDER BY col)`.

This meant both the reference and candidate HDCA signatures were
aggregated in whatever scan order PostgreSQL happened to use. When the
query planner chose different scan orders for the reference and
candidate CTEs (which depends on table statistics and query plan), the
resulting arrays had different element orderings, causing the equality
comparison to fail — even for the exact same HDCA.

The fix uses `aggregate_order_by` from SQLAlchemy's PostgreSQL dialect,
which correctly generates `array_agg(col ORDER BY col ASC)`.

Diagnostic output from CI confirming the root cause:

  reference full signature=['data0;251', 'data1;252', 'data2;253']
  candidate full signatures=[(75, ['data2;253', 'data1;252', 'data0;251'])]
  equivalent HDCA ids=[]

Same HDCA (id=75), same elements, different array ordering → no match.

Investigation details: https://gist.github.com/mvdbeek/a3bd1528be0985e4a7d36e929a502bd2

Fixes #21230
2026-03-28 18:06:57 +01:00
mvdbeek 8f52487a2c Merge branch 'release_25.1' into release_26.0 2026-03-28 11:11:39 +01:00
Marius van den Beek 3794c0f30f Merge pull request #22276 from bernt-matthias/fasta-set-meta-1byte
[25.1] Sequence datatypes: only read first character per line for setting metadata
2026-03-28 10:53:20 +01:00
mvdbeek 9d05f52b2b Fail early if no route matches, fail gracefully on non-utf8 query strings
Fixes https://github.com/galaxyproject/galaxy/issues/22283
map_match must be a dict with a given structure, see
```
    def _resolve_map_match(self, map_match, path_info, controllers, use_default=True):
        # Get the controller class
        controller_name = map_match.pop("controller", None)
        controller = controllers.get(controller_name, None)
        if controller is None:
            raise webob.exc.HTTPNotFound(f"No controller for {path_info}")
```
just below. So let's fail early if the dict is empty.
Also fail gracefully on non-unicode query params.
2026-03-28 09:51:44 +01:00
Marius van den Beek 8e6f07b188 Merge pull request #22277 from mvdbeek/raise-exception-invalid-param
[26.0] Raise error when API client sends invalid parameter keys
2026-03-28 09:23:41 +01:00
Marius van den Beek 5fbf8bbe08 Merge pull request #22279 from bgruening/refresh-utime-in-cache
[25.1] refresh utime in object store caches
2026-03-28 09:22:29 +01:00
mvdbeek 79d98b185d Make exception more generic 2026-03-27 18:13:48 +01:00
Björn Grüning 47db01adb1 Apply suggestions from code review
Co-authored-by: Marius van den Beek <m.vandenbeek@gmail.com>
2026-03-27 16:40:05 +01:00
Björn Grüning 54d3d0985d fix suggestion 2026-03-27 16:16:15 +01:00
Björn Grüning 3fe84bda83 Apply suggestion from @bgruening 2026-03-27 16:15:30 +01:00
Björn Grüning 9d2380f206 Apply suggestions from code review
Co-authored-by: Marius van den Beek <m.vandenbeek@gmail.com>
Co-authored-by: Björn Grüning <bjoern@gruenings.eu>
2026-03-27 16:15:18 +01:00
Matthias Bernt af445e6b56 apply same to more types 2026-03-27 16:08:25 +01:00
Matthias Bernt e464f50823 FASTA: only read first character per line for setting metadata
otherwise the whole line is kept in memory which
might be the complete sequence in edge cases
2026-03-27 16:08:24 +01:00
Marius van den Beek 9173f42024 Merge pull request #22267 from jmchilton/pairing_fix_26_0
[26.0] Add _F/_R auto-pairing filter for forward/reverse datasets
2026-03-27 16:03:50 +01:00
Bjoern Gruening 2ee6edba5a rucio seems to have a different code path 2026-03-27 14:17:36 +01:00
Bjoern Gruening bda5b7b76d refresh timestamp for newly created cache files 2026-03-27 14:17:36 +01:00
mvdbeek ec0df9de88 Raise error when API client sends invalid parameter keys
The Sentry crash (issue galaxyproject#22132) was triggered by a Python Requests 2.32
client sending an invalid payload.

In this case the input was
```json
{
  "in": "custom",

  "in|custom|mtx": {
    "id": "f9cad7b01a472135e9dd0bb539e2d0de",
    "src": "hda"
  },

  "in|custom|obs": {
    "id": "f9cad7b01a472135068f117b3249ac19",
    "src": "hda"
  },

  "in|custom|var": {
    "id": "f9cad7b01a472135e497326e87a7fa84",
    "src": "hda"
  }
}
```
where `in` is a conditional and `adata_format` is the tester select that
you can in fact set to `custom`.

Replace the opaque AttributeError with a RequestParameterInvalidException
that tells the caller exactly what went wrong and how to fix their
parameter naming.

Fixes https://github.com/galaxyproject/galaxy/issues/22132
2026-03-27 12:13:24 +01:00
Marius van den Beek 0cc0b06263 Merge pull request #22256 from mvdbeek/fix-n-plus-one-history-contents
[26.0] Batch-prefetch HDCA job_state_summary in history contents listing
2026-03-27 11:47:03 +01:00
mvdbeek 7d3a7e2d13 Add purge_history abstraction and wait for purge to complete if async 2026-03-27 11:36:28 +01:00
mvdbeek ec9204779c Fix history purge for anon users 2026-03-27 11:23:15 +01:00
mvdbeek 5c8f5ea752 Add anon purge test 2026-03-27 11:21:16 +01:00
Nicola Soranzo a10e8efede Merge branch 'release_25.1' into release_26.0 2026-03-27 09:51:32 +00:00
Marius van den Beek 6a9323a79a Merge pull request #22258 from mvdbeek/rerun_hdca_fix
[26.0] Fix HDCA lost in tool form on rerun
2026-03-26 17:46:36 +01:00
John Chilton 00ee594b3a Add _F/_R auto-pairing filter for forward/reverse datasets
Datasets using the _F/_R naming convention (e.g. ERR042228_F.fq.gz /
ERR042228_R.fq.gz) were not being auto-paired. Add "Fs" filter to
COMMON_FILTERS in both frontend and backend, with detection ordered
after _R1/_R2 to avoid substring false matches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 10:49:52 -04:00
John Davis aedb238c01 Merge pull request #22265 from jdavcs/26.0_backport_21939
[26.0] Backport of 21939
2026-03-26 09:58:04 -04:00
mvdbeek ae12eaed05 Use real HDA instances in tests that hit isinstance check
Tests for hidden/deleted HDA display in the rerun form now use real
model.HistoryDatasetAssociation instances via _new_hda(), since these
go through the isinstance check in the job_input_values loop.

The MockHistoryDatasetAssociation (which stubs find_conversion_destination)
is retained only for conversion tests that go through the dataset matcher
path and never reach the isinstance branch.
2026-03-26 14:57:11 +01:00
nekrut ae93a58d9a Add subcategory labels to Collection Operations tool section
Organize the flat list of ~30 collection tools into 6 labeled
subcategories (Build, Restructure, Filter, Pair and Combine,
Sort and Label, Extract) to help users find tools faster.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 09:50:06 -04:00
nekrut ce2d59d604 Expand help text and add SVGs for apply rules, flat cross product, and nested cross product tools
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 09:50:01 -04:00