New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[23.1] Remove more flushes in database operation tools #16875
[23.1] Remove more flushes in database operation tools #16875
Conversation
e59c56b
to
3dbbc49
Compare
We sort of rely on the dataset not being flushed yet in order to bypass the security check for tagging post job actions, so this fixes: ``` ItemOwnershipException: User does not own item. File "galaxy/workflow/run.py", line 233, in invoke incomplete_or_none = self._invoke_step(workflow_invocation_step) File "galaxy/workflow/run.py", line 309, in _invoke_step incomplete_or_none = invocation_step.workflow_step.module.execute( File "galaxy/workflow/modules.py", line 2274, in execute workflow_invocation_uuid=invocation.uuid.hex, File "galaxy/tools/execute.py", line 169, in execute execute_single_job(execution_slice, completed_jobs[i], skip=skip) File "galaxy/tools/execute.py", line 116, in execute_single_job job, result = tool.handle_single_execution( File "galaxy/tools/__init__.py", line 1957, in handle_single_execution execution_cache=execution_cache, File "galaxy/tools/__init__.py", line 1937, in handle_single_execution execution_slice, File "galaxy/tools/__init__.py", line 2034, in execute args[key] = model.User.expand_user_properties(trans.user, param.value) File "galaxy/tools/actions/model_operations.py", line 102, in execute job_callback(job) File "galaxy/workflow/modules.py", line 2284, in <lambda> complete = True File "galaxy/workflow/modules.py", line 2351, in _handle_post_job_actions self.trans.sa_session.add(pjaa) File "galaxy/job_execution/actions/post.py", line 575, in execute ActionBox.actions[pja.action_type].execute( File "galaxy/job_execution/actions/post.py", line 473, in execute cls._execute(tag_handler, job.user, dataset_assoc.dataset, tags) File "galaxy/job_execution/actions/post.py", line 481, in _execute tag_handler.add_tags_from_list(user, output, tags, flush=False) File "galaxy/model/tags.py", line 74, in add_tags_from_list return self.set_tags_from_list(user, item, new_tags_set, flush=flush) File "galaxy/model/tags.py", line 92, in set_tags_from_list self.delete_item_tags(user, item) File "galaxy/model/tags.py", line 165, in delete_item_tags self._ensure_user_owns_item(user, item) File "galaxy/model/tags.py", line 193, in _ensure_user_owns_item raise ItemOwnershipException("User does not own item.") ``` (once again). From https://sentry.galaxyproject.org/share/issue/5b44d1ec20094a2ebe8331b1ef6e58a8/
3dbbc49
to
f979572
Compare
@@ -5721,7 +5721,7 @@ def to_history_dataset_association(self, target_history, parent_id=None, add_to_ | |||
sa_session.commit() | |||
return hda | |||
|
|||
def copy(self, parent_id=None, target_folder=None): | |||
def copy(self, parent_id=None, target_folder=None, flush=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, commit depending on the value of flush
? (there are 2 unconditional commits at the end of the method)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They can't be eliminated, but the point is to have a uniform interface for the copy method
We sort of rely on the dataset not being flushed yet in order to bypass the security check for tagging post job actions, so this fixes:
(once again).
From https://sentry.galaxyproject.org/share/issue/5b44d1ec20094a2ebe8331b1ef6e58a8/
(Please replace this header with a description of your pull request. Please include BOTH what you did and why you made the changes. The "why" may simply be citing a relevant Galaxy issue.)
(If fixing a bug, please add any relevant error or traceback)
(For UI components, it is recommended to include screenshots or screencasts)
How to test the changes?
(Select all options that apply)
License