Skip to content

Conversation

A-Artemis
Copy link
Contributor

@A-Artemis A-Artemis commented Sep 23, 2025

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
image

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have ran e2e tests and there is no issues.
  • I have added the description of my changes into CHANGELOG in my target branch (e.g., CHANGELOG in develop).​
  • I have updated the documentation in my target branch accordingly (e.g., documentation in develop).
  • I have linked related issues.

License

  • I submit my code changes under the same Apache License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below).
# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

@A-Artemis A-Artemis self-assigned this Sep 23, 2025
@A-Artemis A-Artemis linked an issue Sep 23, 2025 that may be closed by this pull request
@github-actions github-actions bot added TEST Any changes in tests Geti Tune Backend Issues related to Geti Tune Studio backend labels Sep 23, 2025
Copy link

github-actions bot commented Sep 23, 2025

📊 Test coverage report

Metric Coverage
Lines 25.8%
Functions 29.8%
Branches 84.7%
Statements 25.8%

Copy link

github-actions bot commented Sep 24, 2025

Docker Image Sizes

Image Size
geti-tune-pr-4747 1.2G
geti-tune-sha-cac3b62 1.2G

@A-Artemis A-Artemis requested a review from Copilot September 24, 2025 10:12
@A-Artemis A-Artemis marked this pull request as ready for review September 24, 2025 10:12
Copy link
Contributor

@Copilot Copilot AI left a 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
@A-Artemis A-Artemis merged commit 7fa765d into develop Sep 26, 2025
28 checks passed
@A-Artemis A-Artemis deleted the aurelien/project-thumbnail-endpoint branch September 26, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Geti Tune Backend Issues related to Geti Tune Studio backend TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement endpoint for project thumbnail
3 participants