Skip to content

Commit

Permalink
Add missing hashes field to HDADetailed
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Mar 20, 2024
1 parent 25563b7 commit 68a030c
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
46 changes: 46 additions & 0 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3676,6 +3676,11 @@ export interface components {
* @description TODO
*/
genome_build?: string | null;
/**
* Hashes
* @description The list of hashes associated with this dataset.
*/
hashes?: components["schemas"]["DatasetHash"][] | null;
/**
* HDA or LDDA
* @description Whether this dataset belongs to a history (HDA) or a library (LDDA).
Expand Down Expand Up @@ -4318,6 +4323,36 @@ export interface components {
* @description A list of extra files associated with a dataset.
*/
DatasetExtraFiles: components["schemas"]["ExtraFileEntry"][];
/** DatasetHash */
DatasetHash: {
/**
* Extra Files Path
* @description The path to the extra files used to generate the hash.
*/
extra_files_path?: string | null;
/**
* Hash Function
* @description The hash function used to generate the hash.
*/
hash_function: components["schemas"]["HashFunctionNames"];
/**
* Hash Value
* @description The hash value.
*/
hash_value: string;
/**
* ID
* @description Encoded ID of the dataset hash.
* @example 0123456789ABCDEF
*/
id: string;
/**
* Model class
* @description The name of the database model class.
* @constant
*/
model_class: "DatasetHash";
};
/**
* DatasetInheritanceChain
* @default []
Expand Down Expand Up @@ -5924,6 +5959,11 @@ export interface components {
* @default ?
*/
genome_build?: string | null;
/**
* Hashes
* @description The list of hashes associated with this dataset.
*/
hashes: components["schemas"]["DatasetHash"][];
/**
* HDA or LDDA
* @description Whether this dataset belongs to a history (HDA) or a library (LDDA).
Expand Down Expand Up @@ -6571,6 +6611,12 @@ export interface components {
* @enum {string}
*/
HashFunctionNameEnum: "MD5" | "SHA-1" | "SHA-256" | "SHA-512";
/**
* HashFunctionNames
* @description Hash function names that can be used to generate checksums for datasets.
* @enum {string}
*/
HashFunctionNames: "MD5" | "SHA-1" | "SHA-256" | "SHA-512";
/** HdaDestination */
HdaDestination: {
/**
Expand Down
41 changes: 41 additions & 0 deletions lib/galaxy/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ class DatasetCollectionPopulatedState(str, Enum):
FAILED = "failed" # some problem populating state, won't be populated


class HashFunctionNames(str, Enum):
"""Hash function names that can be used to generate checksums for datasets."""

md5 = "MD5"
sha1 = "SHA-1"
sha256 = "SHA-256"
sha512 = "SHA-512"


# Generic and common Field annotations that can be reused across models

RelativeUrlField = Annotated[
Expand Down Expand Up @@ -699,6 +708,30 @@ class DatasetValidatedState(str, Enum):
OK = "ok"


class DatasetHash(Model):
model_class: Literal["DatasetHash"] = ModelClassField(Literal["DatasetHash"])
id: EncodedDatabaseIdField = Field(
...,
title="ID",
description="Encoded ID of the dataset hash.",
)
hash_function: HashFunctionNames = Field(
...,
title="Hash Function",
description="The hash function used to generate the hash.",
)
hash_value: str = Field(
...,
title="Hash Value",
description="The hash value.",
)
extra_files_path: Optional[str] = Field(
None,
title="Extra Files Path",
description="The path to the extra files used to generate the hash.",
)


class HDADetailed(HDASummary, WithModelClass):
"""History Dataset Association detailed information."""

Expand Down Expand Up @@ -834,6 +867,14 @@ class HDADetailed(HDASummary, WithModelClass):
title="Created from basename",
description="The basename of the output that produced this dataset.", # TODO: is that correct?
)
hashes: Annotated[
List[DatasetHash],
Field(
...,
title="Hashes",
description="The list of hashes associated with this dataset.",
),
]


class HDAExtended(HDADetailed):
Expand Down

0 comments on commit 68a030c

Please sign in to comment.