Skip to content

Update mock data#1067

Merged
yujonglee merged 2 commits intomainfrom
update-mock-data
Jul 4, 2025
Merged

Update mock data#1067
yujonglee merged 2 commits intomainfrom
update-mock-data

Conversation

@ComputelessComputer
Copy link
Collaborator

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 3, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The seed data within the seed function in crates/db-user/src/init.rs was extensively reorganized and expanded. Events were divided into future and past groups, and sessions were restructured to align with these events or exist independently. Event and session details, including names, notes, and timestamps, were updated for comprehensive testing coverage. The onboarding function was updated to add two new human entities linked to the Fastrepl organization.

Changes

File(s) Change Summary
crates/db-user/src/init.rs Revised onboarding to add two new humans; completely revised and expanded seed data: reorganized events into future and past, updated event/session details, enhanced session content, and improved linking between sessions and events. No changes to public interfaces.

Sequence Diagram(s)

sequenceDiagram
    participant Onboarding as onboarding()
    participant Seed as seed()
    participant DB as Database

    Onboarding->>DB: Upsert humans (including new entries)
    Onboarding->>DB: Add humans as participants to thank-you session

    Seed->>DB: Insert future events (6)
    Seed->>DB: Insert past events (4)
    Seed->>DB: Retrieve event IDs
    Seed->>DB: Insert sessions linked to future events
    Seed->>DB: Insert sessions linked to past events
    Seed->>DB: Insert standalone sessions
    Seed->>DB: Link sessions to corresponding events
Loading

Possibly related PRs

  • feat(events): Adjust event dates and add new events #922: Both PRs modify the seed data for events in crates/db-user/src/init.rs, with the main PR extensively restructuring and expanding event and session data, while the retrieved PR focuses on adjusting dates of specific past events and adding new standalone events.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Clippy (1.86.0)
Updating git repository `https://github.com/RustAudio/cpal`

error: failed to load source for dependency cpal

Caused by:
Unable to update https://github.com/RustAudio/cpal?rev=51c3b43#51c3b43c

Caused by:
failed to create directory /usr/local/git/db/cpal-476cd1dd23dbc279

Caused by:
Permission denied (os error 13)


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c396c8d and 6d7a74d.

📒 Files selected for processing (1)
  • crates/db-user/src/init.rs (7 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (2)
crates/db-user/src/init.rs (2)

332-339: Consider a more robust approach for event ID extraction.

The current approach extracts event IDs by array index, which could be brittle if the event order changes. Consider using a more explicit mapping or extracting IDs during event creation.

-    // Get IDs for linking sessions to events
-    let daily_standup_event_id = events[0].id.clone(); // Future: Daily Standup (in 15 min)
-    let team_review_event_id = events[1].id.clone(); // Future: Team Review (tomorrow)
-    let product_roadmap_event_id = events[3].id.clone(); // Future: Product Roadmap (in 3 days)
-    let sprint_planning_event_id = events[4].id.clone(); // Future: Sprint Planning (in 7 days)
-    let followup_event_id = events[6].id.clone(); // Past: Follow-up Discussion (yesterday)
-    let kickoff_event_id = events[7].id.clone(); // Past: Project Kickoff (last week)
-    let strategy_event_id = events[8].id.clone(); // Past: Q3 Strategy (10 days ago)
+    // Create event IDs first, then use them in both events and sessions
+    let daily_standup_event_id = uuid::Uuid::new_v4().to_string();
+    let team_review_event_id = uuid::Uuid::new_v4().to_string();
+    let product_roadmap_event_id = uuid::Uuid::new_v4().to_string();
+    let sprint_planning_event_id = uuid::Uuid::new_v4().to_string();
+    let followup_event_id = uuid::Uuid::new_v4().to_string();
+    let kickoff_event_id = uuid::Uuid::new_v4().to_string();
+    let strategy_event_id = uuid::Uuid::new_v4().to_string();

Then use these IDs when creating the events instead of generating new ones.


458-467: Potential memory concern with large word array creation.

Creating a 100x repeated word array could consume significant memory. Consider if this extensive duplication is necessary for testing purposes.

-            words: {
-                let words = serde_json::from_str::<Vec<hypr_listener_interface::Word>>(
-                    &hypr_data::english_4::WORDS_JSON,
-                )
-                .unwrap();
-                let mut repeated = Vec::with_capacity(words.len() * 100);
-                for _ in 0..100 {
-                    repeated.extend(words.clone());
-                }
-                repeated
-            },
+            words: serde_json::from_str::<Vec<hypr_listener_interface::Word>>(
+                &hypr_data::english_4::WORDS_JSON,
+            )
+            .unwrap(),

If large word arrays are needed for testing, consider using a smaller multiplier or creating this data only when specifically needed.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ea2308 and c396c8d.

📒 Files selected for processing (1)
  • crates/db-user/src/init.rs (5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{js,ts,tsx,rs}`: 1. No error handling. 2. No unused imports, variables, or functions. 3. For comments, keep it minimal. It should be about "Why", not "What".

**/*.{js,ts,tsx,rs}: 1. No error handling.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • crates/db-user/src/init.rs
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: ci
🔇 Additional comments (2)
crates/db-user/src/init.rs (2)

184-319: Excellent organization and documentation of test data.

The clear separation between future and past events with detailed comments explaining their testing purposes makes this code very maintainable and understandable.


341-511: Well-structured session organization with comprehensive test coverage.

The sessions are thoughtfully organized into categories (future events, past events, standalone) with meaningful content and proper timestamp relationships. The markdown-to-HTML conversion approach is consistent and appropriate.

@yujonglee yujonglee merged commit 1f1ddd8 into main Jul 4, 2025
2 of 3 checks passed
@yujonglee yujonglee deleted the update-mock-data branch July 4, 2025 00:01
@coderabbitai coderabbitai bot mentioned this pull request Jul 19, 2025
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