Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the project’s runtime/tooling stack (Python/FastAPI/Pydantic) and updates the job API code to use Pydantic v2 serialization/validation APIs.
Changes:
- Migrate Pydantic usage from v1 APIs (
.dict()/.json()/.parse_obj) to v2 APIs (model_dump/model_dump_json/model_validate) across job services and REST responses. - Upgrade Python target and core dependencies in
pyproject.tomland refreshpoetry.lockaccordingly. - Update build/CI configuration (Dockerfile, pre-commit, GitHub Actions) to use Python 3.14.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/exception_handlers.py | Switches validation error response serialization to model_dump(). |
| src/services/job_service.py | Migrates job persistence/DMSS update payloads to model_dump_json() and adjusts progress return serialization. |
| src/services/job_handler_interface.py | Updates Pydantic model config and validation/serialization helpers for v2 (ConfigDict, model_validate, model_dump). |
| src/restful/responses.py | Updates error response examples/JSONResponse payloads to use model_dump() and updates ValidationError import. |
| src/features/jobs/use_cases/update_job_progress.py | Updates Pydantic BaseModel import style (v2-friendly). |
| src/features/jobs/use_cases/status_job.py | Migrates Pydantic config to ConfigDict for enum value dumping. |
| src/features/jobs/use_cases/start_job.py | Updates Pydantic BaseModel import style (v2-friendly). |
| src/features/jobs/use_cases/delete_job.py | Updates Pydantic BaseModel import style (v2-friendly). |
| src/features/jobs/jobs.py | Replaces .dict() route return payloads with model_dump(). |
| src/domain_classes/progress.py | Updates Pydantic BaseModel import style (v2-friendly). |
| pyproject.toml | Bumps Python + key dependencies and updates Black target version. |
| poetry.lock | Lockfile refresh to match updated dependency set. |
| Dockerfile | Moves base image to Python 3.14 and normalizes stage naming. |
| .pre-commit-config.yaml | Updates pre-commit Python interpreter version to 3.14 (hook configs still need alignment). |
| .github/workflows/tests.yaml | Updates CI to set up Python 3.14. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e5abbff to
96e0fe4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| type="RequestValidationError", | ||
| message="The received values are invalid", | ||
| debug="The received values are invalid according to the endpoints model definition", | ||
| extra=jsonable_encoder({"detail": exc.errors(), "body": exc.body}), |
There was a problem hiding this comment.
ErrorResponse (imported from restful.responses) doesn't define an extra field, so the extra=... payload will be silently dropped when building the response model. If you intend to return validation details to clients, pass this data via the existing data field (or add an explicit extra field/config that preserves unknown fields).
| extra=jsonable_encoder({"detail": exc.errors(), "body": exc.body}), | |
| data=jsonable_encoder({"detail": exc.errors(), "body": exc.body}), |
| [tool.black] | ||
| line-length = 119 | ||
| target-version = ['py10'] | ||
| target-version = ['py312'] |
There was a problem hiding this comment.
pyproject.toml now requires Python ^3.13, but Black is configured with target-version = ['py312']. If the codebase is intended to allow Python 3.13 syntax/features, Black will treat them as invalid for the configured target and may fail/complain. Consider updating Black's target-version to match the project's minimum Python (or document why formatting/validation is intentionally capped at 3.12).
| target-version = ['py312'] | |
| target-version = ['py313'] |
What does this pull request change?
Why is this pull request needed?
Issues related to this change