Skip to content

Commit

Permalink
Merge pull request galaxyproject#16877 from mvdbeek/fix_tag_ownership…
Browse files Browse the repository at this point in the history
…_check

[23.1] Fix tag ownership check
  • Loading branch information
mvdbeek authored Oct 18, 2023
2 parents b116321 + cd9d132 commit cdbbbbe
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/galaxy/tools/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ def _new_job_for_session(self, trans, tool, history):
job.session_id = model.cached_id(galaxy_session)
if trans.user is not None:
job.user_id = model.cached_id(trans.user)
job.user = trans.user
if history:
job.history_id = model.cached_id(history)
job.tool_id = tool.id
Expand Down
38 changes: 38 additions & 0 deletions lib/galaxy_test/api/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -5884,6 +5884,44 @@ def test_run_remove_tag_on_collection_output(self):
), details_collection_without_tag
assert len(details_collection_without_tag["tags"]) == 0, details_collection_without_tag

@skip_without_tool("collection_creates_pair")
@skip_without_tool("cat")
def test_run_add_tag_on_database_operation_output(self):
with self.dataset_populator.test_history() as history_id:
self._run_jobs(
"""
class: GalaxyWorkflow
inputs:
input1: data_collection
steps:
extrat:
tool_id: __EXTRACT_DATASET__
in:
input: input1
outputs:
output:
add_tags:
- "name:foo"
""",
test_data="""
input1:
collection_type: list
name: the_dataset_list
elements:
- identifier: el1
value: 1.fastq
type: File
""",
history_id=history_id,
round_trip_format_conversion=True,
)
details_dataset_with_tag = self.dataset_populator.get_history_dataset_details(
history_id, hid=3, wait=True, assert_ok=True
)

assert details_dataset_with_tag["history_content_type"] == "dataset", details_dataset_with_tag
assert details_dataset_with_tag["tags"][0] == "name:foo", details_dataset_with_tag

@skip_without_tool("cat1")
def test_run_with_runtime_pja(self):
workflow = self.workflow_populator.load_workflow(name="test_for_pja_runtime")
Expand Down

0 comments on commit cdbbbbe

Please sign in to comment.