-
Notifications
You must be signed in to change notification settings - Fork 461
Added project thumbnail endpoint #4747
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
Conversation
📊 Test coverage report
|
Docker Image Sizes
|
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.
Pull Request Overview
This PR adds a GET endpoint for project thumbnails and links thumbnail IDs to projects. The implementation automatically selects and associates a thumbnail with the project if none is set.
- Adds
thumbnail_id
field to both Project schema and database model - Implements GET
/api/projects/{project_id}/thumbnail
endpoint that returns thumbnail images - Adds logic to automatically select and link thumbnails from dataset items when no explicit thumbnail is set
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
backend/app/schemas/project.py | Adds optional thumbnail_id field to Project schema |
backend/app/db/schema.py | Adds thumbnail_id column to ProjectDB table |
backend/app/services/mappers/project_mapper.py | Updates mapper to handle thumbnail_id field conversion |
backend/app/services/project_service.py | Adds thumbnail path resolution logic and automatic thumbnail selection |
backend/app/api/endpoints/projects.py | Implements GET thumbnail endpoint |
backend/app/api/dependencies.py | Updates ProjectService dependency to accept data_dir parameter |
backend/app/alembic/versions/95b8e3d1e0a7_schema.py | Database migration to add thumbnail_id column |
backend/tests/unit/services/mappers/test_project_mapper.py | Adds test coverage for thumbnail_id mapping |
backend/tests/unit/endpoints/test_projects.py | Adds unit tests for thumbnail endpoint |
backend/tests/integration/services/test_project_service.py | Adds integration tests for thumbnail functionality |
backend/tests/integration/services/test_dataset_service.py | Updates fixture naming for consistency |
backend/tests/integration/alembic/test_initial_schema_migration.py | Updates expected migration version |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…nsions into aurelien/project-thumbnail-endpoint
… dataset item to the project.
…nsions into aurelien/project-thumbnail-endpoint
Summary
This PR adds the GET project thumbnail endpoint. It also links the thumbnail's ID to the project for consistency.
How to test
http://geti-tune.localhost/api/projects/9d6af8e8-6017-4ebe-9126-33aae739c5fa/thumbnail

Checklist
License
Feel free to contact the maintainers if that's a concern.