galaxyproject / ephemeris

Library for managing Galaxy plugins - tools, index data, and workflows.
https://ephemeris.readthedocs.org/
Other
28 stars 38 forks source link

New section creation is broken #186

Closed natefoo closed 5 months ago

natefoo commented 1 year ago

If the section is not already in shed_tool_conf.xml, it is not properly created, and tools are installed outside of a section. The install in galaxyproject/usegalaxy-tools#567 is an example.

The tools.yaml contains tool_panel_section_label at the root both and tool_panel_section_id and tool_panel_section_label on each tool. The installation runs with:

shed-tools install --skip_install_resolver_dependencies -v -g http://127.0.0.1:8080 -a deadbeef -t cloud/datamash.yml.lock

The resulting entries in shed_tool_conf.xml are:

    <tool file="toolshed.g2.bx.psu.edu/repos/iuc/datamash_reverse/f198773344e4/datamash_reverse/datamash-reverse.xml" guid="toolshed.g2.bx.psu.edu/repos/iuc/datamash_reverse/datamash_reverse/1.1.0+galaxy2">
        <tool_shed>toolshed.g2.bx.psu.edu</tool_shed>
        <repository_name>datamash_reverse</repository_name>
        <repository_owner>iuc</repository_owner>
        <installed_changeset_revision>f198773344e4</installed_changeset_revision>
        <id>toolshed.g2.bx.psu.edu/repos/iuc/datamash_reverse/datamash_reverse/1.1.0+galaxy2</id>
        <version>1.1.0+galaxy2</version>
    </tool>
    <tool file="toolshed.g2.bx.psu.edu/repos/iuc/datamash_transpose/ac092723240d/datamash_transpose/datamash-transpose.xml" guid="toolshed.g2.bx.psu.edu/repos/iuc/datamash_transpose/datamash_transpose/1.1.0+galaxy2">
        <tool_shed>toolshed.g2.bx.psu.edu</tool_shed>
        <repository_name>datamash_transpose</repository_name>
        <repository_owner>iuc</repository_owner>
        <installed_changeset_revision>ac092723240d</installed_changeset_revision>
        <id>toolshed.g2.bx.psu.edu/repos/iuc/datamash_transpose/datamash_transpose/1.1.0+galaxy2</id>
        <version>1.1.0+galaxy2</version>
    </tool>
    <tool file="toolshed.g2.bx.psu.edu/repos/iuc/datamash_ops/746e8e4bf929/datamash_ops/datamash-ops.xml" guid="toolshed.g2.bx.psu.edu/repos/iuc/datamash_ops/datamash_ops/1.1.0+galaxy2">
        <tool_shed>toolshed.g2.bx.psu.edu</tool_shed>
        <repository_name>datamash_ops</repository_name>
        <repository_owner>iuc</repository_owner>
        <installed_changeset_revision>746e8e4bf929</installed_changeset_revision>
        <id>toolshed.g2.bx.psu.edu/repos/iuc/datamash_ops/datamash_ops/1.1.0+galaxy2</id>
        <version>1.1.0+galaxy2</version>
    </tool>
cat-bro commented 1 year ago

This issue is with the api. tool_panel_section_id and tool_panel_section_label cannot be used simulateously and if the bioblend function receives both arguments it will only send tool_panel_section_id https://github.com/galaxyproject/bioblend/blob/main/bioblend/galaxy/toolshed/__init__.py#L157.

Our workaround has been to only have tool_panel_section_label* in the yaml files and let galaxy create the ID.

natefoo commented 1 year ago

Thanks! I wondered if this was the case. Do you just manually edit the label then after installation?

cat-bro commented 1 year ago

Oops - I meant that we only use label and not id in the yaml file, I have edited my comment above.

mvdbeek commented 1 year ago

Our workaround has been to only have tool_panel_section_label* in the yaml files and let galaxy create the ID.

I've updated the logic on the ephemeris side to only send the label if both are defined: https://github.com/galaxyproject/ephemeris/pull/193/files#diff-63e70d76132455773ecf885269e463b13bb56abce4a691394ffef6ef3d52a5b9R51

natefoo commented 1 year ago

IIRC the reason we started adding the ID was for synchronization between EU, AU, and US tool panel section IDs as discussed in galaxyproject/usegalaxy-tools#9. Although we haven't ended up using a common repo (and probably won't), I've been using the algorithm in my comment here to generate new IDs, and it'd be nice to keep that.

For example, @luke-c-sargent is adding a new section in galaxyproject/usegalaxy-tools#600 and we need to drop the section ID to avoid this bug, but then Galaxy will generate the ID. In this case it's fine - QIIME2 will become qiime2, but it's a bigger issue with, for example a label like FASTA/FASTQ, which becomes fasta/fastq.

mvdbeek commented 1 year ago

I might be dense here, but I don't see how I've updated the logic on the ephemeris side to only send the label if both are defined: would be a problem, it should just work ?

that's how it is now:

    tool_panel_section_label = tool.get("tool_panel_section_label")
    if tool_panel_section_label:
        repo["tool_panel_section_label"] = tool_panel_section_label
    else:
        repo["tool_panel_section_id"] = tool.get("tool_panel_section_id")

and that's what we want, or am I missing something ?

mvdbeek commented 1 year ago

@natefoo Is the problem maybe that we just need to install from pypi again ? https://github.com/galaxyproject/usegalaxy-tools/blob/master/.ci/jenkins.sh#L26

natefoo commented 1 year ago

Yes, the new section issue should be fixed (upstream), but with the ID being ignored now, the format for new section IDs won't be correct.