8000 [core] Rename `GcsFunctionManager` and use fake in test by codope · Pull Request #53973 · ray-project/ray · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[core] Rename GcsFunctionManager and use fake in test #53973

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

Merged
merged 1 commit into from
Jun 23, 2025

Conversation

codope
Copy link
Contributor
@codope codope commented Jun 20, 2025

Why are these changes needed?

Followup to #53951 (review)

  • Rename GcsFunctionManager to GCSFunctionManager
  • Use fakes instead of mocks in gcs_function_manager_test.cc

@Copilot Copilot AI review requested due to automatic review settings June 20, 2025 13:31
@codope codope requested a review from a team as a code owner June 20, 2025 13:31
Copy link
Contributor
@Copilot Copilot AI left a 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 renames the GcsFunctionManager class to GCSFunctionManager everywhere and updates tests to use FakeInternalKVInterface instead of mocks for function manager behavior verification.

  • Rename GcsFunctionManagerGCSFunctionManager across headers, sources, and tests
  • Swap out MockInternalKVInterface for FakeInternalKVInterface in function manager tests
  • Implement Del, Exists, and Keys in FakeInternalKVInterface to support fake-based tests

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/ray/gcs/gcs_server/test/gcs_job_manager_test.cc Instantiate GCSFunctionManager instead of GcsFunctionManager
src/ray/gcs/gcs_server/test/gcs_function_manager_test.cc Rename fixture, use FakeInternalKVInterface, add HasKey helper
src/ray/gcs/gcs_server/test/gcs_autoscaler_state_manager_test.cc Update constructor to use GCSFunctionManager
src/ray/gcs/gcs_server/test/gcs_actor_manager_test.cc Instantiate GCSFunctionManager
src/ray/gcs/gcs_server/test/export_api/gcs_job_manager_export_event_test.cc Use GCSFunctionManager
src/ray/gcs/gcs_server/test/export_api/gcs_actor_manager_export_event_test.cc Switch parameter to GCSFunctionManager
src/ray/gcs/gcs_server/gcs_server.h Rename member to std::unique_ptr<GCSFunctionManager>
src/ray/gcs/gcs_server/gcs_server.cc Call std::make_unique<GCSFunctionManager> in InitFunctionManager
src/ray/gcs/gcs_server/gcs_job_manager.h Change constructor and member reference to GCSFunctionManager
src/ray/gcs/gcs_server/gcs_function_manager.h Rename class to GCSFunctionManager
src/ray/gcs/gcs_server/gcs_actor_manager.h Update constructor signature and member to GCSFunctionManager
src/ray/gcs/gcs_server/gcs_actor_manager.cc Adjust constructor parameter alignment for GCSFunctionManager
src/mock/ray/gcs/gcs_server/gcs_kv_manager.h Add real Del, Exists, Keys methods in FakeInternalKVInterface
src/mock/ray/gcs/gcs_server/gcs_actor_manager.h Update MockGcsActorManager to accept GCSFunctionManager
Comments suppressed due to low confidence (3)

src/mock/ray/gcs/gcs_server/gcs_kv_manager.h:67

  • The comment mentions support for MultiGet, but no implementation is provided in this class. Either implement MultiGet or update the documentation to accurately reflect supported methods.
// Supports all operations: Get, MultiGet, Put, Del, Exists, Keys.

src/ray/gcs/gcs_server/gcs_actor_manager.h:346

  • The indentation of this parameter is inconsistent with the surrounding parameter list. Align it with the other constructor parameters for better readability.
                               GCSFunctionManager &function_manager,

src/ray/gcs/gcs_server/gcs_actor_manager.cc:341

  • This constructor parameter is indented unevenly compared to the other parameters. Adjust spacing so the parameter list aligns uniformly.
                             GCSFunctionManager &function_manager,

// Helper method to check if a key exists in the fake KV store
bool HasKey(const std::string &ns, const std::string &key) {
std::string full_key = ns + key;
return kv->kv_store_.find(full_key) != kv->kv_store_.end();
Copy link
Preview
Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

[nitpick] The HasKey helper inspects kv_store_ directly, coupling the test to an internal detail. Consider using the public Exists or Keys API to verify key presence, which keeps the test decoupled from the fake's internal representation.

Suggested change
return kv->kv_store_.find(full_key) != kv->kv_store_.end();
return kv->Exists(full_key);

Copilot uses AI. Check for mistakes.

@codope codope added the go add ONLY when ready to merge, run all tests label Jun 20, 2025
@codope codope force-pushed the refactor-gcs-function-manager branch from af6e80b to a77eb4f Compare June 20, 2025 15:31
Signed-off-by: Sagar Sumit <sagarsumit09@gmail.com>
@codope codope force-pushed the refactor-gcs-function-manager branch from a77eb4f to 97d94f1 Compare June 23, 2025 03:21
Copy link
Collaborator
@edoakes edoakes left a comment

Choose a reason for hiding this comment

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

💯

@edoakes edoakes merged commit 6fafb95 into ray-project:master Jun 23, 2025
5 checks passed
minerharry pushed a commit to minerharry/ray that referenced this pull request Jun 27, 2025
…53973)

Followup to
ray-project#53951 (review)

- Rename `GcsFunctionManager` to `GCSFunctionManager`
- Use fakes instead of mocks in `gcs_function_manager_test.cc`

Signed-off-by: Sagar Sumit <sagarsumit09@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0