Skip to content

This PR is to add comments to WithMetadataList in pkg/ddc/base/runtime.go.#5959

Open
flippyside wants to merge 1 commit into
fluid-cloudnative:masterfrom
flippyside:new-branch
Open

This PR is to add comments to WithMetadataList in pkg/ddc/base/runtime.go.#5959
flippyside wants to merge 1 commit into
fluid-cloudnative:masterfrom
flippyside:new-branch

Conversation

@flippyside
Copy link
Copy Markdown

@flippyside flippyside commented Jun 6, 2026

I. Describe what this PR does

Add Notation to WithMetadataList in pkg/ddc/base/runtime.go

II. Does this pull request fix one issue?

fixes #5958

III. Special notes for reviews

Signed-off-by: Akosus <144044633+flippyside@users.noreply.github.com>
@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented Jun 6, 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 Jun 6, 2026

Hi @flippyside. 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 GoDoc documentation to the WithMetadataList function in pkg/ddc/base/runtime.go. The review feedback recommends removing an extra blank line that violates standard gofmt formatting, as well as removing a redundant inline comment that simply restates the code's behavior.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread pkg/ddc/base/runtime.go
Comment on lines 231 to 247


// WithMetadataList returns a RuntimeInfoOption that sets the metadataList field
// on a RuntimeInfo instance.
//
// Parameters:
// - metadataList: a slice of Metadata objects to associate with the RuntimeInfo.
//
// Returns:
// - A RuntimeInfoOption function that, when applied, assigns the provided
// metadataList to info.metadataList and returns nil (no error).
func WithMetadataList(metadataList []datav1alpha1.Metadata) RuntimeInfoOption {
return func(info *RuntimeInfo) error {
// Assign the provided metadataList to the RuntimeInfo instance.
info.metadataList = metadataList
return nil
}
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

There are two minor issues in this change:

  1. An extra empty line was introduced before the function documentation, which violates standard gofmt formatting (which collapses multiple empty lines).
  2. The inline comment // Assign the provided metadataList to the RuntimeInfo instance. is redundant as it merely restates what the code does.

We can clean this up by removing the extra empty line and the redundant inline comment.

// WithMetadataList returns a RuntimeInfoOption that sets the metadataList field
// on a RuntimeInfo instance.
//
// Parameters:
//   - metadataList: a slice of Metadata objects to associate with the RuntimeInfo.
//
// Returns:
//   - A RuntimeInfoOption function that, when applied, assigns the provided
//     metadataList to info.metadataList and returns nil (no error).
func WithMetadataList(metadataList []datav1alpha1.Metadata) RuntimeInfoOption {
	return func(info *RuntimeInfo) error {
		info.metadataList = metadataList
		return nil
	}
}

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 6, 2026

@flippyside flippyside changed the title Add Notation to WithMetadataList in pkg/ddc/base/runtime.go This PR is to add comments to WithMetadataList in pkg/ddc/base/runtime.go. Jun 6, 2026
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 WithMetadataList in pkg/ddc/base/runtime.go.

1 participant