Skip to content

auto-triage: validate genome_fasta content at schema level#1

Draft
jplfaria wants to merge 3 commits into
mainfrom
auto-triage/issue-8-validate-genome-fasta
Draft

auto-triage: validate genome_fasta content at schema level#1
jplfaria wants to merge 3 commits into
mainfrom
auto-triage/issue-8-validate-genome-fasta

Conversation

@jplfaria

@jplfaria jplfaria commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary\n\nFixes #8 in ModelSEED/modelseed-api-ops.\n\n- Root cause: genome_fasta in ReconstructionRequest accepted any truthy string, so workspace paths or header-only FASTA passed request validation and failed inside the Celery task with ValueError: No sequences found in genome_fasta.\n- Fix: Added a field_validator that checks for at least one FASTA header + sequence pair. Invalid content now returns HTTP 422 at request time instead of causing a Celery task failure.\n- Tests: Added unit tests (tests/unit/test_reconstruction_schema.py) and route-level tests (tests/routes/test_job_routes.py) confirming 422 responses for invalid inputs.\n\n## Test plan\n- pytest tests/unit/test_reconstruction_schema.py -v\n- pytest tests/routes/test_job_routes.py::TestReconstructJob -v\n- Confirm existing FASTA tests still pass (valid DNA and protein FASTA accepted)\n\nGenerated with Claude Code (https://claude.com/claude-code)

jplfaria and others added 3 commits June 12, 2026 06:44
genome_fasta had no content validation, so workspace paths or
header-only strings would pass request parsing and only fail inside
the Celery task with a confusing ValueError. Add a field_validator
that checks for at least one >header + sequence pair and returns a
422 Unprocessable Entity at request time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant