-
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
Fixing data_source tools and incrementing tool profile #17515
Conversation
f2c1dac
to
a0b27e4
Compare
Ah, the sanitization issue is solved by using a tool-wide That leaves only the multiple translator calls. |
and make params check more stringent
like in data_source_async tools
Since the code now drops undeclared incoming parameters it enforces cleaner wrapper style.
Ok, so once more I'm happy with my changes and think they are ready for reviewing. |
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.
Thank you @wm75! Looks good to me!
this commit is breaking any tool that relies on undeclared params, which I suspect could be a pattern that is actually used? I am a bit wary about doing that. |
Was so too, that's why I didn't touch this in my prior PR. However, out of the built-in data source tools only the UCSC ones seem to work currently and I checked and updated these to still work after the change. |
Even if easy to fix, breaking tools is something Galaxy works hard to avoid. We have tool profiles to mitigate that, maybe we could consider applying it here. |
as suggested by @martenson
That's a very good idea, thanks! Implemented it in the latest commit. |
The one failing test appears to be unrelated again :-) |
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.
Looks good to me too! OK to merge?
Thanks @wm75 ! I believe this PR should be manually tested on Main for the release. I added the item to the PR description. |
Still discovering a few quirks with data_source and data_source_async tools after #17422
currently, these tools have to set
check_values="false"
in their<inputs>
tag.Forgetting to do this leads to hard to debug problems, because the default is
"true"
, while this can never make sense for any data_source tool. The proposed solution is to overwrite the setting for the tool class.currently, translation of input params is requested in several places in the code base, i.e., at the controllers level here:
galaxy/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
Lines 86 to 87 in 2a9c8d0
galaxy/lib/galaxy/webapps/galaxy/controllers/async.py
Lines 83 to 84 in 2a9c8d0
and at the tool level, here:
galaxy/lib/galaxy/tools/__init__.py
Lines 1834 to 1835 in 2a9c8d0
galaxy/lib/galaxy/tools/__init__.py
Lines 2502 to 2503 in 2a9c8d0
The controller-level translations are required, but repeated translations at the tool level can break data_source tools.
In particular, URL append operations are broken because the same params get added to the URL twice.
That's why I'd like to disable the tool-level translations, but I'm worried that this could have side-effects, and really would like feedback first. We could play it safe and disable extra translations only for data_source tools with sth like:
if self.input_translator and not isinstance(self, DataSourceTool):
just in case input translation has some exotic undocumented use outside data_source tools?- [ ] I need help with an additional bug with this usage pattern where an ampersand is used to join GET request parameters. Unfortunately, that char gets sanitized by Galaxy (to an X by default), but I fail to understand where that happens@mvdbeek maybe you can help me with the open points? 🙏
How to test the changes?
(Select all options that apply)
License