galaxyproject / galaxyproject/total-perspective-vortex
raw can't be boolean in pydantic schema
- Dominant language
- Python
- Stars
- 18
- Forks
- 19
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 5
Description
This is now flagged:
```
toolshed.g2.bx.psu.edu/repos/iuc/bwa_mem2/bwa_mem2/2\.2\.1\+galaxy3:
env:
# $GALAXY_MEMORY_MB does not check to see if it's set first, but $GALAXY_MEMORY_MB_PER_SLOT does
- name: GALAXY_MEMORY_MB
value: $(printf "%.0f" $(echo "$(scontrol -do show job "$SLURM_JOB_ID" | sed 's/.*\( \|^\)Mem=\([0-9][0-9]*\)\( \|$\).*/\2/p;d')*0.4" | bc -l))
raw: true
- name: GALAXY_MEMORY_MB_PER_SLOT
value: GALAXY_MEMORY_MB_PER_SLOT=$(($GALAXY_MEMORY_MB / $GALAXY_SLOTS))
raw: true
```
The schema just says `env: Annotated[Optional[List[Dict[str, str]]], TPVFieldMetadata(complex_property=True)] = None`, should this spell out the valid fields ?
https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/jobs/runners/util/env.py#L33-L37 is the galaxy handling, so I can just make it a string for now, but someone might set the value to `"false"` and be surprised.
Contributor guide
Research direction
Start with the TPV schema declaration for env shown in the issue, then compare it with Galaxy's handling in lib/galaxy/jobs/runners/util/env.py. Determine which env fields and value types should be accepted, including the meaning of raw, and add or update validation tests so boolean values are handled consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100