-
-
Notifications
You must be signed in to change notification settings - Fork 159
home checklist api #1527
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
base: main
Are you sure you want to change the base?
home checklist api #1527
Conversation
WalkthroughThe pull request refactors the home response structure by replacing Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
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
🤖 Fix all issues with AI agents
In `@src/prism/home/mod.rs`:
- Around line 193-205: The data_ingested flag is incorrectly computed from
all_streams (which can include unauthorized/internal streams); update the
computation to use the already-filtered datasets instead so it reflects only
authorized, non-internal data the user can see. Replace the data_ingested
assignment (used to build Checklist) to check the filtered datasets collection
(e.g., use datasets.is_empty() or datasets.iter().any(|d| !d.internal) depending
on existing dataset filtering) so Checklist.data_ingested correctly reports
visible data; keep the rest of the Checklist construction unchanged and
reference variables Checklist, data_ingested, all_streams, and datasets to
locate the change.
| // Generate checklist | ||
| let data_ingested = !all_streams.is_empty(); | ||
| let alert_created = alerts_summary.total > 0; | ||
| let user_count = users().len(); | ||
| let user_added = user_count > 1; // more than just the default admin user | ||
|
|
||
| let checklist = Checklist { | ||
| data_ingested, | ||
| metrics_dataset: has_metrics_dataset, | ||
| keystone_created: false, // Enterprise will override | ||
| alert_created, | ||
| user_added, | ||
| }; |
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.
Align data_ingested with authorized/non-internal datasets to avoid false positives and info leakage.
all_streams includes unauthorized/internal streams, so data_ingested can be true even when the user sees none. Consider basing it on datasets (already filtered).
✅ Proposed fix
- let data_ingested = !all_streams.is_empty();
+ let data_ingested = !datasets.is_empty();📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Generate checklist | |
| let data_ingested = !all_streams.is_empty(); | |
| let alert_created = alerts_summary.total > 0; | |
| let user_count = users().len(); | |
| let user_added = user_count > 1; // more than just the default admin user | |
| let checklist = Checklist { | |
| data_ingested, | |
| metrics_dataset: has_metrics_dataset, | |
| keystone_created: false, // Enterprise will override | |
| alert_created, | |
| user_added, | |
| }; | |
| // Generate checklist | |
| let data_ingested = !datasets.is_empty(); | |
| let alert_created = alerts_summary.total > 0; | |
| let user_count = users().len(); | |
| let user_added = user_count > 1; // more than just the default admin user | |
| let checklist = Checklist { | |
| data_ingested, | |
| metrics_dataset: has_metrics_dataset, | |
| keystone_created: false, // Enterprise will override | |
| alert_created, | |
| user_added, | |
| }; |
🤖 Prompt for AI Agents
In `@src/prism/home/mod.rs` around lines 193 - 205, The data_ingested flag is
incorrectly computed from all_streams (which can include unauthorized/internal
streams); update the computation to use the already-filtered datasets instead so
it reflects only authorized, non-internal data the user can see. Replace the
data_ingested assignment (used to build Checklist) to check the filtered
datasets collection (e.g., use datasets.is_empty() or datasets.iter().any(|d|
!d.internal) depending on existing dataset filtering) so Checklist.data_ingested
correctly reports visible data; keep the rest of the Checklist construction
unchanged and reference variables Checklist, data_ingested, all_streams, and
datasets to locate the change.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.