Conversation
|
🔊@oopscompiled 🚀Thanks for your contribution🎉! 💡CodeRabbit(AI) will review your code first🔥! Note 🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥. |
WalkthroughRemoved an informational log from long-polling hold service, renamed Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR addresses three small enhancements across the RocketMQ Rust workspace: standardizing time retrieval in broker stats scheduling, clarifying the message buyer-id accessor naming, and removing dead/commented logging code in long polling.
Changes:
- Switch
BrokerStatsManager::compute_initial_delay_to_next_minuteto userocketmq_common::TimeUtils::get_current_millis. - Rename
MessageTrait::get_buyer_idtoMessageTrait::buyer_id. - Remove commented-out
info!logging fromPullRequestHoldService.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rocketmq-store/src/stats/broker_stats_manager.rs | Uses shared TimeUtils helper for current timestamp when aligning scheduled tasks to minute boundaries. |
| rocketmq-common/src/common/message.rs | Renames buyer-id accessor on MessageTrait to buyer_id. |
| rocketmq-broker/src/long_polling/long_polling_service/pull_request_hold_service.rs | Cleans up unused/commented logging in the hold-request scanning loop. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -326,7 +326,7 @@ pub trait MessageTrait: Any + Display + Debug { | |||
| /// # Returns | |||
| /// | |||
| /// An `Option<String>` containing the buyer ID if it exists, otherwise `None`. | |||
There was a problem hiding this comment.
The docstring says this returns Option<String>, but the signature returns Option<CheetahString>. Please update the documentation to match the actual return type to avoid misleading API consumers.
| /// An `Option<String>` containing the buyer ID if it exists, otherwise `None`. | |
| /// An `Option<CheetahString>` containing the buyer ID if it exists, otherwise `None`. |
| fn buyer_id(&self) -> Option<CheetahString> { | ||
| self.property(&CheetahString::from_static_str(MessageConst::PROPERTY_BUYER_ID)) | ||
| } | ||
|
|
There was a problem hiding this comment.
Renaming get_buyer_id to buyer_id is a breaking change for downstream crates implementing/using MessageTrait. Consider keeping a deprecated get_buyer_id default method that forwards to buyer_id() for at least one release to preserve backward compatibility.
| /// Deprecated compatibility method for retrieving the buyer ID. | |
| /// | |
| /// This method is kept for backward compatibility with older versions | |
| /// of the API. Prefer using [`buyer_id`] instead. | |
| #[deprecated( | |
| note = "get_buyer_id is deprecated, use buyer_id() instead. This method may be removed in a future release." | |
| )] | |
| fn get_buyer_id(&self) -> Option<CheetahString> { | |
| self.buyer_id() | |
| } |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6586 +/- ##
==========================================
- Coverage 42.16% 41.84% -0.32%
==========================================
Files 946 956 +10
Lines 132145 133557 +1412
==========================================
+ Hits 55714 55882 +168
- Misses 76431 77675 +1244 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rocketmq-rust-bot
left a comment
There was a problem hiding this comment.
LGTM - All CI checks passed ✅
mxsm
left a comment
There was a problem hiding this comment.
@oopscompiled You can take on more challenging tasks while hoping that one PR solves one problem. Simple PRs can be left for those who have just entered open source.
Which Issue(s) This PR Fixes(Closes)
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
Refactor
Chores