-
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
[15.05] Create empty history if history is unavailable during api call #217
[15.05] Create empty history if history is unavailable during api call #217
Conversation
@@ -1657,6 +1657,8 @@ def _get_history( self, trans, history=None ): | |||
assert trans is not None, "%s requires a trans" % class_name | |||
if history is None: | |||
history = trans.get_history() | |||
if history is None: | |||
history = trans.get_history( create=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.
Instead of a second set of lines, should we just pass create=True to the invocation above?
+1 I'd second Dannon's suggestion in the line notes. |
Thanks for the tweak, but apparently this breaks the Galaxy. Digging. |
Thanks for the hint Carl. Test cases are fixed. |
Good call - the reason it passed before is that the tests simply didn't exercise the new code path. Anyway, +1 |
[15.05] Create empty history if history is unavailable during api call
I think this breaks the Tools API.
tools.show shouldn't require a history IMO - it is marked sessionless among other reasons ( |
Yeah, I agree with this. Show shouldn't require context and should just work regardless, while build obviously needs context. |
The tool build api shares the basic.py code with the old tool form. The old tool form is only called from the Galaxy UI i.e. a history is always available. In order to prevent an uncaught exception for a plain api call without a valid history, here we create an empty history on the fly. This is a temporary fix which allows users to retrieve a valid tool model if the history has not been created yet. Once the old tool form is disabled (currently composite uploads prevent us from doing that), the history id will be parsed through the api call and we will remove the concept of 'current' history from basic.py too. Until then this fix is required.