Commit Graph
89048 Commits
Author SHA1 Message Date
mvdbeek 67eea395ab Replace BaseHTTPMiddleware with pure ASGI middleware for X-Frame-Options
The @app.middleware("http") decorator uses Starlette's BaseHTTPMiddleware
which buffers the entire response body through an anyio memory channel
between two tasks.

Replace with a pure ASGI middleware that injects the X-Frame-Options
header directly into the response start message, avoiding the buffering
entirely.
2026-03-25 12:02:00 +01:00
Marius van den Beek 25e1cb6b87 Merge pull request #22250 from mvdbeek/validate_replacement_params_string
[26.0] Validate replacement_params values are strings before storing
2026-03-25 11:52:52 +01:00
Marius van den Beek a07f74eee1 Merge pull request #22246 from davelopez/26.0_fix_file_source_removal
[26.0] Fix file source removal
2026-03-25 10:25:34 +01:00
davelopez b85f8a07af Improves remove error feedback
Shows a user-facing error instead of silently do nothing when instance removal fails.

Adds focused coverage for successful and failed removal flows across both supported instance types.
2026-03-24 20:27:33 +01:00
davelopez 835445d748 Fixes removing (hiding) user file sources / object stores
Allows metadata-only updates to skip variable validation when no new variable values are provided.

Prevents hide (remove) operations from failing for instances backed by templates with required variables, while preserving the previously stored values.

Adds regression coverage for both supported instance types to ensure hidden updates remain safe and predictable.
2026-03-24 20:27:31 +01:00
mvdbeekandClaude Opus 4.6 f4d574e2aa Validate replacement_params values are strings before storing
Non-string values (e.g. dicts) in replacement_params cause a
ProgrammingError when inserting into the TEXT column of
workflow_request_input_parameters.

Fixes #22247

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:23:20 +01:00
Dannon a817722bf7 Merge pull request #22240 from nsoranzo/release_26.0_eslint_fix
[26.0] Fix import order error from ESLint
2026-03-24 11:02:48 -04:00
Dannon 846dcb1324 Merge pull request #22167 from mvdbeek/fix_ambigous_column_job_cache
[26.0] Fix AmbiguousColumn error in job search for tools with long input names
2026-03-24 10:46:11 -04:00
Marius van den Beek 4a15410d9c Merge pull request #22198 from mvdbeek/cached-route-lookup
[26.0] Cache url path lookup
2026-03-24 15:45:56 +01:00
Marius van den Beek 55a4713ce9 Merge pull request #22193 from jmchilton/backport-paired-or-unpaired-fixes
[26.0] Back port collection fixes from #22170.
2026-03-24 15:45:25 +01:00
Marius van den Beek 453c375ae5 Merge pull request #22232 from mvdbeek/optimize-dataset-edit-api
[26.0] Optimize dataset get_edit API by deferring expensive role queries
2026-03-24 15:00:12 +01:00
Dannon bc8abf7f3e Merge pull request #22234 from guerler/fixes.002
[26.0] Fix TypeError in ExternalIdentities by always including provider_label in authnz response
2026-03-24 09:59:02 -04:00
Nicola Soranzo e03707408d Fix import order error from ESLint
Introduced when merging release_25.1 forward in commit
0881413e3e .
2026-03-24 11:39:29 +00:00
Nicola Soranzo 0881413e3e Merge branch 'release_25.1' into release_26.0 2026-03-24 11:09:36 +00:00
Nicola Soranzo f3e4b0f76e Merge pull request #22238 from mvdbeek/fix-history-purge-timestamp
[26.0] Fix batch history purge not updating user's update_time
2026-03-24 11:06:50 +00:00
guerler d8fdec5f97 Relax type of capitalizeFirstLetter utility 2026-03-24 12:22:29 +03:00
mvdbeek 24c0876b87 Fix batch history purge not updating user's update_time
The batch purge_history_datasets celery task uses raw SQL for bulk
operations, bypassing SQLAlchemy's onupdate=now trigger on User.update_time.
This caused archiving with purge to leave the user's update_time stale.

Also forwards preserve_owner_update_time through to the batch task so
admin-initiated purges of other users' histories still preserve the
owner's update_time.
2026-03-24 09:30:00 +01:00
Marius van den BeekandNicola Soranzo e7075c4d00 Add type hint
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2026-03-24 08:19:41 +01:00
Marius van den Beek c8962592e1 Merge pull request #22229 from mvdbeek/fix-data-table-reload-admin-interface
[25.1] Use ``/api/tool_data`` endpoints in DataTables.vue & DataManagerTable.vue
2026-03-24 08:12:45 +01:00
mvdbeek 20d173a725 Use app-level route name index instead of per-request cache
Replace the per-request route cache with a name -> [route] index
built once at startup in initialize_fast_app and stored on app.state.
This avoids Starlette's O(n) linear route scan on every url_path_for
call, giving O(1) lookups (~400x speedup).

This addresses the concern about multiple routes sharing the
same name: the index maps each name to the full list of candidate
routes. At lookup time we try each candidate until one matches the
provided path_params, preserving the same semantics as Starlette's
linear scan. For example, prepare_collection_download correctly
resolves to different URLs depending on whether history_id is in the
params or not. The index is also fixed-size (bounded by the number of
route names, not by request volume), so there is no unbounded cache
growth.
2026-03-23 19:03:05 +01:00
guerler cf8c453531 Always pass provider label 2026-03-23 19:35:07 +03:00
mvdbeek 056f2c0257 Optimize dataset get_edit API by deferring expensive role queries
Move get_legitimate_roles, get_private_role_user_emails_dict, and
can_manage_dataset calls into the conditional branch where they are
actually needed (only when user is logged in AND dataset has permission
actions set). This avoids expensive full-table role/email queries for
anonymous users, public datasets, and non-shareable datasets.

Also scope get_private_role_user_emails_dict to only fetch email
mappings for the specific role IDs returned by get_legitimate_roles,
rather than scanning all private roles in the system.
2026-03-23 17:32:40 +01:00
guerler 6c5ef6fc75 Add test for capitalization utility 2026-03-23 18:23:32 +03:00
guerler f7d03e2c5d Add empty string guard to capitalization utility 2026-03-23 18:22:59 +03:00
Aysam Guerler 081d923160 Merge pull request #22225 from guerler/fixes.001
[26.0] Fix missing focus helper
2026-03-23 18:13:29 +03:00
Marius van den Beek 9623f4c883 Merge pull request #22202 from mvdbeek/fix-async-sync-calls
[26.0] Fix event loop blocking in async API routes
2026-03-23 15:44:58 +01:00
Marius van den Beek f6bc3cd06d Merge pull request #22188 from guerler/fix_22186
[26.0] Throw ParameterValueError instead of generic error
2026-03-23 15:41:31 +01:00
mvdbeek 61e2b81830 Use /api/tool_data endpoints in DataTables.vue & DataManagerTable.vue
Switch from legacy controller axios calls to the typed GalaxyApi() fetcher
for both loading and reloading tool data tables. Remove the now-unused
tool_data_table_info, tool_data_table_info_1, and reload_tool_data_tables
methods from the data_manager controller.

Fixes https://github.com/galaxyproject/galaxy/issues/22227
2026-03-23 15:01:45 +01:00
guerler 32436b79cc Adjust test case 2026-03-23 15:46:22 +03:00
David López 689692cb9c Merge pull request #22223 from mvdbeek/fix-history-list-race
[26.0] Fix race condition in history list when rapidly changing search filters
2026-03-23 13:42:08 +01:00
guerler 88f9495529 Add unit test 2026-03-23 14:32:32 +03:00
Marius van den Beek f70dbd6d03 Merge pull request #22181 from jmchilton/another_stock_tool_fix
[26.0] Include missing tools in stock_tool_paths.
2026-03-23 12:32:12 +01:00
guerler 01436bc475 Fix missing focus helper 2026-03-23 14:27:50 +03:00
mvdbeekandClaude Opus 4.6 72167524de Fix race condition in history list when rapidly changing search filters
When a search reset and a new search triggered concurrent load() calls,
a stale response from the reset could overwrite the correct search
results. Use a generation counter to discard responses from superseded
loads.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:09:49 +01:00
Marius van den Beek 78fb3a03a0 Merge pull request #22221 from nsoranzo/release_26.0_drop_redis_from_pinned_requirements
[26.0] Update fastmcp requirement to 3.0.2
2026-03-23 08:44:28 +01:00
Nicola Soranzo 63954cb42e Drop use of deprecated `method parameter of starlette FileResponse`
Removed in starlette 1.0, see https://github.com/Kludex/starlette/pull/3147

Fix the following mypy errors in package tests:

```
galaxy/webapps/base/api.py:94: error: Too many arguments for "__init__" of
"FileResponse"  [call-arg]
            super().__init__(
            ^~~~~~~~~~~~~~~~~
galaxy/webapps/base/api.py:95: error: Argument 8 to "__init__" of
"FileResponse" has incompatible type "str | None"; expected "str"  [arg-type]
    ..., media_type, background, filename, stat_result, method, content_dispo...
                                                        ^~~~~~
```
2026-03-23 01:41:25 +00:00
Nicola Soranzo 2d27004b23 Update fastmcp requirement to 3.0.2
and update its dependencies. This is needed to drop the requirement
on redis 7.1.0, which conflicts with our conditional requirement
`redis>=5.3.0,<6` , which is needed for compatibility with celery 5.6.2 .

Fix https://github.com/galaxyproject/galaxy/issues/22201 .
2026-03-23 00:32:59 +00:00
Nicola Soranzo c1d0065fb7 Sync gxformat2 in packages with pin in pyproject.toml 2026-03-23 00:31:40 +00:00
mvdbeek 261634b9e1 Use (name, params) as cache key for url_path_for route lookup
Multiple routes can share a name but expect different parameter sets.
Using just the name as cache key could return the wrong route when
path_params differ. Key on (name, frozenset(path_params)) instead.
2026-03-20 18:42:01 +01:00
mvdbeek 5c9a98cb62 Fix event loop blocking in async API routes
Async def route handlers were calling synchronous DB queries, DNS
lookups, and HTTP APIs directly on the event loop, blocking all
concurrent requests on the same worker.

- chat.py: use await agent.run() instead of agent.run_sync(), use
  AsyncOpenAI instead of sync openai client, wrap all chat_manager
  and job_manager DB calls with anyio.to_thread.run_sync
- agents.py: wrap chat_manager/job_manager DB calls in analyze_error
  and create_custom_tool with anyio.to_thread.run_sync
- proxy.py: wrap _validate_url_and_access (blocking socket.getaddrinfo)
  with anyio.to_thread.run_sync
- error_analysis.py: wrap job_manager.get_accessible_job with
  anyio.to_thread.run_sync
2026-03-20 17:32:04 +01:00
Marius van den Beek 31c718f06c Merge pull request #22180 from mvdbeek/batch-dataset-purge-task
[26.0] Add batch celery task for history dataset purging
2026-03-20 16:22:55 +01:00
mvdbeek f1dfa2c67a Cache url path lookup
I've seen py-spy dumps where usegalaxy.org was busy looking up routes.
This is an easy win. Claude claims 87X speedup in a synthetic benchmark:
https://gist.github.com/mvdbeek/a257c8885edba9e02482b598076eaa0e
2026-03-20 15:22:15 +01:00
Nicola Soranzo 808849d005 Merge pull request #22183 from mvdbeek/dont_fail_when_extra_file_dir_deleted
[26.0] Don't fail on probable delete race
2026-03-20 11:36:25 +00:00
Aysam GuerlerandMarius van den Beek c6d5738df4 Update lib/galaxy/tools/parameters/basic.py
Co-authored-by: Marius van den Beek <m.vandenbeek@gmail.com>
2026-03-19 19:34:24 +03:00
John Chilton 2305985039 Back port collection fixes from #22170. 2026-03-19 12:30:39 -04:00
guerler 9918785de5 Add unit test 2026-03-19 17:51:05 +03:00
guerler a3d32abe5e Throw ParameterValueError instead of generic error 2026-03-19 17:45:29 +03:00
Marius van den Beek a35fabeba0 Merge pull request #22179 from jmchilton/backport_comments
[26.0] gxformat2 fixes
2026-03-19 15:22:06 +01:00
mvdbeek f79692760e Return async task result 2026-03-19 14:58:37 +01:00
mvdbeek 63b63e7d6f Don't fail on probable delete race
Fixes https://github.com/galaxyproject/galaxy/issues/22182
2026-03-19 14:51:32 +01:00