-
Notifications
You must be signed in to change notification settings - Fork 342
feat(manager): optimize service of the persistent cache task #3929
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
Conversation
Signed-off-by: Gaius <gaius.qi@gmail.com>
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 pull request redefines endpoints and schema definitions for persistent cache functionality to improve clarity and consistency. Key changes include:
- Renaming endpoints from "/api/v1/persistent-caches" to "/api/v1/persistent-cache-tasks" and updating related routes, handlers, and mocks.
- Updating schema definitions and types in the manager package to align with the new naming conventions.
- Revising API documentation in swagger to reflect changes in endpoint paths and response models.
Reviewed Changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
scheduler/resource/persistentcache/task_manager_mock.go | Updates renamed mock function names to match persistent cache task methods. |
scheduler/resource/persistentcache/task_manager.go | Adjusts type conversion and inline comments for clarity. |
scheduler/resource/persistentcache/peer_manager.go & host_manager.go | Replaces []interface{} with []any for improved code consistency. |
pkg/redis/redis.go | Removes unused imports and outdated helper functions. |
manager/types/persistent_cache_task.go | Renames and updates schema definitions and types for persistent cache tasks. |
manager/service/service.go & mocks/service_mock.go | Renames service methods to align with the new endpoint semantics. |
manager/router/router.go | Modifies route paths and associated handler references for persistent cache tasks. |
manager/handlers/persistent_cache_task.go | Introduces new handlers for persistent cache tasks. |
manager/handlers/persistent_cache.go & persistent_cache_test.go | Removes obsolete handlers and tests for the previous persistent cache endpoints. |
api/manager/docs.go | Updates API documentation to reflect new endpoints and schema references. |
Files not reviewed (2)
- api/manager/swagger.json: Language not supported
- api/manager/swagger.yaml: Language not supported
Comments suppressed due to low confidence (2)
scheduler/resource/persistentcache/task_manager_mock.go:103
- [nitpick] The renaming between 'LoadCurrentReplicaCount' and 'LoadCurrentPersistentReplicaCount' in the mock functions can be confusing. Please double-check that the function names and comments are consistently updated to reflect the persistent cache task changes.
func (m *MockTaskManager) LoadCurrentReplicaCount(arg0 context.Context, arg1 string) (uint64, error) {
manager/handlers/persistent_cache_task.go:17
- New persistent cache task handlers have been added without accompanying test cases. Consider adding test coverage to verify the behavior of these endpoints.
package handlers
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3929 +/- ##
==========================================
- Coverage 34.65% 34.54% -0.11%
==========================================
Files 339 339
Lines 39959 39956 -3
==========================================
- Hits 13847 13804 -43
- Misses 25201 25247 +46
+ Partials 911 905 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 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.
LGTM
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.
lgtm
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.
LGTM
Description
This pull request includes significant changes to the API documentation in
api/manager/docs.go
andapi/manager/swagger.json
files. The primary focus is on renaming endpoints and updating related schema definitions to improve clarity and consistency.API Endpoint Changes:
/api/v1/persistent-caches
to/api/v1/persistent-cache-tasks
and updated all related descriptions, tags, and summaries accordingly. [1] [2]/api/v1/persistent-caches/{scheduler_cluster_id}/{task_id}
to/api/v1/persistent-cache-tasks/{id}
and updated the parameter types and locations. [1] [2]Schema Definition Updates:
GetPersistentCacheResponse
toPersistentCacheTask
in the response schema. [1] [2]d7y_io_dragonfly_v2_manager_types.GetPersistentCacheResponse
andPersistentCachePeer
schema definitions. [1] [2]PersistentCacheTask
andPersistentCachePeer
schema definitions with updated properties.These changes ensure that the API documentation is more intuitive and aligns with the updated endpoint structure.
Related Issue
close #3892
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist