Skip to content

Video source upload video cleanup#6994

Merged
jpggvilaca merged 4 commits into
developfrom
jvilaca/video-source-upload-be
Jul 8, 2026
Merged

Video source upload video cleanup#6994
jpggvilaca merged 4 commits into
developfrom
jvilaca/video-source-upload-be

Conversation

@jpggvilaca

@jpggvilaca jpggvilaca commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow up from #6981

  • Deleting a video source should get delete uploaded video
  • Replacing a video should delete the previous one

Final part of #6931

How to test

Checklist

  • The PR title and description are clear and descriptive
  • I have manually tested the changes
  • All changes are covered by automated tests
  • All related issues are linked to this PR (if applicable)
  • Documentation has been updated (if applicable)

@jpggvilaca jpggvilaca added the Geti Backend Issues related to the Geti application server label Jul 8, 2026
Copilot AI review requested due to automatic review settings July 8, 2026 06:51
@jpggvilaca jpggvilaca requested a review from a team as a code owner July 8, 2026 06:51
@github-actions github-actions Bot added the TEST Any changes in tests label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

⏱️ Backend import time — app.main

Accelerator Cumulative (s) Self (s)
cpu 4.868 0.004
xpu 4.844 0.004
cuda 5.331 0.004

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 backend-side cleanup of uploaded “video_file” source media so that removing a video source (or replacing its uploaded video) also removes the previously uploaded file/directory from disk.

Changes:

  • Add SourceMediaService.delete_video() and call it (best-effort) when deleting a video_file source.
  • On video_file source updates, delete the old uploaded video when video_path changes.
  • Wire SourceMediaService into the SourceUpdateService dependency and add unit/integration coverage for the cleanup behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
application/backend/app/services/source_media_service.py Adds delete_video() helper to remove uploaded video directories.
application/backend/app/services/source_service.py Integrates best-effort media deletion into source delete/update flows.
application/backend/app/api/dependencies.py Injects SourceMediaService into SourceUpdateService.
application/backend/tests/unit/services/test_source_media_service.py Adds unit tests for delete behavior and safety boundaries.
application/backend/tests/integration/services/test_source_service.py Verifies old-video cleanup is triggered on update/delete via mocked media service.

Comment thread application/backend/app/services/source_media_service.py Outdated
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🐳 Docker image sizes

Device Size
cpu 4002.9 MB (3.91 GB)
xpu 10791.5 MB (10.54 GB)
cuda 10198.1 MB (9.96 GB)

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

📊 Test coverage report

Metric Coverage
Lines 60.0%
Functions 56.7%
Branches 51.5%
Statements 59.6%

@jpggvilaca jpggvilaca added this pull request to the merge queue Jul 8, 2026
Merged via the queue into develop with commit 9b2a7af Jul 8, 2026
39 checks passed
@jpggvilaca jpggvilaca deleted the jvilaca/video-source-upload-be branch July 8, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Geti Backend Issues related to the Geti application server TEST Any changes in tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants