Commit Graph
387 Commits
Author SHA1 Message Date
mvdbeek 69a3cda018 Fix history import when parent_hda not serialized
and make sure we include the parent_hda when exporting histories.
Fixes
https://sentry.galaxyproject.org/share/issue/20ee27f675ef476588bbe8ff273eaee7/:
```
KeyError: '31e7840b5aedca43523bfcc8e2e9e56f'
  File "galaxy/jobs/__init__.py", line 2039, in finish
    task_wrapper = self.tool.exec_after_process(
  File "galaxy/tools/__init__.py", line 3100, in exec_after_process
    JobImportHistoryArchiveWrapper(self.app, job.id).cleanup_after_job()
  File "galaxy/tools/imp_exp/__init__.py", line 81, in cleanup_after_job
    model_store.perform_import(new_history, job=job, new_history=True)
  File "galaxy/model/store/__init__.py", line 416, in perform_import
    self._import_implicit_dataset_conversions(object_import_tracker)
  File "galaxy/model/store/__init__.py", line 1280, in _import_implicit_dataset_conversions
    idc.parent_hda = object_import_tracker.hdas_by_key[idc_attrs["parent_hda"]]
```
2024-09-23 11:07:20 +02:00
John Chilton d3991a696b Object Store creation templates. 2024-05-20 12:16:02 -04:00
John Davis 7f83b903cb Add history pruner + test
Add __init__.py to test.unit.data.model.db
2024-05-02 14:12:35 -04:00
John Davis 1773dca37a Add model fixtures 2024-05-02 14:12:35 -04:00
John Davis 2652ec6510 Add conftest.py for db tests 2024-05-02 14:12:35 -04:00
John Davis 76c8003d4f Drop unused mapping testing utilities and fixtures 2024-05-02 14:12:35 -04:00
mvdbeek 0456ff1cfd Merge branch 'release_24.0' into dev 2024-05-02 11:32:44 +02:00
Nicola Soranzo 534010a8cb Enable flake8-implicit-str-concat ruff rules
See https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
2024-04-29 13:37:54 +01:00
Nicola Soranzo 0629908541 Fix new UP031 errors from ruff 0.4.2 2024-04-29 00:09:38 +01:00
John Chilton ac197e7f25 Refactor galaxy.files plugin + config handling.
- Downstream I want a way to load plugins from outside the ConfiguredFileSources class.
- Adds some more typing as I went in there and refactored things.
2024-04-25 13:05:02 -04:00
davelopez b7eda89485 Add test to verify export dataset without hid works 2024-04-25 12:06:28 +02:00
mvdbeek 67436a6156 Merge branch 'release_24.0' into dev 2024-04-17 16:22:04 +02:00
mvdbeek c7c0bafcf7 Use or copy StoredWorkflow when copying step
Fixes https://sentry.galaxyproject.org/share/issue/509cadd762e749e1a782bb4806161ed3/:

```
AttributeError: 'NoneType' object has no attribute 'latest_workflow'
  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 987, in refactor
    return self.service.refactor(trans, workflow_id, payload, instance or False)
  File "galaxy/webapps/galaxy/services/workflows.py", line 218, in refactor
    return self._workflow_contents_manager.refactor(trans, stored_workflow, payload)
  File "galaxy/managers/workflows.py", line 1963, in refactor
    refactored_workflow, action_executions = self.do_refactor(trans, stored_workflow, refactor_request)
  File "galaxy/managers/workflows.py", line 1947, in do_refactor
    action_executions = refactor_executor.refactor(refactor_request)
  File "galaxy/workflow/refactor/execute.py", line 77, in refactor
    refactor_method(action, execution)
  File "galaxy/workflow/refactor/execute.py", line 374, in _apply_upgrade_subworkflow
    content_id = trans.security.encode_id(stored_workflow.latest_workflow.id)
```

You can reproduce this by creating a subworkflow, renaming the parent
workflow and then attempting to update the subworkflow step.
2024-04-16 10:13:48 +02:00
Nicola Soranzo 053ca5198e Enable `warn_unused_ignores` mypy option 2024-04-16 01:12:58 +01:00
Nicola Soranzo 2317db70c6 Move `test_vault.py` unit tests to correct package directory 2024-04-15 23:43:49 +01:00
John Davis bf62b25eee Merge pull request #17922 from jdavcs/dev_model_edits1
Model edits and bug fixes
2024-04-11 20:30:25 -04:00
Martin Cech fdb18ad0a0 Merge branch 'release_24.0' into 240todev 2024-04-08 16:54:06 -07:00
mvdbeek b971e33263 Fix Qiime2 display_peek method
Fixes:
```
ExceptionGroup: unhandled errors in a TaskGroup
  File "starlette/_utils.py", line 87, in collapse_excgroups
    yield
  File "starlette/middleware/base.py", line 190, in __call__
    async with anyio.create_task_group() as task_group:
  File "anyio/_backends/_asyncio.py", line 678, in __aexit__
    raise BaseExceptionGroup(
AttributeError: 'NoneType' object has no attribute 'replace'
  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 992, in __index_v2
    items = [
  File "galaxy/webapps/galaxy/services/history_contents.py", line 993, in <listcomp>
    self._serialize_content_item(
  File "galaxy/webapps/galaxy/services/history_contents.py", line 1064, in _serialize_content_item
    rval = serializer.serialize_to_view(
  File "galaxy/managers/base.py", line 785, in serialize_to_view
    return self.serialize(item, all_keys, **context)
  File "galaxy/managers/hdas.py", line 614, in serialize
    return super().serialize(hda, keys, user=user, **context)
  File "galaxy/managers/datasets.py", line 770, in serialize
    serialized = super().serialize(dataset_assoc, keys, **context)
  File "galaxy/managers/base.py", line 698, in serialize
    returned[key] = self.serializers[key](item, key, **context)
  File "galaxy/managers/datasets.py", line 633, in <lambda>
    "peek": lambda item, key, **context: item.display_peek() if item.peek and item.peek != "no peek" else None,
  File "galaxy/model/__init__.py", line 4669, in display_peek
    return self.datatype.display_peek(self)
  File "galaxy/datatypes/qiime2.py", line 57, in display_peek
    table += [make_row(pair) for pair in self._peek(dataset, simple=True)]
  File "galaxy/datatypes/qiime2.py", line 57, in <listcomp>
    table += [make_row(pair) for pair in self._peek(dataset, simple=True)]
  File "galaxy/datatypes/qiime2.py", line 54, in make_row
    return f"<tr><th>{pair[0]}</th><td>{html.escape(pair[1])}</td></tr>"
  File "__init__.py", line 19, in escape
    s = s.replace("&", "&amp;") # Must be done first!
```
2024-04-08 16:25:34 +02:00
John Davis 09fee6aaad Remove future, autocommit args from session and engine creation 2024-04-05 13:54:39 -04:00
John Davis f52d35bf7f Use NullPool for sqlite engines
This restores the behavior under SQLAlchemy 1.4
(Note that we set the pool for sqlite only if it's not an in-memory db
2024-04-02 10:08:53 -04:00
John Davis 78a77d934a Mypy: typing errors, misc. fixes 2024-04-02 10:08:53 -04:00
John Davis f1579e13de Fix typing error: use Session instead of scoped_session
No need to pass around scoped_session as arguments
2024-04-02 10:08:53 -04:00
John Chilton 383057d9b8 Linting fix. 2024-03-27 13:25:50 -04:00
John Chilton 77ef4a3896 objectstores storage management (UI+API) 2024-03-27 10:22:59 -04:00
mvdbeek 06a07bb295 Merge branch 'release_24.0' into dev 2024-03-21 19:08:38 +01:00
John Davis 7af9c3d127 Merge pull request #17728 from jmchilton/history_update_bug
[24.0] Fix source history update_time being updated when importing a public history
2024-03-21 12:35:02 -04:00
mvdbeek cd16d19d8a Merge branch 'release_24.0' into dev 2024-03-20 15:50:39 +01:00
mvdbeek 6f08b9fc9c Add unit test for updating output hda copies 2024-03-19 10:41:16 +01:00
John Chilton e67bff7349 Why doesn't the update bug appear at the model level? 2024-03-18 10:10:54 -04:00
Nicola Soranzo a2018a5e60 Enable flake8-comprehensions ruff rules
but allow `dict()` calls that make use of keyword arguments (e.g.,
`dict(a=1, b=2)`).
2024-03-09 19:11:20 +00:00
John Davis 54294f03cb Merge pull request #13918 from bernt-matthias/tabular-improvement
Make columns types an empty list for empty tabular data
2024-03-01 13:40:33 -05:00
John Davis 25d95278cb Make comment more detailed 2024-03-01 13:39:51 -05:00
guillaume-gricourt 1dc9eb9e2e tests(datatypes): add SBOL 2024-02-27 09:56:40 +01:00
Martin Cech 0d380c4f10 Merge pull request #17462 from bernt-matthias/topic/fasta-set-meta
Faster FASTA and FASTQ metadata setting
2024-02-19 21:15:09 +01:00
Matthias Bernt f198184350 add type ignores
for mock
2024-02-19 16:44:31 +01:00
Matthias Bernt d90a101331 treat empty files correctly
as 0 column files

- refactor type_overrules_type for simplicity
- add tests
2024-02-19 12:07:37 +01:00
Matthias Bernt b7ca5258a3 add unit test for Tabular.set_meta for empty files 2024-02-19 12:05:09 +01:00
Matthias Bernt 9f04af05cd extend existing unit test for Tabular.set_meta
to actually check set metadata values
2024-02-19 12:04:40 +01:00
John Chilton e93ea2a665 Display workflow invocation counts.
Performance: Workflows render fine without the data, data is fetched asynchronously from other queries, joins only happen across a couple of fields that are all indexed, avoiding serializing objects and such - the SQL is quite low-level.
2024-02-17 16:12:58 -05:00
Matthias Bernt 6b52d6d8bb fix unit tests 2024-02-13 22:15:17 +01:00
Matthias Bernt e5ff24238f isort import fix 2024-02-13 20:23:19 +01:00
Matthias Bernt fcb6fd2517 add tests for fasta/fastq set_meta 2024-02-13 17:08:20 +01:00
Martin Cech cc94611a18 Merge pull request #17329 from jmchilton/device_source
API endpoint that allows "changing" the objectstore for "safe" scenarios.
2024-02-10 01:09:30 +01:00
Marius van den Beek 5f25655096 Merge pull request #17346 from jmchilton/model_store_fixes
Fix model store exports that include implicit conversions.
2024-02-08 10:59:36 +01:00
John Chilton c106a87a90 Implement device source ID for object stores.
Allow attaching a device ID on object stores that indicates they produce equivalent paths. Implement an API endpoint that allows swapping datsets between equivalent object stores if they have not been copied by new users.
2024-02-07 11:39:51 -05:00
Nicola Soranzo e975ca3754 Update to black 2024 stable style 2024-01-30 18:09:51 +00:00
John Chilton 4157042ffa Fix overlapping names in extra files for model stores. 2024-01-25 10:03:44 -05:00
John Chilton 69b01ac0e8 Utilities for higher level composite tests in test_model_store. 2024-01-25 10:03:44 -05:00
John Chilton 3a71150819 Minimal test case demonstrating model stores break on implicit conversions. 2024-01-25 09:32:40 -05:00
John Chilton 936a35d90d More de-duplication in test_model_store.py. 2024-01-25 09:32:35 -05:00