galaxyproject / galaxyproject/total-perspective-vortex

resubmit with_more_mem_on_failure fails lint

Open
#182 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
18
Forks
19
Avg merge
4d 9h
Merged PRs (30d)
5

Description

Hello

During upgrading to Galaxy 25.0/25.1 (and TPV 2.4/3.1.3) on usegalaxy.fr, the following TPV configuration fails linting:
```yaml
resubmit:
with_more_mem_on_failure:
condition: memory_limit_reached and attempt <= 3
destination: tpv_dispatcher
delay: 'attempt * 30'
````

Linting produces this error:

```bash
ERROR: tpv.commands.linter: Linting failed due to syntax errors in yaml file: 1 validation error for TPVConfig
tools.default.resubmit.with_more_mem_on_failure
Input should be a valid string [type=string_type, input_value={'condition': 'memory_lim...'delay': 'attempt * 30'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/string_type
INFO : tpv.commands.shell: lint failed.
lint failed, 'tool_defaults.yml' was not copied
```

Previously (TPV 2.4), this format worked correctly.

Locally, I patched the type hint:

```bash
# tpv/core/entities.py & tpv/commands/type_check_template.j2
# resubmit: Optional[Dict[str, str]] -> resubmit: Optional[Dict[str, Any]]
```
After this change, the format is accepted by the linter again.

Are we using the TPV incorrectly or is this a bug ?

Contributor guide

Open the contributing guide

Research direction

Reproduce the lint failure with the YAML shown, then inspect tpv/core/entities.py and tpv/commands/type_check_template.j2, where the resubmit type hint is defined. Compare the current validation with the previously working configuration and confirm the chosen fix by rerunning the TPV linter; done means this format is accepted without the reported validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.