Skip to content
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

Merged
merged 8 commits into from
Feb 26, 2024

Conversation

wm75
Copy link
Contributor

@wm75 wm75 commented Feb 20, 2024

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:

    if tool.input_translator:
    tool.input_translator.translate(params)
    and here:
    if tool.input_translator:
    tool.input_translator.translate(params)

    and at the tool level, here:
    if self.input_translator:
    self.input_translator.translate(expanded_incoming)
    and here:
    if self.input_translator:
    self.input_translator.translate(params)

    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)

  • Instructions for manual testing are as follows:
    1. run considerable subset (or all) data source tools on Main

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@github-actions github-actions bot added this to the 24.0 milestone Feb 20, 2024
@wm75 wm75 force-pushed the data_source_fixes2 branch from f2c1dac to a0b27e4 Compare February 21, 2024 11:05
@wm75
Copy link
Contributor Author

wm75 commented Feb 21, 2024

Ah, the sanitization issue is solved by using a tool-wide <options sanitize="False" />. Now I know why existing data_source tools include that :-)

That leaves only the multiple translator calls.

wm75 added 4 commits February 22, 2024 14:40
and make params check more stringent
Since the code now drops undeclared incoming parameters it enforces
cleaner wrapper style.
@wm75
Copy link
Contributor Author

wm75 commented Feb 22, 2024

Ok, so once more I'm happy with my changes and think they are ready for reviewing.

Copy link
Contributor

@davelopez davelopez left a 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!

@martenson
Copy link
Member

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.

@wm75
Copy link
Contributor Author

wm75 commented Feb 23, 2024

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.
Any other data source tools not shipping with Galaxy would be easy to fix.

@martenson
Copy link
Member

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.

@wm75
Copy link
Contributor Author

wm75 commented Feb 24, 2024

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.

That's a very good idea, thanks! Implemented it in the latest commit.

@wm75
Copy link
Contributor Author

wm75 commented Feb 26, 2024

The one failing test appears to be unrelated again :-)

Copy link
Member

@jdavcs jdavcs left a 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?

@martenson martenson changed the title Fixing bugs with data_source tools - part 2 Fixing data_source tools and incrementing tool profile Feb 26, 2024
@martenson martenson merged commit 3690af6 into galaxyproject:dev Feb 26, 2024
52 of 53 checks passed
@martenson
Copy link
Member

Thanks @wm75 !

I believe this PR should be manually tested on Main for the release. I added the item to the PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants