Skip to content

This PR is to add comments to newEFCEngineREP in fluid/pkg/ddc/efc/replicas_test.go#5735

Open
Q7856 wants to merge 2 commits intofluid-cloudnative:masterfrom
Q7856:qe-branch
Open

This PR is to add comments to newEFCEngineREP in fluid/pkg/ddc/efc/replicas_test.go#5735
Q7856 wants to merge 2 commits intofluid-cloudnative:masterfrom
Q7856:qe-branch

Conversation

@Q7856
Copy link
Copy Markdown

@Q7856 Q7856 commented Mar 27, 2026

Ⅰ. Describe what this PR does

add comments to newEFCEngineREP in fluid/pkg/ddc/efc/replicas_test.go

Ⅱ. Does this pull request fix one issue?

fixes #5734

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot bot commented Mar 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ronggu for approval by writing /assign @ronggu in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot bot commented Mar 27, 2026

Hi @Q7856. Thanks for your PR.

I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds documentation to the newEFCEngineREP function in pkg/ddc/efc/replicas_test.go. The reviewer suggested refactoring the comment to follow idiomatic Go documentation standards by integrating parameter and return information into the main prose instead of using explicit sections.

Comment on lines +39 to +54
// newEFCEngineREP creates and initializes an EFCEngine instance for testing purposes.
//
// This function builds a runtime info object based on the given name and namespace,
// then constructs an EFCEngine with a fake Kubernetes client, empty runtime object,
// and a null logger. It also initializes the Helper utility for the engine.
//
// It is mainly used in unit tests (e.g., TestSyncReplicas) to simulate
// EFCEngine behavior without interacting with a real Kubernetes cluster.
//
// Parameters:
// client - a Kubernetes client (usually a fake client for testing)
// name - the name of the EFCRuntime
// namespace - the namespace of the EFCRuntime
//
// Returns:
// *EFCEngine - a fully initialized EFCEngine instance for testing
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The comment format is not idiomatic Go. While the information is useful, Go documentation comments typically don't use Parameters: and Returns: sections. It's better to integrate this information into the main prose of the comment. This makes it more consistent with the style of other Go projects and the Go standard library.

Here is a suggested revision that is more idiomatic:

Suggested change
// newEFCEngineREP creates and initializes an EFCEngine instance for testing purposes.
//
// This function builds a runtime info object based on the given name and namespace,
// then constructs an EFCEngine with a fake Kubernetes client, empty runtime object,
// and a null logger. It also initializes the Helper utility for the engine.
//
// It is mainly used in unit tests (e.g., TestSyncReplicas) to simulate
// EFCEngine behavior without interacting with a real Kubernetes cluster.
//
// Parameters:
// client - a Kubernetes client (usually a fake client for testing)
// name - the name of the EFCRuntime
// namespace - the namespace of the EFCRuntime
//
// Returns:
// *EFCEngine - a fully initialized EFCEngine instance for testing
// newEFCEngineREP creates and initializes an EFCEngine instance for testing purposes.
//
// This function builds a runtime info object based on the EFCRuntime's name and namespace,
// then constructs an EFCEngine with a fake Kubernetes client (usually a fake client for testing),
// an empty runtime object, and a null logger. It also initializes the Helper utility for the engine.
//
// It is mainly used in unit tests (e.g., TestSyncReplicas) to simulate
// EFCEngine behavior without interacting with a real Kubernetes cluster.
//
// It returns a fully initialized EFCEngine instance for testing.

Signed-off-by: Q7856 <tw.qe2022@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented Mar 28, 2026

/ok-to-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Notation to newEFCEngineREP in fluid/pkg/ddc/efc/replicas_test.go

2 participants