Skip to content

Commit

Permalink
Merge pull request galaxyproject#17116 from mvdbeek/fix_library_manif…
Browse files Browse the repository at this point in the history
…est_upload

[23.1] Add missing optional description field, fixes ephemeris data library example
  • Loading branch information
mvdbeek authored Dec 1, 2023
2 parents 0e3a0ca + e502863 commit 98dc9c9
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
16 changes: 16 additions & 0 deletions client/src/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2273,6 +2273,8 @@ export interface components {
* @default false
*/
deferred?: boolean;
/** Description */
description?: string;
elements_from?: components["schemas"]["ElementsFromType"];
/**
* Ext
Expand Down Expand Up @@ -3723,6 +3725,8 @@ export interface components {
* @default false
*/
deferred?: boolean;
/** Description */
description?: string;
elements_from?: components["schemas"]["ElementsFromType"];
/**
* Ext
Expand Down Expand Up @@ -3952,6 +3956,8 @@ export interface components {
* @default false
*/
deferred?: boolean;
/** Description */
description?: string;
elements_from?: components["schemas"]["ElementsFromType"];
/**
* Ext
Expand Down Expand Up @@ -6457,6 +6463,8 @@ export interface components {
* @default false
*/
deferred?: boolean;
/** Description */
description?: string;
/** Elements */
elements: (
| (
Expand Down Expand Up @@ -7074,6 +7082,8 @@ export interface components {
* @default false
*/
deferred?: boolean;
/** Description */
description?: string;
elements_from?: components["schemas"]["ElementsFromType"];
/**
* Ext
Expand Down Expand Up @@ -7135,6 +7145,8 @@ export interface components {
* @default false
*/
deferred?: boolean;
/** Description */
description?: string;
elements_from?: components["schemas"]["ElementsFromType"];
/**
* Ext
Expand Down Expand Up @@ -7497,6 +7509,8 @@ export interface components {
* @default false
*/
deferred?: boolean;
/** Description */
description?: string;
elements_from?: components["schemas"]["ElementsFromType"];
/**
* Ext
Expand Down Expand Up @@ -8384,6 +8398,8 @@ export interface components {
* @default false
*/
deferred?: boolean;
/** Description */
description?: string;
elements_from?: components["schemas"]["ElementsFromType"];
/**
* Ext
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/schema/fetch_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 34 additions & 1 deletion test/unit/webapps/api/test_fetch_schema.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from copy import deepcopy
from json import dumps

import yaml

from galaxy.schema.fetch_data import (
FetchDataPayload,
FileDataElement,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

0 comments on commit 98dc9c9

Please sign in to comment.