-
-
Notifications
You must be signed in to change notification settings - Fork 145
visibility updates #1325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
visibility updates #1325
Conversation
WalkthroughThe visibility of several structs and struct fields was updated from private to public in two modules. Specifically, the Changes
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/prism/home/mod.rs (1)
64-68
: Consider encapsulation implications of making fields public.While making these
HomeResponse
fields public enables external access to response data, it breaks encapsulation by allowing direct field modification. Consider whether accessor methods might be more appropriate for maintaining data integrity.If direct field access is intentional for serialization/deserialization purposes, this change is acceptable. However, if data integrity is a concern, consider implementing getter methods instead:
#[derive(Debug, Serialize)] pub struct HomeResponse { - pub alerts_info: AlertsInfo, - pub stats_details: Vec<DatedStats>, - pub datasets: Vec<DataSet>, + alerts_info: AlertsInfo, + stats_details: Vec<DatedStats>, + datasets: Vec<DataSet>, } + +impl HomeResponse { + pub fn alerts_info(&self) -> &AlertsInfo { + &self.alerts_info + } + + pub fn stats_details(&self) -> &[DatedStats] { + &self.stats_details + } + + pub fn datasets(&self) -> &[DataSet] { + &self.datasets + } +}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/handlers/http/llm.rs
(1 hunks)src/prism/home/mod.rs
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: Build Default x86_64-pc-windows-msvc
- GitHub Check: Build Default aarch64-apple-darwin
- GitHub Check: Build Default x86_64-apple-darwin
- GitHub Check: Build Default aarch64-unknown-linux-gnu
- GitHub Check: Build Kafka aarch64-apple-darwin
- GitHub Check: Build Default x86_64-unknown-linux-gnu
- GitHub Check: Quest Smoke and Load Tests for Distributed deployments
- GitHub Check: coverage
- GitHub Check: Build Kafka x86_64-unknown-linux-gnu
- GitHub Check: Quest Smoke and Load Tests for Standalone deployments
🔇 Additional comments (2)
src/prism/home/mod.rs (2)
43-48
: LGTM: DatedStats visibility change is appropriate.Making
DatedStats
public is reasonable as it contains statistical data that external consumers may need to access. The fields represent standard metrics data without sensitive information.
58-61
: LGTM: DataSet visibility change enables external integration.The
DataSet
struct contains dataset metadata that's appropriate for public API exposure, enabling external systems to work with dataset information.
Fixes #XXXX.
Description
This PR has:
Summary by CodeRabbit