Commit Graph
15827 Commits
Author SHA1 Message Date
John Chilton 482e0ce0fa Introduce ToolPanel abtraction.
There are some repeated operations on an odict in Toolbox that could be cleaned up (fewer lines of code, more readable) with new abstraction in place. Starting with __add_tool_to_tool_panel but will work its way to other methods in Toolbox eventually.

Abstraction reduces cyclomatic complexity of Toolbox.__add_tool_to_tool_panel from 23 down to 18.
2014-12-31 18:21:10 -05:00
John Chilton 7e45ca2a72 Allow multiple tools with the same id in ToolBox.
How to use:

 1.) Place multiple tools with different IDs in your tool conf.
 2.) ... ummm ... no step 2 - just use the tools.

Implementation:

The Tool Shed allows tool lineages by assigning each tool version a GUID and tracking versions in a database. This
implementation works by simply allowing the ToolBox to contain multiple tools with the same ID and orders them by the version specified by the tool author.

To track enable this a second tool lineage has been introduced that just uses tool versions instead of a database (non-toolshed installed tools are not longer placed into the Tool Shed install database). The ToolBox has been updated to allow multiple versions per tool id (defaulting to the 'latest' version for all operations which do not specify a version). Both jobs and workflow steps would track tool versions but did not use that version when fetching tools from the Toolbox - these components have been updated to try to use the tool version.

Unit tests working through most of the ToolBox and tool panel have been added, as well as functional tests exercising the tools API and to ensure workflows now at least attempt to respect tool versions (still kind of silently switches versions in some cases). Manual tests against the new tool form seem to demonstrate the tool switching and tool re-running work with only minor changes to the tools API and the job handler.
2014-12-31 18:21:10 -05:00
John Chilton 5113526830 Bugfix for functional tests broken with 68daf6d. 2014-12-30 09:43:28 -05:00
John Chilton 9b5f374189 Move galaxy.tools.filters to galaxy.tools.toolbox.filters.
Leave empty module in galaxy.tools.filters and modify config to ensure backward compatibility (filters in this old directory will continue to work for now).

Update config/galaxy.ini.sample with more discussion of ToolBox filter.
2014-12-29 23:07:01 -05:00
John Chilton f14368db13 Remove lib/galaxy/tools/filters/examples.py likely incorrectly added in d816d66. 2014-12-29 23:07:01 -05:00
John Chilton 66625dfc69 Move galaxy.tools.watcher into galaxy.tools.toolbox.watcher. 2014-12-29 23:07:01 -05:00
John Chilton aad51263f0 Various ToolBox filtering improvements and tests.
- Allow overriding the base module location for ToolBox filters (needed for OS packages, etc...).
 - Allow scanning multiple base modules for filters.
 - Unit tests for module loading functionality, custom tool, label, and section filters, default hidden and require_login filters.
2014-12-29 23:07:01 -05:00
John Chilton 11b75eb938 Override ToolSectionLabel.to_dict so don't need to_dict_helper.
I feel this is cleaner and it makes ToolSection and ToolSectionLabel easier to move into a new module.
2014-12-29 23:07:01 -05:00
John Chilton 12bcd0ec33 Bugfix for 267fa4b when tool tags are enabled.
Thanks to JJ for the bug report - apparently at least one person has tool tags enabled :).
2014-12-29 14:25:12 -05:00
Aysam Guerler 99963f38c1 Add classic hidden_data field to tool form 2014-12-29 14:08:35 -05:00
John Chilton e202fc1009 Hack to fix bug introduced in 806202d.
I may be trying to juggle to many competing branches working on same component.
2014-12-29 12:50:27 -05:00
John Chilton 2717c85e54 Update attribute and method names in ToolBox to reflect encapsulation efforts.
Using ToolBox._xxx instead of ToolBox.__xxx because realistically ToolBox is still much to large to grok and so I imagine it will need to be broken up even more (base class focused on just the panel details perhaps - or mixins - etc...).
2014-12-29 12:23:55 -05:00
John Chilton 0466cd9e47 Shield ToolBox details from Tool.
Better seperation of concerns.
2014-12-29 12:14:41 -05:00
John Chilton 8edced2685 Bugfix: Apply tool panel filtering in workflow editor.
Bug originally reported by Eric here - http://dev.list.galaxyproject.org/Bug-Toolbox-filters-not-applied-in-workflows-td4662879.html (though this only fixes the superficial bug of them showing up in the workflow editor - and does not yet implement "strong" toolbox filters as requested).

This is actually a broader change that centralizes logic for listing out tool panel contents when displaying components to the user and the added filtering comes about from that. It also eliminates the last places Galaxy was accessing toolbox.tool_panel directly (in those mako templates).
2014-12-29 11:48:38 -05:00
John Chilton 0e17abd7ea Fix unit tests for 7cee92f. 2014-12-29 11:10:41 -05:00
John Chilton 65e9510981 Abstract out higher-level helpers in ToolBox for lineage reasoning.
Reduces code duplication slightly and simplifies __add_tool_to_tool_panel (cyclomatic complexity reduced from 20 to 14).
2014-12-29 10:28:37 -05:00
John Chilton 3c5c2e90c6 Abstract tool lineage handling out of ToolBox.
Start work on infrastructure to support tool lineages not defined within the tool shed install model.
2014-12-29 10:28:37 -05:00
John Chilton 5809140d0e Reuse new ToolBox.dynamic_confs method other places...
... to shield ToolBox.shed_tool_confs from other components including Tool Shed install models, shed_util_common.py, and install_manager.py.

After this commit - shed_tool_confs is only accessed directly by the ToolBox itself.
2014-12-29 09:11:54 -05:00
John Chilton 3b3ef1f85f Simplifications for ToolPanelManager.get_shed_tool_conf_dict.
None of the components using this method are using the index any more - so eliminate it. Also introduce a new ToolBox method to hide the details of ToolBox.shed_tool_confs from this method.
2014-12-29 09:11:54 -05:00
John Chilton 5584ece4fa Update ToolBox.update_shed_config to use config_filename instead of index.
Seems a more robust index, simplifies ToolPanelManager, etc....
2014-12-29 09:11:54 -05:00
John Chilton 6d85189efa Update calls to ToolPanelManager.get_shed_tool_conf_dict for clarity...
... in other words to note where index in the resulting tuple is not actually used. Doing this to enable hiding this implementation detail (index) from components in subsequent commits.
2014-12-29 09:11:54 -05:00
John Chilton 056a60de81 Refactor logic for removing tools from panels into ToolBox.
May seem sort of like Tool Shed specific stuff - but I think it can be reused elsewhere down the road. Regardless of this however as of this commit no external components directly access ToolBox.tool_panel or ToolBox.integrated_tool_panel - which I think is important - these should be internal details of the ToolBox (or newer modules it leverages).
2014-12-29 09:11:54 -05:00
John Chilton ae8b88817e Reuse new ToolBox.get_section method in ToolPanelManager.
This is a higher-level method and eliminates a couple more places where Tool Shed code is directly acceessing ToolBox.tool_panel.
2014-12-29 09:11:54 -05:00
John Chilton 62927d39f6 Method to abstract away ToolBox.tool_panel from tool_util.py.
Now only thing accessing ToolBox.tool_panel outside ToolBox itself is ToolPanelManager.
2014-12-29 09:11:54 -05:00
John Chilton 3bcda4fb87 Method to abstract away ToolBox.shed_tool_confs from tool_util.py.
Start a gradual process of referring to these as dynamic tool confs instead of shed tool confs. I would like like to make them more generally Galaxy-managed tool configurations and distinguish them from deployer-managed configurations - rather then having overtly ToolShed-only logic in ToolBox.
2014-12-29 09:11:54 -05:00
John Chilton f88115ceaa PEP-8 fixes for various Tool Shed components.
- lib/tool_shed/util/tool_util.py
 - lib/tool_shed/galaxy_install/tool_migration_manager.py.
 - lib/tool_shed/util/shed_util_common.py.
 - lib/galaxy/model/tool_shed_install/__init__.py.
2014-12-29 09:11:54 -05:00
John Chilton 8206f83b96 Reused get_section method to hide ToolBox.tool_panel from install_manager.py. 2014-12-29 09:11:54 -05:00
John Chilton caaebdf9ae Small simplification to tool_panel_manager.py. 2014-12-29 09:11:54 -05:00
John Chilton 23e9a53e8a Correct sample value for migrated tool config. 2014-12-29 09:11:54 -05:00
John Chilton 7dca5cb1f6 Bugfix for 44dfa6f and typos in unit tests that caused it to go undetected. 2014-12-28 23:25:56 -05:00
John Chilton 280dc18442 De-duplication for loading elements into the tool panel.
Create one public method load_item on ToolBox that should be used externally instead of load_tool_tag_set, load_section_tag_set, etc.... This reduces the duplication within the toolbox and between the toolbox and the Tool Shed's ToolPanelManager. Probably more importantly it also is another step down the road toward hiding implementation details such as toolbox.tool_panel and toolbox.intergrated_tool_panel from the ToolPanelManager.

Already had unit test coverage for ToolPanelManager stuff here - but added test coverage for loading labels, workflows, and tool directories.
2014-12-28 11:23:44 -05:00
John Chilton 36599a16d2 Simplify shed-y logic in load_tool_tag_set.
Drops cycolomatic complexity from 14 to 10 for that method.
2014-12-28 11:23:44 -05:00
John Chilton 4068aaac92 Eliminate one reference to ToolBox.tool_panel in install_manager.py. 2014-12-28 11:23:44 -05:00
John Chilton 7af172dbda More centralization of code for registering tools in ToolBox. 2014-12-28 11:23:44 -05:00
John Chilton 9e3713da90 Tweak two ToolShed modules to clarify they don't use ToolSection...
... objects (directly anyway). I would like to refactor all the tool shed components to not deal directly with ToolSection objects but instead just pass around IDs.
2014-12-28 11:23:44 -05:00
John Chilton 9c2f32fc0d PEP-8 fixes for a few Tool Shed install components.
- lib/tool_shed/galaxy_install/install_manager.py
 - lib/tool_shed/galaxy_install/repository_dependencies/repository_dependency_manager.py
 - lib/tool_shed/galaxy_install/repair_repository_manager.py
2014-12-28 11:23:44 -05:00
John Chilton 6b6c3ac498 Fix remaining tool shed test cases for new escaped values.
I think in this case the values on the page are correct now - but the test framework needs to be updated to handle the escaped value.
2014-12-27 23:46:22 -05:00
John Chilton f515257ed8 Skip checking tool migrations for Galaxy in tool shed tests. 2014-12-27 17:49:16 -05:00
John Chilton 37f2504ac4 Add --no_cleanup option to tests. 2014-12-27 17:49:16 -05:00
John Chilton 74b233fbc8 Merge next-stable. 2014-12-27 17:35:51 -05:00
John Chilton 1f96fa9b33 Fixes for over escaping in c2bed0a.
Fixes dozens of tool functional tests.
2014-12-27 17:30:59 -05:00
John Chilton e2047635fc Merge pull request #614. 2014-12-26 17:33:02 -05:00
John Chilton 974a4c124f Introduce abstraction shielding toolbox.tools_by_id from galaxy.workflow.modules.
That was the last module outside of ToolBox itself that was accessing tools_by_id directly.
2014-12-26 09:55:27 -05:00
John Chilton 8c18def760 Eliminate direct in/get checks against toolbox.tools_by_id - use get_tool or has_tool. 2014-12-26 09:55:27 -05:00
John Chilton b2d6255a12 Remove unused method lib/galaxy/workflow/modules.py. 2014-12-26 09:55:27 -05:00
John Chilton 74a58ea2c2 Abstractions for registering tools from outside toolbox.
Part of effort to further limit exposing tools_by_id directly outside Toolbox.
2014-12-25 13:35:13 -05:00
John Chilton e455d42b61 Eliminate walking over tools_by_id externally from toolbox. 2014-12-25 13:35:13 -05:00
John Chilton ccf3794173 Centralize abstraction for removing tools from toolbox.
Shield's toolbox.tools_by_id from lib/tool_shed/galaxy_install/tools/tool_panel_manager.py.
2014-12-25 13:35:13 -05:00
John Chilton 047bfc0d3f Abstract out ToolBox internals from tool_shed.util.tool_util.
Instead of reloading upload actions at this level and exposing tools_by_id - move this logic into the ToolBox in a new method called handle_datatypes_changed().
2014-12-25 13:35:13 -05:00
John Chilton 6c385aa25a Reduce duplication/complexity in tool_panel_manager.py.
Big conditional in remove_guids switched on sectioned versus un-sectioned with very little difference in what was actually being done. This reduces the cyclomatic complexity of that method from 35 down to 26 (though it is still the most 'complex' method in that file by a wide margin).
2014-12-25 13:35:13 -05:00