Repository navigation
RAG upload CI: install Pillow, and check every harness import is installed - #18381
Merged
Merged
Conversation
…alled #18293 converts uploaded images to PNG with PIL (routes/rag.py _image_png) and test_rag_extract_text.py builds its WebP / JPEG / TIFF fixtures with PIL while the module is collected. The Uploads job builds its venv only from rag_upload_requirements.txt, which had no Pillow, so the file fails to collect on ubuntu-latest and windows-latest. Pin pillow at the Studio runtime version. The existing guard only read imports under an if-CI block. Also check every third-party import (module level or in a function, outside try/except ImportError) in the files the harness runs.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Uploads job (
tests/studio/rag_upload_ci.py) fails on ubuntu-latest and windows-latest becausestudio/backend/tests/test_rag_extract_text.pycannot be collected:Seen on the staging run for #18375, on current main.
Cause
#18293 added image uploads to the knowledge-base path.
routes/rag.py_image_pngdecodes them with Pillow, andtest_rag_extract_text.pybuilds its WebP / JPEG / TIFF fixtures with Pillow inside aparametrizelist, so at collection time. Pillow is a Studio runtime dependency (no-torch-runtime.txtpinspillow==13.0.0for Python 3.11+), so the route is correct.The Uploads job builds its venv only from
tests/studio/rag_upload_requirements.txt, which had no Pillow.test_rag_upload_requirements_cover_ci_imports.pyexists to catch this kind of gap, but it only read imports placed under anif ... "CI" ...block, so a function-levelfrom PIL import Imagewent unseen.Fix
pillow==13.0.0inrag_upload_requirements.txt, the runtime version for the job's Python 3.12. It resolves with the rest of the file on bothx86_64-manylinux_2_28andx86_64-pc-windows-msvc.test_rag_*.pyplustest_conversation_archive.py, asrag_upload_ci.pylists them) must be installed by the requirements file. The check covers module level and inside functions.try: ... except ImportErrorstay optional.studio/backend,studio/backend/tests,tests/_shared) are skipped.PILtopillow,fitztopymupdf,docxtopython-docx, and so on).Every other third-party import in those files was already pinned, so the widened check adds no further requirements.
Verification
rag_upload_requirements.txttest_rag_upload_requirements_cover_ci_imports.pynot in rag_upload_requirements.txt: ['test_rag_extract_text.py: PIL']ruff is clean.