Skip to content

Conversation

@nikhilsinhaparseable
Copy link
Contributor

@nikhilsinhaparseable nikhilsinhaparseable commented Jan 23, 2026

Summary by CodeRabbit

  • New Features

    • Added a setup checklist (data ingestion, keystone creation, alert creation, user addition) to indicate completed configuration steps.
    • Exposed a triggered alerts count for quick monitoring of recent alert activity.
  • Removed

    • Historical per-date stats, top-five ingestion view, and the previous alerts summary were simplified/removed.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

Walkthrough

HomeResponse was reshaped: removed alerts_summary, stats_details, and top_five_ingestion; added public Checklist and triggered_alerts_count. generate_home_response now lists streams via PARSEABLE.metastore.list_streams(), applies RBAC filtering, computes checklist booleans and triggered alert count, and returns the new HomeResponse shape.

Changes

Cohort / File(s) Change Summary
Home response type changes
src/prism/home/mod.rs
HomeResponse fields alerts_summary, stats_details, and top_five_ingestion removed. Added checklist: Checklist and triggered_alerts_count: u64. New public Checklist struct (data_ingested, keystone_created, alert_created, user_added) with Serialize, Deserialize, Default. DatedStats removed from public surface.
generate_home_response logic
src/prism/home/mod.rs
Replaced prior concurrent helper calls with PARSEABLE.metastore.list_streams() + RBAC filtering. Removed per-date stats and top-5 ingestion computation. Now computes data_ingested, user_added, alert_created, and triggered_alerts_count, builds Checklist, and returns HomeResponse { datasets, checklist, triggered_alerts_count }.
Imports & visibility
src/prism/home/mod.rs
Adjusted derives/imports for Checklist and serialization (camelCase). Public surface updated to expose Checklist and remove DatedStats. Minor import reorganization to match new logic.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant API as API Handler
participant Metastore as PARSEABLE.metastore
participant RBAC as RBAC Authorizer
participant Alerts as Alerts Store
participant Builder as HomeResponse Builder

API->>Metastore: list_streams()
Metastore-->>API: stream list
API->>RBAC: filter_authorized(streams, session)
RBAC-->>API: authorized streams
API->>Alerts: count_triggered_alerts(authorized_streams)
Alerts-->>API: triggered_alerts_count
API->>Builder: compute checklist (data_ingested, user_added, alert_created, keystone_created)
Builder-->>API: HomeResponse { datasets, checklist, triggered_alerts_count }

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

for next release

Poem

🐰 I hopped through streams and checked each state,
I counted alerts and ticked the slate.
A checklist blooms with boxes neat,
Triggered counts in tidy seat.
Home now hums — a cozy beat.

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is entirely empty, missing all required sections including description, rationale, key changes, and testing/documentation checkboxes. Add a comprehensive description explaining the goal, rationale for API changes, key modifications (new Checklist struct, removed fields), and confirm testing and documentation completion.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'home checklist api' is specific and directly related to the main changes, which introduce a new Checklist type in the HomeResponse API.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 23, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 156-173: The current block uses ALERTS.read().await and calls
alerts.get_all_alerts(), which leaks counts for alerts the user may not be
authorized to see; replace the call to get_all_alerts() with the user-scoped
retrieval (e.g., alerts.get_user_alerts(user_id) or
alerts.get_alerts_for_user(...)) using the current request/user context, then
compute alert_created = !user_alerts.is_empty() and triggered_alerts_count by
filtering user_alerts.values() for AlertState::Triggered; keep references to
ALERTS, get_all_alerts() (to locate the spot), AlertState::Triggered, and the
variables alert_created and triggered_alerts_count when making the change.

@nikhilsinhaparseable nikhilsinhaparseable changed the title home checklist api home api revamp Jan 27, 2026
@nitisht nitisht merged commit bb0901d into parseablehq:main Jan 28, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants