Skip to content

Commit

Permalink
Fix datatype validation of newly built collection
Browse files Browse the repository at this point in the history
We only request the summary view when polling the history for updates,
so we don't serialize elements_datatypes, which is used to make sure
that the dragged element is of the correct datatype.

This probably fixes https://sentry.galaxyproject.org/share/issue/790be09602694a638d66257004325163/:
```
Message
(60007760) Failure preparing job
Stack Trace

Newest

NotFound: cannot find 'ext'
  File "galaxy/util/template.py", line 87, in fill_template
    return unicodify(t, log_exception=False)
  File "galaxy/util/__init__.py", line 1183, in unicodify
    value = str(value)
  File "Cheetah/Template.py", line 1053, in __unicode__
    return getattr(self, mainMethName)()
  File "cheetah_DynamicallyCompiledCheetahTemplate_1724455756_31925_91921.py", line 102, in respond
```

where a user provided a collection of HTML elements into a fasta/fastq
input. This is the only way I can think of where the validation would
fail.
  • Loading branch information
mvdbeek committed Aug 26, 2024
1 parent 0bc1a46 commit 4edaab3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6580,6 +6580,11 @@ export interface components {
* @description The number of elements contained in the dataset collection. It may be None or undefined if the collection could not be populated.
*/
element_count?: number | null;
/**
* Elements Datatypes
* @description A set containing all the different element datatypes in the collection.
*/
elements_datatypes: string[];
/**
* HID
* @description The index position of this item in the History.
Expand Down
6 changes: 3 additions & 3 deletions lib/galaxy/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,9 @@ class HDCASummary(HDCACommon, WithModelClass):
populated_state: DatasetCollectionPopulatedState = PopulatedStateField
populated_state_message: Optional[str] = PopulatedStateMessageField
element_count: ElementCountField
elements_datatypes: Set[str] = Field(
..., description="A set containing all the different element datatypes in the collection."
)
job_source_id: Optional[EncodedDatabaseIdField] = Field(
None,
title="Job Source ID",
Expand All @@ -1128,9 +1131,6 @@ class HDCADetailed(HDCASummary):

populated: PopulatedField
elements: List[DCESummary] = ElementsField
elements_datatypes: Set[str] = Field(
..., description="A set containing all the different element datatypes in the collection."
)
implicit_collection_jobs_id: Optional[EncodedDatabaseIdField] = Field(
None,
description="Encoded ID for the ICJ object describing the collection of jobs corresponding to this collection",
Expand Down

0 comments on commit 4edaab3

Please sign in to comment.