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

TPV dry-run: mock tool has None as version #115

Open
kysrpex opened this issue Oct 2, 2023 · 7 comments
Open

TPV dry-run: mock tool has None as version #115

kysrpex opened this issue Oct 2, 2023 · 7 comments

Comments

@kysrpex
Copy link
Contributor

kysrpex commented Oct 2, 2023

tool.version is None for the mock tool. Therefore, running TPV dry-run with rules using version helpers such as helpers.tool_version_gte causes it to crash (example here, rule causing the crash here).

In general I think it would be a good idea to have a second look on the mock objects that power the dry-run to make sure that no other similar issues are lurking in the code.

@cat-bro
Copy link
Collaborator

cat-bro commented Oct 2, 2023

Hi @kysrpex , what is the call to dry run that is resulting in this error? The mock tool version defaults to None but should be set here https://github.com/galaxyproject/total-perspective-vortex/blob/main/tpv/commands/dryrunner.py#L34.

@kysrpex
Copy link
Contributor Author

kysrpex commented Oct 2, 2023

Hi @kysrpex , what is the call to dry run that is resulting in this error? The mock tool version defaults to None but should be set here https://github.com/galaxyproject/total-perspective-vortex/blob/main/tpv/commands/dryrunner.py#L34.

For interactive tools, such as interactive_tool_divand, '/' in tool does not hold.

@cat-bro
Copy link
Collaborator

cat-bro commented Oct 2, 2023

It wouldn't work for interactive tools and 200+ built in tools. What version are you trying to compare in this case? And what would a sensible default for tool.version be if not None?

For any of the interactive or built in tools on Galaxy Australia version comparison would not make sense, and we are not adding this to our rules for those tools. If there is a counterexample, the dryrunner code needs updating.

@kysrpex
Copy link
Contributor Author

kysrpex commented Oct 2, 2023

what would a sensible default for tool.version be if not None

This is the big question. I have no answer neither do I have a real use-case for this. I just wanted to raise awareness that this problem may occur and if we come up with a sensible default then we can discuss it here. This is no longer an issue for us anyway.

@nuwang
Copy link
Member

nuwang commented Oct 2, 2023

The reasonable behaviour sounds like returning False if version is None?

@cat-bro
Copy link
Collaborator

cat-bro commented Oct 2, 2023

@nuwang I think in this case, raising an exception in the case that a tool being put up for version comparison not having a version makes sense. Anything else just returns an arbitrary wrong answer. Why not return True if version is None?

@nuwang
Copy link
Member

nuwang commented Oct 3, 2023

@cat-bro You're right. I forgot that there were other methods like lte, eq etc.

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

No branches or pull requests

3 participants