-
Notifications
You must be signed in to change notification settings - Fork 31
✨ Check for associated jobs when deleting a function #8342
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
✨ Check for associated jobs when deleting a function #8342
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8342 +/- ##
==========================================
+ Coverage 84.69% 89.76% +5.06%
==========================================
Files 1945 1530 -415
Lines 75529 63279 -12250
Branches 1312 499 -813
==========================================
- Hits 63973 56800 -7173
+ Misses 11161 6350 -4811
+ Partials 395 129 -266
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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 introduces functionality to check for associated jobs when deleting a function, preventing accidental deletion of functions that have active jobs. The implementation adds a force
parameter to allow deletion even when jobs exist.
- Adds validation to prevent deletion of functions with associated jobs unless forced
- Introduces a new
FunctionHasJobsCannotDeleteError
exception for better error handling - Implements a
force
query parameter to allow forced deletion when needed
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test_functions_controller_rest.py |
Adds test case for function deletion with associated jobs |
conftest.py |
Creates test fixture for function with associated job |
_functions_service.py |
Adds force parameter to delete_function service method |
_functions_repository.py |
Implements job count check and force deletion logic |
_functions_rest_schemas.py |
Defines query parameter schema for force deletion |
_functions_rest.py |
Integrates force parameter into REST endpoint |
openapi.yaml |
Updates API specification with force query parameter |
functions_errors.py |
Defines new error for deletion conflicts |
_functions.py |
Updates API spec dependencies |
services/web/server/src/simcore_service_webserver/functions/_functions_repository.py
Show resolved
Hide resolved
...es/web/server/src/simcore_service_webserver/functions/_controller/_functions_rest_schemas.py
Show resolved
Hide resolved
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.
Looks good, thx.
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.
thanks
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.
thanks!
services/web/server/src/simcore_service_webserver/functions/_functions_repository.py
Show resolved
Hide resolved
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.
thx
services/web/server/src/simcore_service_webserver/functions/_controller/_functions_rest.py
Show resolved
Hide resolved
...es/web/server/src/simcore_service_webserver/functions/_controller/_functions_rest_schemas.py
Outdated
Show resolved
Hide resolved
@Mergifyio queue |
🟠 Waiting for conditions to match
|
|
50c2568
into
ITISFoundation:master
What do these changes do?
This PR introduces functionality to check for associated jobs when deleting a function, preventing accidental deletion of functions that have active jobs. The implementation adds a
force
parameter to allow deletion even when jobs exist.FunctionHasJobsCannotDeleteError
exception for better error handlingforce
query parameter to allow forced deletion when neededRelated issue/s
How to test
Dev-ops