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

Tool tags do not work? #19264

Open
jmchilton opened this issue Dec 5, 2024 · 2 comments
Open

Tool tags do not work? #19264

jmchilton opened this issue Dec 5, 2024 · 2 comments

Comments

@jmchilton
Copy link
Member

In release_24.2 if I set enable_tool_tags to True in galaxy.yml and then add a tags attribute to a tool_conf file entry I get the following stack trace and the tool does not load.

galaxy.tool_util.toolbox.base ERROR 2024-12-05 12:58:08,174 [pN:main.1,p:24476,tN:Thread-2 (run_postfork)] Error reading tool from path: export_remote.xml
Traceback (most recent call last):
  File "/Users/jxc755/workspace/galaxy/lib/galaxy/tool_util/toolbox/base.py", line 900, in _load_tool_tag_set
    self._tool_tag_manager.handle_tags(tool.id, item.elem)
  File "/Users/jxc755/workspace/galaxy/lib/galaxy/tools/__init__.py", line 444, in handle_tags
    for tagged_tool in tag.tagged_tools:
                       ^^^^^^^^^^^^^^^^
AttributeError: 'Tag' object has no attribute 'tagged_tools'

Also tagged_tools isn't really found elsewhere in the code as far as I can tell:

% grep -r 'tagged_tools' lib/galaxy
lib/galaxy/tools/__init__.py:                    for tagged_tool in tag.tagged_tools:
%

Maybe it used to be a dynamic property setup in the model layer? Found while trying to test https://github.com/galaxyproject/galaxy/pull/19076/files but that PR clearly did not cause this issue.

@davelopez
Copy link
Contributor

After some investigation, I can confirm that in usegalaxy.eu we only use labels (and not tags) in the tool_conf file https://github.com/usegalaxy-eu/infrastructure-playbook/blob/d5ec407fd998a2945dd5a0e44e3d663068544eef/templates/galaxy/config/tool_conf.xml.j2#L36.

In addition, the tool_tag_association table has 0 rows because the enable_tool_tags config value is false.

The only trace I could find about this feature is an ancient commit from 2011 03908bc and the commit message implies it may have never been fully implemented? Or maybe it broke long ago...

What should we do here?

  • Add a relationship to the Tag model that will probably fix the issue, but at the same time also bring an undead feature back to life... 🧟
    diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py
    index 9843696f0d..250d6dfbbd 100644
    --- a/lib/galaxy/model/__init__.py
    +++ b/lib/galaxy/model/__init__.py
    @@ -10566,6 +10566,8 @@ class Tag(Base, RepresentById):
         children: Mapped[List["Tag"]] = relationship(back_populates="parent")
         parent: Mapped[Optional["Tag"]] = relationship(back_populates="children", remote_side=[id])
     
    +    tagged_tools: Mapped[List["ToolTagAssociation"]] = relationship(back_populates="tag")
    +
         def __str__(self):
             return "Tag(id=%s, type=%i, parent_id=%s, name=%s)" % (self.id, self.type or -1, self.parent_id, self.name)
  • Deprecate or completely remove the use of tags for tools. Dropping this table, models, logic, etc. since it seems tool labels might cover the general use case without all the other complexity.
  • Something else?

@jmchilton
Copy link
Member Author

ompletely remove the use of tags for tools

I would do this. I don't think this pressing but we should at some point delete the cruft left over from 03908bc and write a database migration to drop the table.

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

No branches or pull requests

2 participants