-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Allow rerunning of workflow invocations #13534
base: dev
Are you sure you want to change the base?
Conversation
@expose_api_raw_anonymous_and_sessionless | ||
def invocation_build_for_rerun(self, trans: GalaxyWebTransaction, invocation_id, **kwd): | ||
""" | ||
GET /api/invocations/{encoded_invocation_id}/build_for_rerun | ||
|
||
Returns a workflow file formatted according to the 'run' export style, prepopulated with | ||
inputs and parameters from a previous invocation. Note the result is heavily tied to the UI | ||
(e.g. which history is currently being used). | ||
|
||
:type history_id: encoded history ID. If not supplied, defaults to current history. | ||
:param history_id: str | ||
""" | ||
|
||
decoded_workflow_invocation_id = self.decode_id(invocation_id) | ||
workflow_invocation = self.workflow_manager.get_invocation(trans, decoded_workflow_invocation_id, eager=True) | ||
if not workflow_invocation: | ||
return None | ||
|
||
workflow = workflow_invocation.workflow | ||
|
||
history_id = kwd.get("history_id") | ||
history = None | ||
if history_id: | ||
history = self.history_manager.get_accessible( | ||
self.decode_id(history_id), trans.user, current_history=trans.history | ||
) | ||
ret_dict = self.workflow_contents_manager._workflow_to_dict_run( | ||
trans, | ||
workflow.stored_workflow, | ||
workflow, | ||
history=history or trans.history, | ||
invocation=workflow_invocation, | ||
) | ||
return format_return_as_json(ret_dict, pretty=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.
IMO we shouldn't add an API endpoint here, this can and should use the existing API.
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.
This should be possible without backend changes. We can fetch all parameters via the invocations API.
Hm, ok. The front-end expects the form parameters to be submitted in a certain way, I assume you are not suggesting changing that. So the process of patching the workflow |
The contents of services.js should only be responsible for fetching things from the API. How I would do this is to add an additional |
Nice! +1 to Marius's suggestions, but this is going to be nice! |
ac8e746
to
59ce23f
Compare
Implements #11340.
So far I just have a basic API test; should I try to write a selenium test as well?
How to test the changes?
(Select all options that apply)
License