-
Notifications
You must be signed in to change notification settings - Fork 32
♻️ Unifying long_running_tasks interfaces #7697
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
♻️ Unifying long_running_tasks interfaces #7697
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7697 +/- ##
==========================================
+ Coverage 86.80% 87.12% +0.32%
==========================================
Files 1846 1435 -411
Lines 71606 59906 -11700
Branches 1219 615 -604
==========================================
- Hits 62158 52194 -9964
+ Misses 9106 7514 -1592
+ Partials 342 198 -144
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…nt-long-running-decorator
…nt-long-running-decorator
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 refactors the long_running_tasks interfaces across fastapi and aiohttp to use a unified exception and result handling approach and removes deprecated APIs. Key changes include:
- Changing expected exceptions from TaskClientResultError to RuntimeError or more specific errors.
- Removing the deprecated get_task_result_old API and related tests.
- Updating import paths and exception handling in both client and server modules.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/dynamic-sidecar/tests/unit/test_api_rest_workflow_service_metrics.py | Updated expected exception for failed user services start/stop. |
| services/dynamic-sidecar/tests/unit/test_api_rest_containers_long_running_tasks.py | Changed expected exception to UploadPortsFailedError, aligning with new API. |
| services/dynamic-sidecar/tests/unit/test_api_rest_containers.py | Removed obsolete error field assertion to reflect updated response body. |
| services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py | Refactored prunable folder instantiation for cleaner file cleanup. |
| services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/scheduler/_core/_events_utils.py | Removed the catching of TaskClientResultError and now only handling BaseHttpClientError. |
| packages/service-library/tests/long_running_tasks_task.py | Removed tests for deprecated get_task_result_old functionality. |
| packages/service-library/tests/fastapi/long_running_tasks_context_manager.py | Updated exception expectations and assertions in context manager tests. |
| packages/service-library/tests/fastapi/long_running_tasks.py | Refactored tests to use updated exception types and result formats. |
| packages/service-library/src/servicelib/long_running_tasks/_task.py | Removed deprecated API and adjusted exception catch in async task cancellation. |
| packages/service-library/src/servicelib/long_running_tasks/_errors.py | Removed TaskClientResultError definition. |
| packages/service-library/src/servicelib/fastapi/long_running_tasks/server.py | Updated imports to use the new TaskResult model. |
| packages/service-library/src/servicelib/fastapi/long_running_tasks/client.py | Removed return_exception parameter and TaskClientResultError handling. |
| packages/service-library/src/servicelib/fastapi/long_running_tasks/_routes.py | Refactored the get_task_result endpoint to remove legacy behavior. |
| packages/service-library/src/servicelib/fastapi/long_running_tasks/_context_manager.py | Updated docstring to reflect exception type changes. |
| packages/service-library/src/servicelib/fastapi/long_running_tasks/_client.py | Simplified get_task_result handling and adjusted import usage. |
packages/service-library/src/servicelib/long_running_tasks/_task.py
Outdated
Show resolved
Hide resolved
.../service-library/tests/fastapi/long_running_tasks/test_long_running_tasks_context_manager.py
Outdated
Show resolved
Hide resolved
…sk.py Co-authored-by: Copilot <[email protected]>
sanderegg
left a comment
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! just a few minor comments.
packages/service-library/src/servicelib/fastapi/long_running_tasks/_context_manager.py
Outdated
Show resolved
Hide resolved
.../service-library/tests/fastapi/long_running_tasks/test_long_running_tasks_context_manager.py
Outdated
Show resolved
Hide resolved
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py
Show resolved
Hide resolved
bisgaard-itis
left a comment
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.
Nice cleanup. Thanks
packages/service-library/src/servicelib/fastapi/long_running_tasks/_client.py
Show resolved
Hide resolved
packages/service-library/src/servicelib/fastapi/long_running_tasks/_context_manager.py
Outdated
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 (or ... ty) ;-)
packages/service-library/src/servicelib/fastapi/long_running_tasks/_context_manager.py
Outdated
Show resolved
Hide resolved
packages/service-library/src/servicelib/fastapi/long_running_tasks/_routes.py
Show resolved
Hide resolved
…om:GitHK/osparc-simcore-forked into pr-osparc-resilient-long-running-decorator
|
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
|
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks:You may have to fix your CI before adding the pull request to the queue again. |
|
@Mergifyio requeue |
✅ This pull request will be re-embarked automaticallyThe followup |
🛑 The pull request has been removed from the queue
|
|
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks:You may have to fix your CI before adding the pull request to the queue again. |
|
@Mergifyio requeue |
✅ This pull request will be re-embarked automaticallyThe followup |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 2350f9a |
|



What do these changes do?
Aligned interface between fastapi and aiohttp for long_running_tasks, they no use the same results endpoint. This is a reminder form #3265
Bonus: fixed an issue where
dynamic-sidecardid not properly cleanup the directory when the number of files in the input goes from many to one.Related issue/s
How to test
Dev-ops