From e50286365766b53a942615eaeb1ac7aa0aba3c32 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 1 Dec 2023 10:50:47 +0100 Subject: [PATCH] Add missing optional description field, fixes ephemeris data library example --- client/src/schema/schema.ts | 16 ++++++++++ lib/galaxy/schema/fetch_data.py | 1 + test/unit/webapps/api/test_fetch_schema.py | 35 +++++++++++++++++++++- 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/client/src/schema/schema.ts b/client/src/schema/schema.ts index 70261437eb75..b490cc7f6bf5 100644 --- a/client/src/schema/schema.ts +++ b/client/src/schema/schema.ts @@ -2273,6 +2273,8 @@ export interface components { * @default false */ deferred?: boolean; + /** Description */ + description?: string; elements_from?: components["schemas"]["ElementsFromType"]; /** * Ext @@ -3723,6 +3725,8 @@ export interface components { * @default false */ deferred?: boolean; + /** Description */ + description?: string; elements_from?: components["schemas"]["ElementsFromType"]; /** * Ext @@ -3952,6 +3956,8 @@ export interface components { * @default false */ deferred?: boolean; + /** Description */ + description?: string; elements_from?: components["schemas"]["ElementsFromType"]; /** * Ext @@ -6457,6 +6463,8 @@ export interface components { * @default false */ deferred?: boolean; + /** Description */ + description?: string; /** Elements */ elements: ( | ( @@ -7074,6 +7082,8 @@ export interface components { * @default false */ deferred?: boolean; + /** Description */ + description?: string; elements_from?: components["schemas"]["ElementsFromType"]; /** * Ext @@ -7135,6 +7145,8 @@ export interface components { * @default false */ deferred?: boolean; + /** Description */ + description?: string; elements_from?: components["schemas"]["ElementsFromType"]; /** * Ext @@ -7497,6 +7509,8 @@ export interface components { * @default false */ deferred?: boolean; + /** Description */ + description?: string; elements_from?: components["schemas"]["ElementsFromType"]; /** * Ext @@ -8384,6 +8398,8 @@ export interface components { * @default false */ deferred?: boolean; + /** Description */ + description?: string; elements_from?: components["schemas"]["ElementsFromType"]; /** * Ext diff --git a/lib/galaxy/schema/fetch_data.py b/lib/galaxy/schema/fetch_data.py index 0655b9904823..83cc385d4b2d 100644 --- a/lib/galaxy/schema/fetch_data.py +++ b/lib/galaxy/schema/fetch_data.py @@ -119,6 +119,7 @@ class BaseDataElement(FetchBaseModel): items_from: Optional[ElementsFromType] = Field(alias="elements_from") collection_type: Optional[str] MD5: Optional[str] + description: Optional[str] class Config: # reject unknown extra attributes diff --git a/test/unit/webapps/api/test_fetch_schema.py b/test/unit/webapps/api/test_fetch_schema.py index 0a78c56bec8b..45c600a8d0d9 100644 --- a/test/unit/webapps/api/test_fetch_schema.py +++ b/test/unit/webapps/api/test_fetch_schema.py @@ -1,6 +1,8 @@ from copy import deepcopy from json import dumps +import yaml + from galaxy.schema.fetch_data import ( FetchDataPayload, FileDataElement, @@ -121,6 +123,33 @@ "auto_decompress": True, } +library_payload = yaml.safe_load( + """ +destination: + type: library + name: "Cool Training Library" + description: "A longer description." + synopsis: "Optional - does anyone ever set this?" +items: + - name: "Test Folder 1" + description: "Description of what is in Test Folder 1" # Only populated with new API. + items: + - url: https://raw.githubusercontent.com/eteriSokhoyan/test-data/master/cliques-high-representatives.fa + src: url + ext: fasta + info: "A cool longer description." # Only populated with new API. + dbkey: "hg19" # Only populated with new API. + - name: "Test data segmentation-fold" + items: + - url: https://raw.githubusercontent.com/yhoogstrate/segmentation-fold/55d0bb28b01e613844ca35cf21fa41379fd72770/scripts/energy-estimation-utility/tests/test-data/workflow-test_cd-box_kturns.xml + name: workflow-test_cd-box_kturns.xml # Only populated with new API. + info: Downloaded from https://raw.githubusercontent.com/yhoogstrate/segmentation-fold/55d0bb28b01e613844ca35cf21fa41379fd72770/scripts/energy-estimation-utility/tests/test-data/workflow-test_cd-box_kturns.xml + src: url + ext: xml + +""" +) + def test_fetch_data_schema(): payload = FetchDataPayload(**example_payload) @@ -156,5 +185,9 @@ def test_recursive_archive_form_like_data(): FetchDataPayload(**payload) -def test_nested_elemet_regression(): +def test_nested_element_regression(): FetchDataPayload(**nested_element_regression_payload) + + +def test_library_payload(): + FetchDataPayload(targets=[library_payload], history_id=HISTORY_ID)