Skip to content

This PR is to add comments to newBitMapAllocator in pkg/ddc/base/portallocator/bitmap_allocator.go.#5737

Merged
cheyang merged 1 commit intofluid-cloudnative:masterfrom
qnsy729:comment-newBitMapAllocator
Mar 31, 2026
Merged

This PR is to add comments to newBitMapAllocator in pkg/ddc/base/portallocator/bitmap_allocator.go.#5737
cheyang merged 1 commit intofluid-cloudnative:masterfrom
qnsy729:comment-newBitMapAllocator

Conversation

@qnsy729
Copy link
Copy Markdown
Contributor

@qnsy729 qnsy729 commented Mar 27, 2026

I. Describe what this PR does

This PR adds function-level comments to newBitMapAllocator in pkg/ddc/base/portallocator/bitmap_allocator.go.

II. Does this pull request fix one issue?

fixes #5736

III. Special notes for reviews

The change only adds comments and does not modify business logic.

@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented Mar 27, 2026

Hi @qnsy729. 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 comments to the newBitMapAllocator function in the port allocator package. A review comment suggests refining the documentation to be more concise and idiomatic by removing redundant information and implementation details, providing a specific code suggestion for the improvement.

Comment on lines +38 to +40
// newBitMapAllocator creates a bitmap-based port allocator for the given port range.
// It initializes the underlying allocator and returns a BitMapAllocator instance.
// It returns an error if the allocator cannot be created.
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

This comment is a bit verbose and contains some repetition. For better readability and adherence to Go's idiomatic documentation style (as described in Effective Go), it could be made more concise.

Specifically:

  • The phrases creates a bitmap-based port allocator and returns a BitMapAllocator instance are redundant.
  • Mentioning that it initializes the underlying allocator is an implementation detail that can be omitted.

A single-line comment would be more idiomatic here.

Suggested change
// newBitMapAllocator creates a bitmap-based port allocator for the given port range.
// It initializes the underlying allocator and returns a BitMapAllocator instance.
// It returns an error if the allocator cannot be created.
// newBitMapAllocator creates a new BitMapAllocator for the given port range, returning an error if creation fails.

@qnsy729
Copy link
Copy Markdown
Contributor Author

qnsy729 commented Mar 27, 2026

/assign @cheyang

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented Mar 30, 2026

感谢你的贡献!🙏

DCO (Developer Certificate of Origin) 检查未通过。请确保所有提交都已签署(sign-off):

修复步骤:

  1. 如果你的分支只有一个提交:
git commit --amend --signoff
git push --force-with-lease origin <branch-name>
  1. 如果有多个提交:
git rebase HEAD~<commit-count> --signoff
git push --force-with-lease origin <branch-name>

参考 DCO 文档了解更多信息。

修复后我会触发 CI 进行测试。有任何问题请随时询问!

…ap_allocator.go.

Signed-off-by: qnsy729 <735178559@qq.com>
@qnsy729 qnsy729 force-pushed the comment-newBitMapAllocator branch from 2ea0d39 to 4ea1a10 Compare March 30, 2026 10:48
@sonarqubecloud
Copy link
Copy Markdown

@qnsy729
Copy link
Copy Markdown
Contributor Author

qnsy729 commented Mar 30, 2026

I received an email titled

[fluid-cloudnative/fluid] PR run failed:.github/workflows/pr-quota-limit.yml - This PR is to add comments tonewBitMapAllocator in pkg/ddc/base/portallocator/bitmap_allocator.go.(4ea1a10)

The failure seems to come from the repository workflow itself, not from my PR changes.
GitHub Actions shows:

Invalid workflow file: .github/workflows/pr-quota-limit.yml#L19
You have an error in your yaml syntax on line 19

I currently have only one open PR, so this does not appear to be a PR quota issue.
Could a maintainer please check the workflow file?

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.

/lgtm
/approve

Clear function documentation for newBitMapAllocator. Comment accurately describes the port allocator creation logic. All CI checks pass.

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented Mar 31, 2026

/ok-to-test

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.22%. Comparing base (242a0bd) to head (4ea1a10).
⚠️ Report is 11 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5737   +/-   ##
=======================================
  Coverage   61.22%   61.22%           
=======================================
  Files         444      444           
  Lines       30557    30557           
=======================================
  Hits        18710    18710           
  Misses      10307    10307           
  Partials     1540     1540           

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

/lgtm
/approve

Clear function documentation for newBitMapAllocator. All CI checks pass.

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented Mar 31, 2026

/lgtm

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented Mar 31, 2026

/approve

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented Mar 31, 2026

/lgtm

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented Mar 31, 2026

/approve

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.

Clear function documentation. All checks pass.

@cheyang
Copy link
Copy Markdown
Collaborator

cheyang commented Mar 31, 2026

/lgtm

@cheyang cheyang merged commit 8de67ca into fluid-cloudnative:master Mar 31, 2026
17 checks passed
@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented Apr 3, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheyang

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

The pull request process is described 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

1 similar comment
@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented Apr 3, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheyang

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

The pull request process is described 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 fluid-e2e-bot Bot added approved and removed lgtm labels Apr 3, 2026
@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented Apr 3, 2026

New changes are detected. LGTM label has been removed.

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 newBitMapAllocator in pkg/ddc/base/portallocator/bitmap_allocator.go.

2 participants