Open
Conversation
Pull Request Test Coverage Report for Build 23212210402Details
💛 - Coveralls |
Member
|
Hi @guilhermef These files are libraries, not executable scripts, so the Could you remove it? |
Member
Author
|
Thanks @marcelometal, it's removed. |
There was a problem hiding this comment.
Pull request overview
This PR migrates RemoteCV’s queue backend from the archived PyRes implementation to a Celery (SQS) based worker, removing the PyRes worker/unique-queue code path and updating the test suite accordingly.
Changes:
- Remove PyRes worker +
UniqueQueue/UniqueWorkerimplementation and associated tests. - Add Celery-based task runner with Redis-backed de-dupe keys, and update worker CLI/startup to always run Celery.
- Refresh/extend tests around worker startup, Celery task behavior, and various supporting utilities/stores.
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_worker.py | Updates CLI startup tests to expect Celery-only behavior; adds start_celery_worker() unit test. |
| tests/test_unique_queue.py | Removes PyRes unique-queue tests (file deleted). |
| tests/test_tasks.py | Switches task import to remotecv.tasks.DetectTask. |
| tests/test_result_store.py | Removes shebang line. |
| tests/test_redis_storage.py | Removes shebang line. |
| tests/test_redis.py | Makes Redis client assertions less string-representation dependent; adds metrics mock setup. |
| tests/test_profile_detector.py | Removes shebang line. |
| tests/test_memcache_store.py | Adds tests for memcache result store initialization/caching and storing behavior. |
| tests/test_logger_metrics.py | Adds smoke tests for logger-based metrics backend. |
| tests/test_init.py | Adds test for __version__ fallback when package metadata is unavailable. |
| tests/test_images.py | Adds tests for image-load error handling and metadata clearing edge cases. |
| tests/test_http_loader.py | Adds tests for synchronous HTTP loader behavior + metrics emission. |
| tests/test_healthcheck_handler.py | Removes shebang line. |
| tests/test_glasses_detector.py | Removes shebang line. |
| tests/test_feature_detector.py | Removes shebang; adds test for empty-corners array behavior. |
| tests/test_face_detector.py | Removes shebang line. |
| tests/test_error_handler.py | Adds tests for Sentry initialization and excepthook installation/handling. |
| tests/test_complete_detector.py | Removes shebang line. |
| tests/test_celery_tasks.py | Adds tests for CeleryTasks enqueueing, de-dupe keys, TTL behavior, and task execution cleanup. |
| remotecv/worker.py | Removes PyRes backend option/path; makes worker always start Celery; adds Redis key TTL CLI option. |
| remotecv/utils.py | Removes shebang line. |
| remotecv/unique_queue.py | Removes PyRes-backed unique queue/worker implementation (file deleted). |
| remotecv/tasks.py | Renames metrics from pyres_task.* to generic task.*. |
| remotecv/storages/redis_storage.py | Removes shebang line. |
| remotecv/image_processor.py | Removes shebang line. |
| remotecv/detectors/profile_detector/init.py | Removes shebang line. |
| remotecv/detectors/glasses_detector/init.py | Removes shebang line. |
| remotecv/detectors/feature_detector/init.py | Removes shebang line. |
| remotecv/detectors/init.py | Removes shebang line. |
| remotecv/celery_tasks.py | Introduces CeleryTasks + Redis-backed de-dupe key management and enqueue API. |
| pyproject.toml | Major version bump and dependency updates (Celery promoted to core dependency; removes PyRes). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| start_pyres_worker() | ||
| elif params["backend"] == "celery": | ||
| start_celery_worker() | ||
| start_celery_worker() |
| from remotecv.utils import SENTINEL, SINGLE_NODE, config, context | ||
|
|
||
|
|
||
| def start_celery_worker(): |
| logger.debug("key %s already enqueued", key) | ||
| return | ||
| self.get_detect_task().apply_async( | ||
| args=[detection_type, image_path, key] |
Comment on lines
+56
to
+60
| pil_img = mock.MagicMock(spec=PilImage.Image) | ||
| # spec=PilImage.Image means hasattr checks use the real class attrs; | ||
| # delete them on the instance to exercise the False branches | ||
| del pil_img.tag | ||
| del pil_img.tag_v2 |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pyres was archived in 2023