Commit Graph
59374 Commits
Author SHA1 Message Date
mvdbeek ef0b04c345 Add more tags 2022-03-20 14:26:28 +01:00
mvdbeek d8271307d8 Restore tags in customized openapi schema 2022-03-20 14:26:28 +01:00
mvdbeek 102a7eab63 Add apispec dependency 2022-03-20 14:26:28 +01:00
mvdbeek e5eed5cbe0 Include non-FastAPI routes in api/docs 2022-03-19 16:56:46 +01:00
James Taylor 9a34fba455 API Schema Generation.
Traverse all registered API routes, attempt to load schema information
if available in docstring, register with an `APISpec` instance, and
convert to YAML.
2022-03-19 15:08:56 +01:00
Björn Grüning 479194ba9d Merge pull request #13577 from nsoranzo/fix_test_callback_nonce_validation_with_bad_nonce_unit_test
Fix `test_callback_nonce_validation_with_bad_nonce` unit test
2022-03-19 09:32:18 +01:00
Nicola Soranzo 6524e1f344 Fix path of venv when caching 2022-03-19 03:52:23 +00:00
Nicola Soranzo ca523f56b0 Cache galaxy root/.venv instead of .tox
Unit tests are not using tox any more since commit
c90e012fda .

Reports startup also install packages in the venv and not in `.tox` .
2022-03-19 03:38:12 +00:00
Nicola Soranzo cc5224bcf9 Use unique group id for unit-postgres tests
Otherwise unit tests get cancelled when unit-postgres job finishes.
2022-03-19 03:05:55 +00:00
Nicola Soranzo 6189032838 Fix test_callback_nonce_validation_with_bad_nonce unit test
Broken in PR #13572.
2022-03-19 02:20:05 +00:00
Nicola Soranzo 00f7522e7e Merge branch 'release_22.01' into dev 2022-03-19 01:57:33 +00:00
Marius van den Beek 38509cac8e Merge pull request #13576 from nsoranzo/release_22.01_fix_broken_model_discovery_tests
[22.01] Fix model discovery unit tests
2022-03-18 22:55:39 +01:00
Nicola Soranzo 0075ecb275 Fix model discovery unit tests
that I broke when merging
https://github.com/galaxyproject/galaxy/pull/13552 forward.

Fix:

```
app = <galaxy.model.unittest_utils.data_app.GalaxyDataTestApp object at 0x7f0e00dd3640>, target = '/tmp/tmpyj5d8268', work_directory = '/tmp/tmp_a7e191v'

    def _import_directory_to_history(app, target, work_directory):
        sa_session = app.model.context

        u = model.User(email="collection@example.com", password="password")
        import_history = model.History(name="Test History for Import", user=u)

        sa_session = app.model.context
        sa_session.add_all([u, import_history])
        sa_session.flush()

        assert len(import_history.datasets) == 0

        import_options = store.ImportOptions(allow_dataset_object_edit=True)
>       import_model_store = store.get_import_model_store_for_directory(target, app=app, user=u, import_options=import_options, tag_handler=app.tag_handler.create_tag_handler_session())
E       AttributeError: 'GalaxyDataTestApp' object has no attribute 'tag_handler'

test/unit/data/model/test_model_discovery.py:235: AttributeError
```
2022-03-18 19:12:20 +00:00
Nicola Soranzo 5114b67902 Merge branch 'release_21.09' into release_22.01 2022-03-18 18:28:15 +00:00
Nicola Soranzo 8e4bdb58e4 Merge branch 'release_21.05' into release_21.09 2022-03-18 18:08:10 +00:00
Dannon 1946eaf9a9 Merge pull request #13572 from afgane/nonce-mismatch-hint
Add nonce mismatch hint to exception msg
2022-03-18 13:09:36 -04:00
Marius van den Beek 74a51d990a Merge pull request #13552 from mvdbeek/fix_tag_creation_metadata_strategy_extended
[21.09] Fix creating tags within sessionless context
2022-03-18 15:42:43 +01:00
Nicola Soranzo 13d0f92fc0 Merge pull request #13071 from mvdbeek/drop_wsgi_mode 2022-03-18 13:41:33 +00:00
John Chilton 316998dea1 Merge pull request #13573 from mvdbeek/fix_tool_shed_bootstrapping
[22.01] Fix tool shed bootstrapping
2022-03-18 09:11:53 -04:00
mvdbeek 7aae40d1af Include unit test for sessionless export/import with tags
Seems like the only way you could previously include tags
was if you included them in the data fetch tool.
2022-03-18 12:16:17 +01:00
mvdbeek 558cad246e Return tag in get_tag_by_name function 2022-03-18 11:12:06 +01:00
mvdbeek 6454ef1aad Drop converting things for which we have no equivalent 2022-03-17 21:20:59 +01:00
mvdbeek dc75df3b0b Fall back to generic WebApplicationStack
if we're building a web app, but aren't using gunicorn. I don't think
this has a big impact currently, since you can only set base pools via
lib/galaxy/main.py. I think you could set up alternative logging based
on the web stack class though, and this seems cleaner.
2022-03-17 21:20:59 +01:00
mvdbeek 96879486e2 Drop unused application_stack argument 2022-03-17 21:20:59 +01:00
mvdbeek b688aaf545 Drop unused get_stack_facts 2022-03-17 21:20:59 +01:00
Nicola Soranzo fe88225a14 Fix typo 2022-03-17 19:01:44 +00:00
mvdbeek 4c7bfd1032 Fix tool shed bootstrapping script 2022-03-17 19:34:43 +01:00
mvdbeek e9d2d683d6 Add --capture-output when running gunicorn in daemon mode 2022-03-17 19:34:16 +01:00
mvdbeek 3d7dde0f9b Fix tool shed /api/authenticate/baseauth/
Fixes:
```
AttributeError: 'UniverseApplication' object has no attribute 'user_manager'
  File "galaxy/web/framework/decorators.py", line 312, in decorator
    rval = func(self, trans, *args, **kwargs)
  File "galaxy/webapps/galaxy/api/authenticate.py", line 63, in get_api_key
    user = self.app.user_manager.get_user_by_identity(identity)
```
2022-03-17 19:33:18 +01:00
Nicola Soranzo 7699d40add Merge pull request #13571 from simonbray/importable-wf 2022-03-17 18:24:56 +00:00
Enis Afgan fe0083fb2b Add nonce mismatch hint to exception msg 2022-03-17 12:23:23 -04:00
Simon Bray a362874f07 allow setting a workflow as (un)importable via the API 2022-03-17 17:20:21 +01:00
mvdbeek 92d4ffc77a Fix extended_metadata jobs with dce inputs
This broke when we started re-exporting jobs to update their command
line in https://github.com/galaxyproject/galaxy/pull/12459/commits/65e0ee213ae574bc0a45dfcc60e997863ff96a7c#diff-bfb854f344e56a25a86761f80a639de09add404a7a53ebde45afb908762fc1eaR161:

```
ERROR    galaxy.jobs:__init__.py:1836 problem importing job outputs. stdout [] stderr [
Traceback (most recent call last):
  File "metadata/set.py", line 1, in <module>
    from galaxy_ext.metadata.set_metadata import set_metadata; set_metadata()
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/metadata/set_metadata.py", line 121, in set_metadata
    set_metadata_portable()
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/metadata/set_metadata.py", line 307, in set_metadata_portable
    export_store.export_job(job, include_job_data=False)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/__init__.py", line 1320, in export_job
    self.export_jobs([job], include_job_data=include_job_data)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/__init__.py", line 1336, in export_jobs
    job_attrs = job.serialize(self.security, self.serialization_options)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/__init__.py", line 339, in serialize
    return self._serialize(id_encoder, serialization_options)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/__init__.py", line 1447, in _serialize
    params_objects = remap(params_objects, remap_objects)
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.7/site-packages/boltons/iterutils.py", line 1128, in remap
    visited_item = visit(path, key, value)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/__init__.py", line 1441, in remap_objects
    new_id = serialization_options.get_identifier_for_id(id_encoder, obj["id"])
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/__init__.py", line 323, in get_identifier_for_id
    raise NotImplementedError()
NotImplementedError
]
```

To test run `GALAXY_CONFIG_METADATA_STRATEGY=extended ./run_tests.sh
-api
lib/galaxy_test/api/test_jobs.py::JobsApiTestCase::test_dce_submission_security`
2022-03-17 10:28:06 +01:00
Sergey Golitsynskiy c88354adc6 Remove duplicate names 2022-03-17 10:28:06 +01:00
Marius van den Beek ce7d376416 Merge pull request #13553 from mvdbeek/fix_extended_metadata_jobs_with_dce_inputs
[22.01] Fix extended_metadata jobs with dce inputs
2022-03-17 08:45:03 +01:00
Dannon bbab98ab46 Merge pull request #13563 from galaxyproject/blankenberg-configfiles-galaxy.xsd
Fix for configfiles examples in galaxy.xsd
2022-03-16 21:04:36 -04:00
Nicola Soranzo 3251a665d3 Merge pull request #13559 from jmchilton/rework_imports 2022-03-17 00:50:50 +00:00
Daniel Blankenberg ad32279dbb Fix for configfiles examples in galaxy.xsd 2022-03-16 17:51:02 -04:00
John Chilton 427847bcc4 Fix up some import "issues". 2022-03-16 14:22:50 -04:00
John Chilton d4b1b1625a Merge pull request #13476 from jmchilton/no_implicit_reexport
Disable implicit re-imports across the project.
2022-03-16 14:04:31 -04:00
Nicola Soranzo bad8ecbda2 Merge pull request #13554 from mvdbeek/fix_sff_extractor_tool 2022-03-16 18:00:25 +00:00
Sergey Golitsynskiy 41d7cf20e4 Merge pull request #13541 from ic4f/dev_13376_migration
Add source_metadata column to workflow table as alembic revision
2022-03-16 11:01:25 -04:00
mvdbeek e2d43806dc Fix `sff_extract` tool, drop type annotation
I don't think this tool is really used much, but it is loaded in
`tool_conf.xml`.
https://github.com/galaxyproject/galaxy/pull/11877 added type
annotations, and that's a syntax error on 2.7

The alternative would be to fix the rest of the tool for 3.x,
but I think we're just wasting our time there and we shouldn't
touch this again.
2022-03-16 15:24:55 +01:00
mvdbeek cf359f0b87 Fix extended_metadata jobs with dce inputs
This broke when we started re-exporting jobs to update their command
line in https://github.com/galaxyproject/galaxy/pull/12459/commits/65e0ee213ae574bc0a45dfcc60e997863ff96a7c#diff-bfb854f344e56a25a86761f80a639de09add404a7a53ebde45afb908762fc1eaR161:

```
ERROR    galaxy.jobs:__init__.py:1836 problem importing job outputs. stdout [] stderr [
Traceback (most recent call last):
  File "metadata/set.py", line 1, in <module>
    from galaxy_ext.metadata.set_metadata import set_metadata; set_metadata()
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/metadata/set_metadata.py", line 121, in set_metadata
    set_metadata_portable()
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/metadata/set_metadata.py", line 307, in set_metadata_portable
    export_store.export_job(job, include_job_data=False)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/__init__.py", line 1320, in export_job
    self.export_jobs([job], include_job_data=include_job_data)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/__init__.py", line 1336, in export_jobs
    job_attrs = job.serialize(self.security, self.serialization_options)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/__init__.py", line 339, in serialize
    return self._serialize(id_encoder, serialization_options)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/__init__.py", line 1447, in _serialize
    params_objects = remap(params_objects, remap_objects)
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.7/site-packages/boltons/iterutils.py", line 1128, in remap
    visited_item = visit(path, key, value)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/__init__.py", line 1441, in remap_objects
    new_id = serialization_options.get_identifier_for_id(id_encoder, obj["id"])
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/__init__.py", line 323, in get_identifier_for_id
    raise NotImplementedError()
NotImplementedError
]
```

To test run `GALAXY_CONFIG_METADATA_STRATEGY=extended ./run_tests.sh
-api
lib/galaxy_test/api/test_jobs.py::JobsApiTestCase::test_dce_submission_security`
2022-03-16 13:44:07 +01:00
mvdbeek 880c129fa5 Fix creating tags within sessionless context
xref: https://github.com/galaxyproject/galaxy/issues/13551, fixes
```
galaxy.jobs ERROR 2022-03-15 00:21:29,515 [pN:main,p:2180,tN:LocalRunner.work_thread-3] problem importing job outputs. stdout [] stderr [
Traceback (most recent call last):
  File "metadata/set.py", line 1, in <module>
    from galaxy_ext.metadata.set_metadata import set_metadata; set_metadata()
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/metadata/set_metadata.py", line 121, in set_metadata
    set_metadata_portable()
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/metadata/set_metadata.py", line 291, in set_metadata_portable
    collect_dynamic_outputs(job_context, output_collections)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/job_execution/output_collect.py", line 147, in collect_dynamic_outputs
    persist_elements_to_hdca(job_context, elements, hdca, collector=DEFAULT_DATASET_COLLECTOR)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/discover.py", line 719, in persist_elements_to_hdca
    filenames,
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/discover.py", line 292, in populate_collection_elements
    final_job_state=final_job_state,
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/discover.py", line 354, in _populate_elements
    self.add_tags_to_datasets(datasets=element_datasets["datasets"], tag_lists=element_datasets["tag_lists"])
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/discover.py", line 576, in add_tags_to_datasets
    self.tag_handler.add_tags_from_list(user, dataset, tags, flush=False)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/tags.py", line 61, in add_tags_from_list
    return self.set_tags_from_list(user, item, new_tags_set, flush=flush)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/tags.py", line 75, in set_tags_from_list
    self.apply_item_tags(user, item, unicodify(new_tags_str, "utf-8"), flush=flush)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/tags.py", line 207, in apply_item_tags
    self.apply_item_tag(user, item, name, value, flush=flush)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/tags.py", line 179, in apply_item_tag
    tag = self._get_or_create_tag(lc_name)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/tags.py", line 281, in _get_or_create_tag
    tag = self._create_tag(scrubbed_tag_str)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/tags.py", line 246, in _create_tag
    tag = self._create_tag_instance(tag_name)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/tags.py", line 428, in _create_tag_instance
    tag = super()._create_tag_instance(tag_name)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/tags.py", line 259, in _create_tag_instance
    Session = sessionmaker(self.sa_session.bind)
AttributeError: 'NoneType' object has no attribute 'bind'
]
Traceback (most recent call last):
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/jobs/__init__.py", line 1828, in finish
    import_model_store.perform_import(history=job.history, job=job)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/__init__.py", line 209, in perform_import
    datasets_attrs = self.datasets_properties()
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/__init__.py", line 930, in datasets_properties
    datasets_attrs = load(open(datasets_attrs_file_name))
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp19s6x278/tmpt0rr8vmw/tmp2mjq6ysx/database/job_working_directory1/000/7/metadata/outputs_populated/datasets_attrs.txt'
galaxy.jobs.runners ERROR 2022-03-15 00:21:29,516 [pN:main,p:2180,tN:LocalRunner.work_thread-3] (7/) Job wrapper finish method failed
Traceback (most recent call last):
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/jobs/runners/__init__.py", line 594, in _finish_or_resubmit_job
    job_stderr=job_stderr,
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/jobs/__init__.py", line 1828, in finish
    import_model_store.perform_import(history=job.history, job=job)
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/__init__.py", line 209, in perform_import
    datasets_attrs = self.datasets_properties()
  File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/model/store/__init__.py", line 930, in datasets_properties
    datasets_attrs = load(open(datasets_attrs_file_name))
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp19s6x278/tmpt0rr8vmw/tmp2mjq6ysx/database/job_working_directory1/000/7/metadata/outputs_populated/datasets_attrs.txt'
```
2022-03-16 11:32:06 +01:00
mvdbeek c6cdf5b247 Fix tool shed tests 2022-03-16 11:12:35 +01:00
Marius van den Beek 4b3c94822a Merge pull request #13545 from dannon/history-expand-animation
Card expansion animation in new history
2022-03-16 10:19:48 +01:00
John Chilton 31e15bc03c Fix cwltool imports to not rely on implicit re-exports. 2022-03-15 19:58:42 -04:00
John Chilton 4dae7c6f21 Disable implicit re-imports across the projects.
Exclude galaxy.util for now, but the exclusion is tracked in setup.cfg. Elimiantes a bunch of flake exception markers.
2022-03-15 19:58:42 -04:00
John Chilton 8a27ff1df1 Merge pull request #13549 from jmchilton/broken_merge
Fix broken merge.
2022-03-15 19:58:32 -04:00