diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index 9abd677c7b27..1577170c9663 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -5704,6 +5704,11 @@ export interface components { * @description TODO */ api_type?: "file" | null; + /** + * Copied From History Dataset Association Id + * @description ID of HDA this HDA was copied from. + */ + copied_from_history_dataset_association_id?: string | null; /** Copied From Ldda Id */ copied_from_ldda_id?: string | null; /** @@ -5948,6 +5953,11 @@ export interface components { * @enum {string} */ api_type?: "file"; + /** + * Copied From History Dataset Association Id + * @description ID of HDA this HDA was copied from. + */ + copied_from_history_dataset_association_id?: string | null; /** Copied From Ldda Id */ copied_from_ldda_id?: string | null; /** diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 570008c7c64b..d1f50b945c28 100644 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -2880,7 +2880,9 @@ def exec_after_process(self, app, inp_data, out_data, param_dict, job=None, **kw # if change_datatype PJA is associated with expression tool output the new output already has # the desired datatype, so we use it. If the extension is "data" there's no change_dataset PJA and # we want to use the existing extension. - new_ext = output.extension if output.extension != "data" else copy_object.extension + new_ext = ( + output.extension if output.extension not in ("data", "expression.json") else copy_object.extension + ) require_metadata_regeneration = copy_object.extension != new_ext output.copy_from(copy_object, include_metadata=not require_metadata_regeneration) output.extension = new_ext @@ -2895,8 +2897,12 @@ def exec_after_process(self, app, inp_data, out_data, param_dict, job=None, **kw else: # TODO: move exec_after_process into metadata script so this doesn't run on the headnode ? output.init_meta() - output.set_meta() - output.set_metadata_success_state() + try: + output.set_meta() + output.set_metadata_success_state() + except Exception: + output.state = model.HistoryDatasetAssociation.states.FAILED_METADATA + log.exception("Exception occured while setting metdata") def parse_environment_variables(self, tool_source): """Setup environment variable for inputs file.""" diff --git a/test/unit/app/managers/test_HDAManager.py b/test/unit/app/managers/test_HDAManager.py index a868c7ce5ca3..aac4e2273c4b 100644 --- a/test/unit/app/managers/test_HDAManager.py +++ b/test/unit/app/managers/test_HDAManager.py @@ -412,7 +412,7 @@ def test_serializers(self): assert isinstance(serialized["file_size"], int) assert isinstance(serialized["nice_size"], str) # TODO: these should be tested w/copy - self.assertNullableEncodedId(serialized["copied_from_history_dataset_association_id"]) + assert isinstance(serialized["copied_from_history_dataset_association_id"], int) self.assertNullableEncodedId(serialized["copied_from_library_dataset_dataset_association_id"]) self.assertNullableBasestring(serialized["info"]) self.assertNullableBasestring(serialized["blurb"])