From 49d06524d11c2c883bea1b96ab461869d77e5c80 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 12 Dec 2025 17:45:56 +0100 Subject: [PATCH 1/4] Copy collection columns wherever we construct new DCEs --- lib/galaxy/model/__init__.py | 1 + lib/galaxy/model/deferred.py | 1 + lib/galaxy/model/dereference.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index ae97484c7a7..c63830bb7f9 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -8162,6 +8162,7 @@ class DatasetCollectionElement(Base, Dictifiable, Serializable): collection=collection, element_index=self.element_index, element_identifier=self.element_identifier, + columns=self.columns, ) return new_element diff --git a/lib/galaxy/model/deferred.py b/lib/galaxy/model/deferred.py index dd6b461154f..17f658a56c1 100644 --- a/lib/galaxy/model/deferred.py +++ b/lib/galaxy/model/deferred.py @@ -372,6 +372,7 @@ def _materialize_collection_element( element=materialized_object, element_index=element.element_index, element_identifier=element.element_identifier, + columns=element.columns, ) return materialized_element diff --git a/lib/galaxy/model/dereference.py b/lib/galaxy/model/dereference.py index ae76eb0ac10..c229dfe4c84 100644 --- a/lib/galaxy/model/dereference.py +++ b/lib/galaxy/model/dereference.py @@ -105,6 +105,7 @@ def derefence_collection_element( element=child_dataset_collection, element_identifier=element.identifier, element_index=element_index, + columns=element.columns, ) sa_session.add(child_dataset_collection) for index, child_element in enumerate(element.elements): @@ -135,6 +136,7 @@ def dereference_collection_dataset_element( element=hda, element_identifier=element.identifier, element_index=element_index, + columns=element.columns, ) parent_dataset_collection.elements.append(dce) From 4cf30031158882100f8f10c9ebb3ef852a11dfff Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Fri, 12 Dec 2025 22:07:19 +0500 Subject: [PATCH 2/4] [25.1] Update release notes with config changes Needed a rerun of this before I merged the release notes. --- doc/source/releases/25.1_announce.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/source/releases/25.1_announce.rst b/doc/source/releases/25.1_announce.rst index 714ec761e5d..a44c8211c12 100644 --- a/doc/source/releases/25.1_announce.rst +++ b/doc/source/releases/25.1_announce.rst @@ -45,7 +45,12 @@ The following configuration options are new config/galaxy.yml.sample:galaxy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- mapping.tool_shed.mapping.allow_local_account_creation +- mapping.galaxy.mapping.allow_local_account_creation +- mapping.galaxy.mapping.citation_bibtex +- mapping.galaxy.mapping.disable_local_accounts +- mapping.galaxy.mapping.enable_tool_generated_tours +- mapping.galaxy.mapping.oidc_auth_pipeline +- mapping.galaxy.mapping.oidc_auth_pipeline_extra Removed @@ -56,7 +61,8 @@ The following configuration options have been completely removed config/galaxy.yml.sample:galaxy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- mapping.tool_shed.mapping.allow_user_creation +- mapping.galaxy.mapping.allow_user_creation +- mapping.galaxy.mapping.enable_tool_document_cache Deprecation Notices From 2534c3e9ebf18c0203fc89a75ec0474e0dfafac3 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 12 Dec 2025 18:47:01 +0100 Subject: [PATCH 3/4] Add test for copying sample sheet --- lib/galaxy/model/dereference.py | 2 - .../api/test_dataset_collections.py | 67 +++++++++++++++++++ lib/galaxy_test/base/populators.py | 14 ++++ 3 files changed, 81 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/model/dereference.py b/lib/galaxy/model/dereference.py index c229dfe4c84..ae76eb0ac10 100644 --- a/lib/galaxy/model/dereference.py +++ b/lib/galaxy/model/dereference.py @@ -105,7 +105,6 @@ def derefence_collection_element( element=child_dataset_collection, element_identifier=element.identifier, element_index=element_index, - columns=element.columns, ) sa_session.add(child_dataset_collection) for index, child_element in enumerate(element.elements): @@ -136,7 +135,6 @@ def dereference_collection_dataset_element( element=hda, element_identifier=element.identifier, element_index=element_index, - columns=element.columns, ) parent_dataset_collection.elements.append(dce) diff --git a/lib/galaxy_test/api/test_dataset_collections.py b/lib/galaxy_test/api/test_dataset_collections.py index c2e0797784c..ce9b02c64e6 100644 --- a/lib/galaxy_test/api/test_dataset_collections.py +++ b/lib/galaxy_test/api/test_dataset_collections.py @@ -508,6 +508,73 @@ class TestDatasetCollectionsApi(ApiTestCase): ], f"Expected [3, 'control'], got {output_elements[2]['columns']}" assert output_elements[2]["element_identifier"] == "sample3" + def test_copy_sample_sheet_collection(self, history_id): + """Test that copying a sample sheet collection preserves columns metadata.""" + # Create a sample sheet collection with columns metadata + contents = [ + ("sample1", "content1"), + ("sample2", "content2"), + ] + sample_sheet_identifiers = self.dataset_collection_populator.list_identifiers(history_id, contents) + payload = dict( + name="original sample sheet", + instance_type="history", + history_id=history_id, + element_identifiers=sample_sheet_identifiers, + collection_type="sample_sheet", + column_definitions=[ + {"type": "int", "name": "replicate", "optional": False}, + {"type": "string", "name": "condition", "optional": False}, + ], + rows={ + "sample1": [1, "control"], + "sample2": [2, "treatment"], + }, + ) + create_response = self._post("dataset_collections", payload, json=True) + original_collection = self._check_create_response(create_response) + original_hdca_id = original_collection["id"] + + # Verify the original sample sheet has columns metadata + original_elements = original_collection["elements"] + assert len(original_elements) == 2 + assert original_elements[0]["columns"] == [1, "control"] + assert original_elements[1]["columns"] == [2, "treatment"] + + # Copy the collection using the new copy_collection method + copy_response = self.dataset_collection_populator.copy_collection( + history_id, original_hdca_id, copy_elements=True, wait=False + ) + copied_collection = copy_response.json() + + # Fetch the full details of the copied collection + copied_collection_details = self.dataset_populator.get_history_collection_details( + history_id, content_id=copied_collection["id"] + ) + + # Verify the copied collection has the same columns metadata + copied_elements = copied_collection_details["elements"] + assert len(copied_elements) == 2, f"Expected 2 elements, got {len(copied_elements)}" + + # Check that columns metadata was preserved for each element + self._assert_has_keys(copied_elements[0], "columns") + assert copied_elements[0]["columns"] == [ + 1, + "control", + ], f"Expected [1, 'control'], got {copied_elements[0]['columns']}" + assert copied_elements[0]["element_identifier"] == "sample1" + + self._assert_has_keys(copied_elements[1], "columns") + assert copied_elements[1]["columns"] == [ + 2, + "treatment", + ], f"Expected [2, 'treatment'], got {copied_elements[1]['columns']}" + assert copied_elements[1]["element_identifier"] == "sample2" + + # Verify column definitions are preserved + assert copied_collection_details["column_definitions"] == original_collection["column_definitions"] + assert copied_collection_details["collection_type"] == "sample_sheet" + def test_workbook_download(self): xlsx_file = self.dataset_collection_populator.download_workbook( "sample_sheet", diff --git a/lib/galaxy_test/base/populators.py b/lib/galaxy_test/base/populators.py index ef01abad9fa..40fa81de2a9 100644 --- a/lib/galaxy_test/base/populators.py +++ b/lib/galaxy_test/base/populators.py @@ -3401,6 +3401,20 @@ class BaseDatasetCollectionPopulator: payload = self.create_list_payload(history_id, instance_type="history", **kwds) return self.__create(payload, wait=wait) + def copy_collection(self, history_id: str, hdca_id: str, copy_elements: bool = True, wait: bool = False): + """Copy an existing dataset collection to a history.""" + payload = { + "source": "hdca", + "content": hdca_id, + "type": "dataset_collection", + "copy_elements": copy_elements, + } + copy_response = self.dataset_populator._post( + f"histories/{history_id}/contents/dataset_collections", payload, json=True + ) + api_asserts.assert_status_code_is_ok(copy_response) + return copy_response + def upload_collection(self, history_id: str, collection_type, elements, wait: bool = False, **kwds): payload = self.__create_payload_fetch(history_id, collection_type, contents=elements, **kwds) return self.__create(payload, wait=wait) From 212e18d3d7a88b3846a64198a3937f19e510e12c Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Sat, 13 Dec 2025 08:36:44 +0500 Subject: [PATCH 4/4] [25.1] Fix 25.1 release month Seems like the `galaxy-release-util` script would only update the release month on the `yy.n_announce` notes, not the user facing ones. --- doc/source/releases/25.1_announce_user.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/releases/25.1_announce_user.rst b/doc/source/releases/25.1_announce_user.rst index fec3e5865e0..baad154d2ea 100644 --- a/doc/source/releases/25.1_announce_user.rst +++ b/doc/source/releases/25.1_announce_user.rst @@ -1,6 +1,6 @@ =========================================================== -25.1 Galaxy Release (October 2025) +25.1 Galaxy Release (December 2025) =========================================================== .. include:: _header.rst