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

Syntax for conditionally loading toolbox items. #18004

Conversation

jmchilton
Copy link
Member

Alternative to #17998. I've always been annoyed by this message in my local dev logs - seems to be a better fix? The syntax only allows one thing right now but can be parameterized in the future in obvious ways if we decide we need more conditions.

How to test the changes?

(Select all options that apply)

  • Instructions for manual testing are as follows:
    1. Disable interactive tools, load the sample tool conf GALAXY_RUN_WITH_TEST_TOOLS=1 sh run.sh and verify the error message disappears.

License

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

@@ -408,6 +408,12 @@ def load_item(
panel_dict = self._tool_panel
if integrated_panel_dict is None:
integrated_panel_dict = self._integrated_tool_panel
load_if = item.get("if")
if load_if == "interactivetools_enable":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to duplicate in the tool conf the info provided by tool_type="interactive" in the tool, not sure I like it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get why you feel that way but I disagree. I feel like the toolbox says this is what should be loaded and it should be an error if you are attempting to load something that isn't configured properly. It only feels like duplicated information because we aren't serious enough about tool errors - we just ignore stuff and keep going with loading the tool panel.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you would suggest Galaxy should not start if a tool doesn't load correctly, so "just ignore stuff and keep going with loading the tool panel" seems the right approach to me.
We could present the tool load failure errors in the admin UI instead of keeping them in the logs, but that's another discussion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is what we do for every other configuration error - it is what an application should do if it is misconfigured IMO. I'm closing this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but these are user plugins .. say ITs are on the tool shed one day (nothing is actually stopping a "rogue" actor from uploading ITs). If an admin installs a tool and restarts the server it won't restart. That is a heavy price to pay for forcing that the application config is correct.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're never going to load all user defined tools into a toolbox like this and these are admin configured tools. The file I updated in this PR is literally hand crafted.

@jmchilton jmchilton closed this Apr 18, 2024
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.

3 participants