-
Notifications
You must be signed in to change notification settings - Fork 0
[Snyk] Security upgrade python from 3.11-slim-bookworm to 3.14.2-slim-bookworm #15
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,7 +7,7 @@ COPY ./pyproject.toml /tmp/pyproject.toml | |||||||||
| COPY ./poetry.lock /tmp/poetry.lock | ||||||||||
| RUN poetry export -f requirements.txt --output requirements.txt --without-hashes | ||||||||||
|
|
||||||||||
| FROM python:3.11-slim-bookworm | ||||||||||
| FROM python:3.14.2-slim-bookworm | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: The runtime image is upgraded to Python 3.14.2 while the project explicitly declares support only for Python 3.11 (<3.12) in pyproject.toml; running the app on 3.14 can cause incompatibilities, including dependency resolution/install failures and subtle runtime behavior differences, since the codebase and tooling (ruff target-version py311) are built and tested against 3.11 only. [logic error] Severity Level: Minor
Suggested change
Why it matters? ⭐The project's pyproject.toml explicitly pins python = "^3.11,<3.12", and the repo's tooling (tool.ruff target-version = "py311") is aligned to 3.11. Running the application on python:3.14.2 is a real compatibility risk — dependency resolution, binary wheels, C-extensions, and subtle runtime behavior (typing, stdlib changes) can differ and cause install/runtime failures. Reverting the runtime image to 3.11-slim-bookworm fixes a genuine mismatch between declared supported Python and the runtime image; this is not merely cosmetic. Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** Dockerfile
**Line:** 10:10
**Comment:**
*Logic Error: The runtime image is upgraded to Python 3.14.2 while the project explicitly declares support only for Python 3.11 (<3.12) in pyproject.toml; running the app on 3.14 can cause incompatibilities, including dependency resolution/install failures and subtle runtime behavior differences, since the codebase and tooling (ruff target-version py311) are built and tested against 3.11 only.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The Docker build will fail because key dependencies like 🔍 Detailed AnalysisThe Docker build will fail during the 💡 Suggested FixEither revert the Python version in the Dockerfile to a 3.11.x release to match the project's constraints, or update the project's dependencies and 🤖 Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This upgrade breaks the build. The project's To fix this, either:
Fix it with Roo Code or mention @roomote and request a fix. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P0: Critical version incompatibility: The project requires Prompt for AI agents
Suggested change
|
||||||||||
| WORKDIR /app | ||||||||||
| COPY --from=requirements-stage /tmp/requirements.txt /app/requirements.txt | ||||||||||
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposed Python version
3.14.2is problematic for two main reasons:python:3.14.2-slim-bookwormdoes not exist on Docker Hub. This will cause the Docker build to fail.pyproject.tomlspecifies a Python version constraint of^3.11,<3.12. Upgrading to a non-existent Python 3.14 would violate this constraint and likely cause dependency issues, as therequirements.txtis generated using Python 3.11.To address the security vulnerabilities Snyk is trying to fix while maintaining compatibility, I suggest updating to the latest patch version of Python 3.11. For example, you could use a more specific and recent tag like
python:3.11.9-slim-bookworm.