Skip to content

This PR is to add comments to GetWorkerStatefulsetName in pkg/ddc/base/runtime_conventions.go.#5884

Open
F-Hilbert wants to merge 1 commit into
fluid-cloudnative:masterfrom
F-Hilbert:newbranch
Open

This PR is to add comments to GetWorkerStatefulsetName in pkg/ddc/base/runtime_conventions.go.#5884
F-Hilbert wants to merge 1 commit into
fluid-cloudnative:masterfrom
F-Hilbert:newbranch

Conversation

@F-Hilbert
Copy link
Copy Markdown

@F-Hilbert F-Hilbert commented May 15, 2026

…entions.go.

Ⅰ. Describe what this PR does

This PR is to add comments to GetWorkerStatefulsetName in pkg/ddc/base/runtime_conventions.go.

Ⅱ. Does this pull request fix one issue?

fixes #5883

Ⅲ. Special notes for reviews

None.

@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented May 15, 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 trafalgarzzz for approval by writing /assign @trafalgarzzz 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 May 15, 2026

Hi @F-Hilbert. 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 GetWorkerStatefulsetName function in pkg/ddc/base/runtime_conventions.go. The reviewer noted that the documentation style used is unidiomatic for Go, specifically the inclusion of explicit 'Parameters' and 'Returns' sections, and provided a suggestion to simplify the comment to align with Go best practices.

Comment on lines +7 to +15
// GetWorkerStatefulsetName returns the worker StatefulSet name for the runtime.
// This function determines the name of the worker StatefulSet based on the runtime type.
// Jindo-related runtimes use the "-jindofs-worker" suffix, while other runtimes use the "-worker" suffix.
//
// Parameters:
// - None: This function does not take any parameters.
//
// Returns:
// - string: The generated worker StatefulSet name for the current runtime.
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 documentation style using explicit Parameters and Returns sections is unidiomatic in Go. According to Go best practices (e.g., Effective Go), doc comments should be concise paragraphs where the first sentence starts with the name of the function. Redundant sections like Parameters: None should be avoided to maintain idiomatic code quality and reduce noise.

Suggested change
// GetWorkerStatefulsetName returns the worker StatefulSet name for the runtime.
// This function determines the name of the worker StatefulSet based on the runtime type.
// Jindo-related runtimes use the "-jindofs-worker" suffix, while other runtimes use the "-worker" suffix.
//
// Parameters:
// - None: This function does not take any parameters.
//
// Returns:
// - string: The generated worker StatefulSet name for the current runtime.
// GetWorkerStatefulsetName returns the worker StatefulSet name for the runtime.
// Jindo-related runtimes use the "-jindofs-worker" suffix, while other runtimes use the "-worker" suffix.
References
  1. Go doc comments should be simple sentences or paragraphs starting with the name of the declared identifier. Sections like 'Parameters' and 'Returns' are discouraged. (link)

…entions.go.

Signed-off-by: Hilbert <3505543807@qq.com>
@sonarqubecloud
Copy link
Copy Markdown

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented May 15, 2026

/ok-to-test

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.65%. Comparing base (ed9b7ef) to head (a91f77a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5884   +/-   ##
=======================================
  Coverage   61.65%   61.65%           
=======================================
  Files         480      480           
  Lines       32613    32613           
=======================================
  Hits        20108    20108           
  Misses      10897    10897           
  Partials     1608     1608           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 comments to GetWorkerStatefulsetName in pkg/ddc/base/runtime_conventions.go.

2 participants