Commit Graph
75756 Commits
Author SHA1 Message Date
Martin Cech ffc66f2c28 Merge pull request #17585 from bernt-matthias/admin-doc-data-tables
Add some admin facing docs on data tables
2024-04-18 18:55:55 +02:00
Martin Cech abad770d5a change text in a minor way 2024-04-18 18:55:38 +02:00
mvdbeek 722112653e Merge branch 'release_24.0' into dev 2024-04-18 17:13:04 +02:00
Marius van den Beek 7cf12f193d Merge pull request #18020 from mvdbeek/fix_framework_tests
Make celery fixture available in framework tests
2024-04-18 16:56:00 +02:00
mvdbeek 79be849f4f Make celery fixture available in framework tests 2024-04-18 15:33:29 +02:00
Marius van den Beek 5addd00933 Merge pull request #18014 from mvdbeek/debug_and_fix_hidless_hdas
[24.0] Don't commit without having set a hid
2024-04-18 09:03:45 +02:00
Martin Cech 066dbba75d Merge pull request #18011 from mvdbeek/avoid_apply_rules_exception_when_no_collection_in_history
[24.0] Avoid exception when opening apply rules tool and no collection in history
2024-04-17 19:32:48 +02:00
John Chilton 235f84f601 Merge pull request #17992 from guerler/add_tags_dataselector
Add tags to data dialog display, restores update_time and extension columns
2024-04-17 13:28:11 -04:00
mvdbeek 37bc454067 Don't commit without having seta hid
hid-less items in a history are bad, and this is potentially one way to
produce them.

We've got a bunch of them in the history and this has been showing up in
as https://sentry.galaxyproject.org/share/issue/3cc69eedc9f841b6ae8ac02e3f88e8fe/:

```
ValidationError: 210 validation errors for HistoryContentsWithStatsResult
contents.0.HDACustom.type
  Input should be 'file' [type=literal_error, input_value='collection', input_type=str]
    For further information visit https://errors.pydantic.dev/2.5/v/literal_error
contents.0.HDACustom.history_content_type
  Input should be 'dataset' [type=literal_error, input_value='dataset_collection', input_type=str]
    For further information visit https://errors.pydantic.dev/2.5/v/literal_error
contents.0.HDADetailed.hid
  Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.5/v/int_type
contents.0.HDADetailed.type
  Input should be 'file' [type=literal_error, input_value='collection', input_type=str]
    For further information visit https://errors.pydantic.dev/2.5/v/literal_error
contents.0.HDADetailed.history_content_type
  Input should be 'dataset' [type=literal_error, input_value='dataset_collection', input_type=str]
    For fur...
  File "starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "starlette_context/middleware/raw_middleware.py", line 92, in __call__
    await self.app(scope, receive, send_wrapper)
  File "starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
  File "galaxy/webapps/galaxy/fast_app.py", line 108, in add_x_frame_options
    response = await call_next(request)
  File "starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "starlette/routing.py", line 758, in __call__
    await self.middleware_stack(scope, receive, send)
  File "starlette/routing.py", line 778, in app
    await route.handle(scope, receive, send)
  File "starlette/routing.py", line 299, in handle
    await self.app(scope, receive, send)
  File "starlette/routing.py", line 79, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "starlette/routing.py", line 74, in app
    response = await func(request)
  File "fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
  File "fastapi/routing.py", line 193, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "starlette/concurrency.py", line 42, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
    return await future
  File "anyio/_backends/_asyncio.py", line 851, in run
    result = context.run(func, *args)
  File "galaxy/webapps/galaxy/api/history_contents.py", line 465, in index
    items = self.service.index(
  File "galaxy/webapps/galaxy/services/history_contents.py", line 312, in index
    return self.__index_v2(trans, history_id, params, serialization_params, filter_query_params, accept)
  File "galaxy/webapps/galaxy/services/history_contents.py", line 1006, in __index_v2
    return HistoryContentsWithStatsResult(contents=items, stats={"total_matches": total_matches})
```

I'm hesitatant to relax the validation here, these are really pretty bad
bugs. We do appear to have test coverage here via https://app.codecov.io/gh/galaxyproject/galaxy/commit/4a4ead2b5ee913b61a97b84b60e77f28415d5ad9/blob/lib/galaxy/tools/actions/upload_common.py#L144
2024-04-17 19:18:24 +02:00
John Davis f1b934b6a1 Merge pull request #18010 from davelopez/24.0_tweak_polling_intervals
[24.0] Reduce notifications polling frequency
2024-04-17 11:56:28 -04:00
mvdbeek 5ce4986752 Avoid exception when opening apply rules tool and no collection in history
Fixes https://sentry.galaxyproject.org/share/issue/97b5b9cfcef14ca0b59b851684170698/
```
AttributeError: 'NoneType' object has no attribute 'id'
  File "galaxy/tools/__init__.py", line 2601, in populate_model
    tool_dict = input.to_dict(request_context, other_values=other_values)
  File "galaxy/tools/parameters/basic.py", line 2648, in to_dict
    "id": trans.app.security.encode_id(target.id),
```

Which is in a try/except anyway, so fairly inconsequential, but results
in cleaner logs / one less sentry error.
2024-04-17 16:40:00 +02:00
mvdbeek 67436a6156 Merge branch 'release_24.0' into dev 2024-04-17 16:22:04 +02:00
mvdbeek 33538bea49 Merge branch 'release_23.2' into release_24.0 2024-04-17 16:20:05 +02:00
davelopez af2c2ed314 Set active check for notifications every 30 seconds 2024-04-17 16:19:13 +02:00
Marius van den Beek 74bee105a7 Merge pull request #18008 from mvdbeek/include_exception_info_authnz_refresh
[24.0] Include exception info when something goes wrong while refreshing tokens
2024-04-17 16:16:14 +02:00
Marius van den Beek a51aa51f2c Merge pull request #18009 from mvdbeek/return_message_exception_when_invocation_report_references_invalid_output
[24.0] Raise ``MessageException`` when report references invalid workflow output
2024-04-17 16:15:56 +02:00
Marius van den Beek 1c899abd60 Merge pull request #18002 from mvdbeek/fix_invalid_param_reporting
[24.0] Don't fail if reporting invalid parameter values
2024-04-17 16:15:31 +02:00
davelopez 91f34ac76c Reduce notifications polling frequency 2024-04-17 16:01:41 +02:00
mvdbeek aeab88be4d Raise MessageException when report references invalid workflow output
Marginally better than an uncaught exception IMO.
Fixes
https://sentry.galaxyproject.org/share/issue/45391593603042799ef5ac5b18d22440/:

```
Exception: Failed to find workflow output named [Fasta Statistics on input dataset(s): Fasta summary stats], workflow doesn't define output by that name - valid names are ['Flye assembly on input dataset(s) (consensus)', 'Flye assembly on input dataset(s) (assembly_graph)', 'Flye assembly on input dataset(s) (Graphical Fragment Assembly)', 'Flye assembly on input dataset(s) (assembly_info)', 'Flye assembly on input dataset(s) (log)', None, 'Bandage Image on input dataset(s): Assembly Graph Image', 'Quast on input dataset(s):  PDF report', 'Quast on input dataset(s):  HTML report', 'Quast on input dataset(s): tabular report', 'Quast on input dataset(s): Log', 'Bar chart showing contig sizes'].
  File "starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "starlette_context/middleware/raw_middleware.py", line 92, in __call__
    await self.app(scope, receive, send_wrapper)
  File "starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
  File "galaxy/webapps/galaxy/fast_app.py", line 108, in add_x_frame_options
    response = await call_next(request)
  File "starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "starlette/routing.py", line 758, in __call__
    await self.middleware_stack(scope, receive, send)
  File "starlette/routing.py", line 778, in app
    await route.handle(scope, receive, send)
  File "starlette/routing.py", line 299, in handle
    await self.app(scope, receive, send)
  File "starlette/routing.py", line 79, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "starlette/routing.py", line 74, in app
    response = await func(request)
  File "fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
  File "fastapi/routing.py", line 193, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "starlette/concurrency.py", line 42, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
    return await future
  File "anyio/_backends/_asyncio.py", line 851, in run
    result = context.run(func, *args)
  File "galaxy/webapps/galaxy/api/workflows.py", line 1485, in show_invocation_report
    return self.invocations_service.show_invocation_report(trans, invocation_id)
  File "galaxy/webapps/galaxy/services/invocations.py", line 143, in show_invocation_report
    wfi_report = self._workflows_manager.get_invocation_report(trans, invocation_id, format=format)
  File "galaxy/managers/workflows.py", line 428, in get_invocation_report
    return generate_report(
  File "galaxy/workflow/reports/__init__.py", line 14, in generate_report
    return plugin.generate_report_json(trans, invocation, runtime_report_config_json=runtime_report_config_json)
  File "galaxy/workflow/reports/generators/__init__.py", line 43, in generate_report_json
    internal_markdown = self._generate_internal_markdown(
  File "galaxy/workflow/reports/generators/__init__.py", line 73, in _generate_internal_markdown
    internal_markdown = resolve_invocation_markdown(trans, invocation, workflow_markdown)
  File "galaxy/managers/markdown_util.py", line 958, in resolve_invocation_markdown
    galaxy_markdown = _remap_galaxy_markdown_calls(_remap, workflow_markdown)
  File "galaxy/managers/markdown_util.py", line 1012, in _remap_galaxy_markdown_calls
    return _remap_galaxy_markdown_containers(_remap_container, markdown)
  File "galaxy/managers/markdown_util.py", line 971, in _remap_galaxy_markdown_containers
    (replacement, whole_block) = func(replace)
  File "galaxy/managers/markdown_util.py", line 1008, in _remap_container
    return func(match.group(1), f"{matching_line}\n")
  File "galaxy/managers/markdown_util.py", line 926, in _remap
    ref_object = invocation.get_output_object(name)
  File "galaxy/model/__init__.py", line 8593, in get_output_object
    raise Exception(
```
2024-04-17 15:06:35 +02:00
mvdbeek 6da24f2f2f Include exception info when something goes wrong while refreshing tokens
```
An error occurred when refreshing user token: (invalid_request) Missing Code
```

is the message we're currently logging, that's not enough to do anything
with.
2024-04-17 14:58:32 +02:00
Marius van den Beek 88dcb255b0 Merge pull request #17990 from ahmedhamidawan/use_select_many_in_tool_form
[24.0] Use the new column-select component in `FormData` for multiple select
2024-04-17 12:10:20 +02:00
Marius van den Beek bc248efe2a Merge pull request #17982 from galaxybot/dev_auto_update_dependencies
Update Python dependencies
2024-04-17 10:34:30 +02:00
David López 853a645a1a Merge pull request #18005 from dannon/fix-localization-spacing
[24.0] Preserve surrounding whitespace when localizing complex nodes
2024-04-17 10:27:44 +02:00
David López 8e900c55b4 Merge pull request #17225 from jmchilton/page_permissions
Implement a page object accessibility dialog
2024-04-17 10:27:11 +02:00
Dannon Baker 3e89eeb459 Preserve surrounding whitespace when localizing complex nodes 2024-04-16 16:24:22 -04:00
John Davis 6f3e515215 Merge pull request #18000 from dannon/update-prebuilt-client
[24.0] Update prebuilt client
2024-04-16 14:17:56 -04:00
John Davis b60bbbd24a Merge pull request #17914 from davelopez/add_email_notifications_channel
Add `email` notifications channel
2024-04-16 14:12:05 -04:00
Nicola Soranzo edf06c5e35 Rebuild client API schema for pydantic 2.7.0 2024-04-16 17:16:53 +01:00
galaxybot 2f741fa673 Update Python dependencies 2024-04-16 17:16:53 +01:00
Nicola Soranzo 1fef07cb24 Replace pytest-celery with `celery.contrib.pytest` plugin loading
The new 1.0.0 version of pytest-celery will move towards a Docker-based
approach for smoke and production-like testing, bringing in a number of
dependencies that we don't currently need.
Since the pre-1.0.0 version of pytest-celery was just a shim for
``celery.contrib.pytest``, we can simply load the latter for API,
integration and Selenium tests.
2024-04-16 17:16:52 +01:00
Ahmed Awan f6e19c39f2 remove double ternary op 2024-04-16 11:16:38 -05:00
John Chilton b064ff29a2 Rebuild API schema. 2024-04-16 12:14:09 -04:00
John Chilton bf57676e9e Page object permissions summary... 2024-04-16 12:14:09 -04:00
David López 6a28080561 Merge pull request #17997 from davelopez/23.2_invenio_plugin_fixes
[23.2] Invenio plugin fixes
2024-04-16 17:49:27 +02:00
David LópezandJohn Davis 23164deced Apply suggestions from code review
Co-authored-by: John Davis <jdavcs@gmail.com>
2024-04-16 17:48:01 +02:00
mvdbeek 48168faa35 Don't fail if reporting invalid parameter values
which can contain None values.
Fixes the following traceback:
```
TypeError: sequence item 0: expected str instance, NoneType found
  File "galaxy/web/framework/decorators.py", line 346, in decorator
    rval = func(self, trans, *args, **kwargs)
  File "galaxy/webapps/galaxy/api/tools.py", line 247, in build
    return tool.to_json(trans, kwd.get("inputs", kwd), history=history)
  File "galaxy/tools/__init__.py", line 2509, in to_json
    populate_state(request_context, self.inputs, params.__dict__, state_inputs, state_errors)
  File "galaxy/tools/parameters/__init__.py", line 412, in populate_state
    _populate_state_legacy(
  File "galaxy/tools/parameters/__init__.py", line 625, in _populate_state_legacy
    check_param(request_context, input, param_value, context, simple_errors=simple_errors)
  File "galaxy/tools/parameters/__init__.py", line 246, in check_param
    value = param.from_json(value, trans, param_values)
  File "galaxy/tools/parameters/basic.py", line 1045, in from_json
    f"invalid options ({','.join(set(value) - set(legal_values))!r}) were selected (valid options: {','.join(legal_values)})",
```
Where `None` was in values. Note also that pyright underlined these
lines, not sure why mypy has ignored this error.
2024-04-16 17:41:31 +02:00
David LópezandJohn Davis 0a287f20aa Use proper type for Mapped
Co-authored-by: John Davis <jdavcs@gmail.com>
2024-04-16 17:31:56 +02:00
davelopez 00d98655ff Open notification preferences if specified in route query 2024-04-16 17:31:56 +02:00
davelopez de1cf8f96f Update notification email templates 2024-04-16 17:31:55 +02:00
davelopez 34461f2c1a Update notification creation and sharing logic
This commit updates the notification creation and sharing logic to include the `galaxy_url` field in the `NotificationCreateRequest` and `SharedItemNotificationFactory` classes. This field is used to generate links in the notification content and is passed as an argument when sending notifications to recipients.
2024-04-16 17:31:55 +02:00
davelopez f083768fd9 Add galaxy_url mapped column to notification model 2024-04-16 17:31:54 +02:00
davelopez 89d5af413b Add db migration for galaxy_url column in notifications table 2024-04-16 17:31:53 +02:00
davelopez 123904aced Adapt notification integration tests to work w/o tasks 2024-04-16 17:31:53 +02:00
davelopez 11ca5473ea Allow to force_sync for creating internal notifications
This is useful when we know in advance the list of recipient users and that no group or roles need to be resolved. Like when we share an item with a list of users.
2024-04-16 17:31:52 +02:00
davelopez ba0a0abcfc Refactor GenericModel for reusability 2024-04-16 17:31:52 +02:00
davelopez 452669d272 Fix generic types in notifications schema
Workaround issues with generics auto-generated names when building the client schema.
2024-04-16 17:31:51 +02:00
David LópezandJohn Davis f43b3856f2 Remove redundant nullable in dispatched column
Co-authored-by: John Davis <jdavcs@gmail.com>
2024-04-16 17:31:50 +02:00
davelopez 1e94458461 Handle channel settings depending on server config
External notification channels (like email) are processed in Celery tasks. When Celery is not enabled in the server, we cannot show those channels to the user and we have to indicate in the API that those will be ignored.
2024-04-16 17:31:50 +02:00
davelopez 871ccc685d Update client schema 2024-04-16 17:06:21 +02:00
davelopez 8b4b3858b5 Revert utcnow refactoring
Is not yet deprecated in Python 3.7
2024-04-16 17:06:21 +02:00