Skip to content

Commit

Permalink
Merge branch 'release_23.1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Nov 13, 2023
2 parents 2319bc3 + 70d4185 commit 8468162
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/datatypes/converters/tar_to_directory.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<tool id="CONVERTER_tar_to_directory" name="Convert tar to directory" version="1.0.1" profile="17.05">
<!-- Don't use tar directly so we can verify safety of results - tar -xzf '$input1'; -->
<requirements>
<requirement type="package" version="19.9">galaxy-util</requirement>
<requirement type="package" version="23.1">galaxy-util</requirement>
</requirements>
<command>
mkdir '$output1.files_path';
Expand Down
1 change: 0 additions & 1 deletion lib/galaxy/model/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,6 @@ def from_external_value(self, value, parent, path_rewriter=None):
# directory. Correct.
file_name = path_rewriter(file_name)
mf.update_from_file(file_name)
os.unlink(file_name)
value = mf.id
return value

Expand Down
10 changes: 10 additions & 0 deletions lib/galaxy/model/store/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,16 @@ def handle_dataset_object_edit(dataset_instance, dataset_attrs):
self._attach_dataset_sources(dataset_attrs["dataset"], dataset_instance)
if "id" in dataset_attrs["dataset"] and self.import_options.allow_edit:
dataset_instance.dataset.id = dataset_attrs["dataset"]["id"]
for dataset_association in dataset_instance.dataset.history_associations:
if (
dataset_association is not dataset_instance
and dataset_association.extension == dataset_instance.extension
):
dataset_association.metadata = dataset_instance.metadata
dataset_association.blurb = dataset_instance.blurb
dataset_association.peek = dataset_instance.peek
dataset_association.info = dataset_instance.info
dataset_association.tool_version = dataset_instance.tool_version
if job:
dataset_instance.dataset.job_id = job.id

Expand Down
75 changes: 75 additions & 0 deletions test/integration/test_dataset_copy_metadata_files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
from galaxy_test.api.test_workflows import RunsWorkflowFixtures
from galaxy_test.base.populators import (
DatasetPopulator,
WorkflowPopulator,
)
from galaxy_test.driver.integration_util import IntegrationTestCase


class TestDirectoryStrategyMetadataFileIntegrationTestCase(IntegrationTestCase, RunsWorkflowFixtures):
dataset_populator: DatasetPopulator
workflow_populator: WorkflowPopulator
framework_tool_and_types = True

@classmethod
def handle_galaxy_config_kwds(cls, config):
config["metadata_strategy"] = "directory"

def setUp(self):
super().setUp()
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)
self.workflow_populator = WorkflowPopulator(self.galaxy_interactor)

def test_metadata_copied_to_copied_outputs(self, history_id):
summary = self.workflow_populator.run_workflow(
"""
class: GalaxyWorkflow
label: Tests metadata copied to copied outputs
inputs:
bam_file:
type: collection
collection_type: list
outputs:
copied_bam:
outputSource: extract/output
steps:
build_list:
tool_id: __BUILD_LIST__
in:
datasets_0|input: bam_file
sleep:
tool_id: cat_data_and_sleep
tool_state:
sleep_time: 2
in:
input1:
source: build_list/output
extract:
tool_id: __EXTRACT_DATASET__
tool_state:
which:
which_dataset: first
in:
input:
source: sleep/out_file1
test_data:
bam_file:
value: 1.bam
file_type: bam
type: File
""",
history_id=history_id,
wait=True,
assert_ok=True,
)
invocation = self.workflow_populator.get_invocation(summary.invocation_id, step_details=True)
copied_bam = invocation["outputs"]["copied_bam"]
dataset = self.dataset_populator.get_history_dataset_details(history_id, content_id=copied_bam["id"])
assert dataset["peek"] == "Binary bam alignments file"
assert len(dataset["meta_files"]) == 1


class TestExtendedMetadataStrategyMetadataFileIntegrationTestCase(TestDirectoryStrategyMetadataFileIntegrationTestCase):
@classmethod
def handle_galaxy_config_kwds(cls, config):
config["metadata_strategy"] = "directory"

0 comments on commit 8468162

Please sign in to comment.