Skip to content

This PR is to add comments to UpdateOnUFSChange in pkg/ddc/alluxio/ufs.go.#5797

Open
morpho327 wants to merge 1 commit intofluid-cloudnative:masterfrom
morpho327:new-branch
Open

This PR is to add comments to UpdateOnUFSChange in pkg/ddc/alluxio/ufs.go.#5797
morpho327 wants to merge 1 commit intofluid-cloudnative:masterfrom
morpho327:new-branch

Conversation

@morpho327
Copy link
Copy Markdown

@morpho327 morpho327 commented Apr 19, 2026

Ⅰ. Describe what this PR does

Add notation to the UpdateOnUFSChange function in fluid/pkg/ddc/alluxio/ufs.go.

Ⅱ. Does this pull request fix one issue?

fixes #5796

III. Special notes for reviews

Signed-off-by: morpho327 <2410653591@qq.com>
@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented Apr 19, 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 Apr 19, 2026

Hi @morpho327. 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.

@sonarqubecloud
Copy link
Copy Markdown

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 UpdateOnUFSChange function in the Alluxio engine. The review feedback suggests refining the documentation for the updateReady return value to improve clarity, correcting the description of when the dataset status is updated, and removing a trailing whitespace.

Comment thread pkg/ddc/alluxio/ufs.go
Comment on lines +137 to +146
// UpdateOnUFSChange handles the updates when the Underlying File System (UFS) changes.
// It checks if an update is required, sets the dataset status to Updating, and processes
// the added or removed mount points for the Alluxio engine.
//
// Parameters:
// - ufsToUpdate (*utils.UFSToUpdate): The object containing information about which UFS paths need to be updated.
//
// Returns:
// - updateReady (bool): Indicates whether the update process is ready or completed.
// - err (error): Returns an error if the status update or UFS processing fails, otherwise returns 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

The documentation for the return value updateReady could be more precise. Currently, it returns false when no update is required, which might be slightly confusing if interpreted as the system not being 'ready'. Additionally, the description of the function's behavior could be clarified to indicate that the status is only set to 'Updating' if an update is actually needed. There is also a trailing whitespace at the end of line 138.

Suggested change
// UpdateOnUFSChange handles the updates when the Underlying File System (UFS) changes.
// It checks if an update is required, sets the dataset status to Updating, and processes
// the added or removed mount points for the Alluxio engine.
//
// Parameters:
// - ufsToUpdate (*utils.UFSToUpdate): The object containing information about which UFS paths need to be updated.
//
// Returns:
// - updateReady (bool): Indicates whether the update process is ready or completed.
// - err (error): Returns an error if the status update or UFS processing fails, otherwise returns nil.
// UpdateOnUFSChange handles the updates when the Underlying File System (UFS) changes.
// It checks if an update is required, and if so, sets the dataset status to Updating
// and processes the added or removed mount points for the Alluxio engine.
//
// Parameters:
// - ufsToUpdate (*utils.UFSToUpdate): The object containing information about which UFS paths need to be updated.
//
// Returns:
// - updateReady (bool): Returns true if the update was successfully performed, or false if no update was needed or an error occurred.
// - err (error): Returns an error if the status update or UFS processing fails, otherwise returns nil.

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented Apr 21, 2026

/ok-to-test

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.46%. Comparing base (041354d) to head (d4be3be).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5797   +/-   ##
=======================================
  Coverage   58.46%   58.46%           
=======================================
  Files         473      473           
  Lines       32222    32222           
=======================================
  Hits        18839    18839           
  Misses      11836    11836           
  Partials     1547     1547           

☔ 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.

Copy link
Copy Markdown
Collaborator

@cheyang cheyang left a comment

Choose a reason for hiding this comment

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

The comment addition and new Ginkgo tests for webhook controller look good. A few observations:

  1. Comment quality — The UpdateOnUFSChange doc comment is helpful, clearly describing parameters and return values.

  2. Test refactoring — Good improvement: replacing gomonkey.ApplyFunc for env var mocking with GinkgoT().Setenv() is cleaner and more reliable.

  3. Suite package changemutating_suite_test.go changed from mutating_test to mutating package. This is correct for Ginkgo v2 (suite file should be in the same package as the tested code).

However, lint (gofmt) check is failing. Please run make fmt or gofmt -w on the changed Go files and push again:

make fmt
git add -A
git commit --amend --no-edit
git push -f

Once lint passes, I'll approve.

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 UpdateOnUFSChange in fluid/pkg/ddc/alluxio/ufs.go

2 participants