Skip to content
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

Add delete endpoint for image #72

Merged
merged 12 commits into from
Dec 16, 2024

Conversation

asuresh-code
Copy link
Contributor

@asuresh-code asuresh-code commented Nov 28, 2024

Description

Implements a DELETE endpoint /images/<image_id> that:

  • Deletes the image metadata from the database
  • Deletes the file object in the object store
  • Gracefully deals with a situation when the file object with the given object_key doesn't exist

Testing instructions

  • Review code
  • Check Actions build
  • Review changes to test coverage

Agile board tracking

closes #38

@asuresh-code asuresh-code self-assigned this Nov 28, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.59%. Comparing base (1620e19) to head (ce62423).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #72      +/-   ##
===========================================
+ Coverage    98.29%   98.59%   +0.30%     
===========================================
  Files           21       21              
  Lines          410      428      +18     
===========================================
+ Hits           403      422      +19     
+ Misses           7        6       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@joelvdavies joelvdavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small comments. will look at the tests afterwards. This PR may have some minor conflicts with the get branch so will probably need merging into to this branch one it is merged.

object_storage_api/repositories/image.py Outdated Show resolved Hide resolved
object_storage_api/repositories/image.py Outdated Show resolved Hide resolved
object_storage_api/services/image.py Outdated Show resolved Hide resolved
object_storage_api/stores/image.py Show resolved Hide resolved
object_storage_api/routers/image.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@joelvdavies joelvdavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments works well.

object_storage_api/routers/image.py Outdated Show resolved Hide resolved
object_storage_api/services/image.py Show resolved Hide resolved
object_storage_api/stores/image.py Outdated Show resolved Hide resolved
test/unit/stores/test_image.py Outdated Show resolved Hide resolved
test/unit/stores/test_image.py Outdated Show resolved Hide resolved
test/unit/services/test_image.py Show resolved Hide resolved
@asuresh-code asuresh-code force-pushed the add-delete-endpoint-for-image-#38 branch from c360d4a to 094fb83 Compare December 6, 2024 11:32
@joelvdavies joelvdavies requested a review from VKTB December 9, 2024 08:42
joelvdavies
joelvdavies previously approved these changes Dec 9, 2024
Copy link
Collaborator

@joelvdavies joelvdavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

test/e2e/test_image.py Outdated Show resolved Hide resolved
test/e2e/test_image.py Outdated Show resolved Hide resolved
object_storage_api/routers/image.py Outdated Show resolved Hide resolved
@asuresh-code asuresh-code requested a review from VKTB December 13, 2024 11:43
@asuresh-code asuresh-code merged commit af5e70d into develop Dec 16, 2024
3 checks passed
@asuresh-code asuresh-code deleted the add-delete-endpoint-for-image-#38 branch December 16, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an endpoint for deleting an image
4 participants