From e58ffb7440ffc182e8596b3eae4350dfd623c370 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 25 Jan 2024 12:16:25 -0500 Subject: [PATCH] Input parameter schema. --- .github/workflows/framework.yaml | 3 +- .gitignore | 1 + client/src/components/Tool/ToolForm.vue | 228 +++-- client/src/components/Tool/ToolSuccess.vue | 3 +- .../components/Tool/ToolSuccessMessage.vue | 36 +- client/src/components/Tool/parameterModels.ts | 305 ++++++ .../src/components/Tool/parameter_models.yml | 529 +++++++++++ .../Tool/parameter_specification.yml | 1 + client/src/components/Tool/services.js | 21 + client/src/components/Tool/structured.test.ts | 78 ++ client/src/components/Tool/structured.ts | 378 ++++++++ client/src/stores/jobStore.ts | 1 + doc/source/dev/image.Makefile | 11 + doc/source/dev/plantuml_options.txt | 51 + doc/source/dev/plantuml_style.txt | 9 + doc/source/dev/tool_state.md | 0 doc/source/dev/tool_state_api.plantuml.txt | 17 + .../dev/tool_state_state_classes.plantuml.txt | 41 + lib/galaxy/app.py | 9 +- lib/galaxy/celery/tasks.py | 17 +- lib/galaxy/managers/jobs.py | 53 +- lib/galaxy/model/__init__.py | 30 + ...3d5d144_implement_structured_tool_state.py | 47 + lib/galaxy/schema/schema.py | 11 + lib/galaxy/schema/tasks.py | 12 + lib/galaxy/tool_util/cwl/parser.py | 6 +- lib/galaxy/tool_util/parameters/__init__.py | 93 ++ lib/galaxy/tool_util/parameters/_types.py | 55 ++ lib/galaxy/tool_util/parameters/case.py | 70 ++ lib/galaxy/tool_util/parameters/convert.py | 72 ++ lib/galaxy/tool_util/parameters/factory.py | 271 ++++++ lib/galaxy/tool_util/parameters/models.py | 878 ++++++++++++++++++ lib/galaxy/tool_util/parameters/state.py | 77 ++ lib/galaxy/tool_util/parameters/visitor.py | 56 ++ lib/galaxy/tool_util/parser/cwl.py | 27 +- lib/galaxy/tool_util/parser/interface.py | 4 +- lib/galaxy/tool_util/parser/xml.py | 3 +- lib/galaxy/tool_util/parser/yaml.py | 3 +- .../tool_util/unittest_utils/parameters.py | 46 + lib/galaxy/tool_util/verify/interactor.py | 158 +++- lib/galaxy/tools/__init__.py | 96 +- lib/galaxy/tools/execute.py | 95 +- lib/galaxy/tools/parameters/basic.py | 4 +- lib/galaxy/tools/parameters/meta.py | 75 +- lib/galaxy/webapps/galaxy/api/histories.py | 12 + lib/galaxy/webapps/galaxy/api/jobs.py | 43 +- lib/galaxy/webapps/galaxy/api/tools.py | 57 +- .../webapps/galaxy/services/histories.py | 19 + lib/galaxy/webapps/galaxy/services/jobs.py | 97 +- lib/galaxy/webapps/galaxy/services/tools.py | 72 +- lib/galaxy_test/api/test_tool_execution.py | 61 ++ lib/galaxy_test/base/populators.py | 20 +- scripts/db.py | 1 + scripts/gen_typescript_artifacts.py | 20 + test/functional/test_toolbox_pytest.py | 5 +- .../tools/parameters/cwl_boolean.cwl | 15 + .../tools/parameters/cwl_boolean_optional.cwl | 15 + .../tools/parameters/cwl_directory.cwl | 15 + test/functional/tools/parameters/cwl_file.cwl | 15 + .../functional/tools/parameters/cwl_float.cwl | 15 + .../tools/parameters/cwl_float_optional.cwl | 15 + test/functional/tools/parameters/cwl_int.cwl | 15 + .../tools/parameters/cwl_int_optional.cwl | 15 + .../tools/parameters/cwl_string.cwl | 15 + .../tools/parameters/cwl_string_optional.cwl | 15 + .../tools/parameters/gx_boolean.xml | 29 + .../tools/parameters/gx_boolean_optional.xml | 82 ++ test/functional/tools/parameters/gx_color.xml | 21 + .../parameters/gx_conditional_boolean.xml | 101 ++ .../gx_conditional_boolean_checked.xml | 53 ++ ...l_boolean_discriminate_on_string_value.xml | 113 +++ .../gx_conditional_boolean_optional.xml | 79 ++ .../gx_conditional_conditional_boolean.xml | 30 + test/functional/tools/parameters/gx_data.xml | 21 + .../tools/parameters/gx_data_collection.xml | 14 + .../gx_data_collection_optional.xml | 14 + .../tools/parameters/gx_data_multiple.xml | 21 + .../parameters/gx_data_multiple_optional.xml | 21 + .../tools/parameters/gx_data_optional.xml | 21 + test/functional/tools/parameters/gx_float.xml | 29 + .../tools/parameters/gx_float_optional.xml | 29 + .../functional/tools/parameters/gx_hidden.xml | 21 + .../tools/parameters/gx_hidden_optional.xml | 21 + test/functional/tools/parameters/gx_int.xml | 29 + .../tools/parameters/gx_int_optional.xml | 21 + .../tools/parameters/gx_repeat_boolean.xml | 15 + .../functional/tools/parameters/gx_select.xml | 27 + .../tools/parameters/gx_select_multiple.xml | 27 + .../gx_select_multiple_optional.xml | 27 + .../tools/parameters/gx_select_optional.xml | 27 + test/functional/tools/parameters/gx_text.xml | 21 + .../tools/parameters/gx_text_optional.xml | 21 + test/functional/tools/parameters/macros.xml | 33 + test/functional/tools/sample_tool_conf.xml | 2 + .../tool_util/parameter_specification.yml | 590 ++++++++++++ .../tool_util/test_parameter_specification.py | 194 ++++ .../tool_util/test_parameter_test_cases.py | 29 + 97 files changed, 6133 insertions(+), 188 deletions(-) create mode 100644 client/src/components/Tool/parameterModels.ts create mode 100644 client/src/components/Tool/parameter_models.yml create mode 120000 client/src/components/Tool/parameter_specification.yml create mode 100644 client/src/components/Tool/structured.test.ts create mode 100644 client/src/components/Tool/structured.ts create mode 100644 doc/source/dev/image.Makefile create mode 100644 doc/source/dev/plantuml_options.txt create mode 100644 doc/source/dev/plantuml_style.txt create mode 100644 doc/source/dev/tool_state.md create mode 100644 doc/source/dev/tool_state_api.plantuml.txt create mode 100644 doc/source/dev/tool_state_state_classes.plantuml.txt create mode 100644 lib/galaxy/model/migrations/alembic/versions_gxy/7ffd33d5d144_implement_structured_tool_state.py create mode 100644 lib/galaxy/tool_util/parameters/__init__.py create mode 100644 lib/galaxy/tool_util/parameters/_types.py create mode 100644 lib/galaxy/tool_util/parameters/case.py create mode 100644 lib/galaxy/tool_util/parameters/convert.py create mode 100644 lib/galaxy/tool_util/parameters/factory.py create mode 100644 lib/galaxy/tool_util/parameters/models.py create mode 100644 lib/galaxy/tool_util/parameters/state.py create mode 100644 lib/galaxy/tool_util/parameters/visitor.py create mode 100644 lib/galaxy/tool_util/unittest_utils/parameters.py create mode 100644 lib/galaxy_test/api/test_tool_execution.py create mode 100644 scripts/gen_typescript_artifacts.py create mode 100644 test/functional/tools/parameters/cwl_boolean.cwl create mode 100644 test/functional/tools/parameters/cwl_boolean_optional.cwl create mode 100644 test/functional/tools/parameters/cwl_directory.cwl create mode 100644 test/functional/tools/parameters/cwl_file.cwl create mode 100644 test/functional/tools/parameters/cwl_float.cwl create mode 100644 test/functional/tools/parameters/cwl_float_optional.cwl create mode 100644 test/functional/tools/parameters/cwl_int.cwl create mode 100644 test/functional/tools/parameters/cwl_int_optional.cwl create mode 100644 test/functional/tools/parameters/cwl_string.cwl create mode 100644 test/functional/tools/parameters/cwl_string_optional.cwl create mode 100644 test/functional/tools/parameters/gx_boolean.xml create mode 100644 test/functional/tools/parameters/gx_boolean_optional.xml create mode 100644 test/functional/tools/parameters/gx_color.xml create mode 100644 test/functional/tools/parameters/gx_conditional_boolean.xml create mode 100644 test/functional/tools/parameters/gx_conditional_boolean_checked.xml create mode 100644 test/functional/tools/parameters/gx_conditional_boolean_discriminate_on_string_value.xml create mode 100644 test/functional/tools/parameters/gx_conditional_boolean_optional.xml create mode 100644 test/functional/tools/parameters/gx_conditional_conditional_boolean.xml create mode 100644 test/functional/tools/parameters/gx_data.xml create mode 100644 test/functional/tools/parameters/gx_data_collection.xml create mode 100644 test/functional/tools/parameters/gx_data_collection_optional.xml create mode 100644 test/functional/tools/parameters/gx_data_multiple.xml create mode 100644 test/functional/tools/parameters/gx_data_multiple_optional.xml create mode 100644 test/functional/tools/parameters/gx_data_optional.xml create mode 100644 test/functional/tools/parameters/gx_float.xml create mode 100644 test/functional/tools/parameters/gx_float_optional.xml create mode 100644 test/functional/tools/parameters/gx_hidden.xml create mode 100644 test/functional/tools/parameters/gx_hidden_optional.xml create mode 100644 test/functional/tools/parameters/gx_int.xml create mode 100644 test/functional/tools/parameters/gx_int_optional.xml create mode 100644 test/functional/tools/parameters/gx_repeat_boolean.xml create mode 100644 test/functional/tools/parameters/gx_select.xml create mode 100644 test/functional/tools/parameters/gx_select_multiple.xml create mode 100644 test/functional/tools/parameters/gx_select_multiple_optional.xml create mode 100644 test/functional/tools/parameters/gx_select_optional.xml create mode 100644 test/functional/tools/parameters/gx_text.xml create mode 100644 test/functional/tools/parameters/gx_text_optional.xml create mode 100644 test/functional/tools/parameters/macros.xml create mode 100644 test/unit/tool_util/parameter_specification.yml create mode 100644 test/unit/tool_util/test_parameter_specification.py create mode 100644 test/unit/tool_util/test_parameter_test_cases.py diff --git a/.github/workflows/framework.yaml b/.github/workflows/framework.yaml index 5de51cca7cad..bdf4db719f16 100644 --- a/.github/workflows/framework.yaml +++ b/.github/workflows/framework.yaml @@ -26,6 +26,7 @@ jobs: strategy: matrix: python-version: ['3.7'] + use-legacy-api: ['0', '1'] services: postgres: image: postgres:13 @@ -66,7 +67,7 @@ jobs: path: 'galaxy root/.venv' key: gxy-venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-framework - name: Run tests - run: ./run_tests.sh --coverage --framework + run: GALAXY_TEST_USE_LEGACY_TOOL_API="${{ matrix.use-legacy-api }}" ./run_tests.sh --coverage --framework working-directory: 'galaxy root' - uses: codecov/codecov-action@v3 with: diff --git a/.gitignore b/.gitignore index fd3864c71cd2..7950718e63a7 100644 --- a/.gitignore +++ b/.gitignore @@ -154,6 +154,7 @@ doc/build doc/schema.md doc/source/admin/config_logging_default_yaml.rst doc/source/dev/schema.md +doc/source/dev/plantuml.jar client/docs/dist # Webpack stats diff --git a/client/src/components/Tool/ToolForm.vue b/client/src/components/Tool/ToolForm.vue index cf1a0935485c..057fc7943b08 100644 --- a/client/src/components/Tool/ToolForm.vue +++ b/client/src/components/Tool/ToolForm.vue @@ -50,7 +50,6 @@ @onChange="onChange" @onValidation="onValidation" /> -
@@ -81,7 +80,7 @@