feat: make seed-performance-testing script configurable from CLI#29557
feat: make seed-performance-testing script configurable from CLI#29557SinghaAnirban005 wants to merge 2 commits into
Conversation
|
Welcome to Cal.diy, @SinghaAnirban005! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis pull request refactors the performance testing seed script to support CLI-driven configuration and programmatic test data generation. It adds dotenv integration and a 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/seed-performance-testing.ts`:
- Around line 34-40: parseNonNegativeInt currently uses parseInt which accepts
truncated/ambiguous inputs (e.g. "10abc", "3.5"); change it to strictly validate
the raw string before conversion: require raw (or fallback string) to match the
integer-regex /^[0-9]+$/ (reject empty/negative/decimal/trailing chars), then
parse with Number or parseInt and ensure Number.isFinite and >= 0. Update
parseNonNegativeInt to accept the flag name (already present) and produce the
same exit/error behavior for invalid inputs; this will harden CLI flags like
--bookings, --start-from, and --till-user against malformed values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a462535c-ae7d-4c3e-8c3d-ae4d5644bdcd
📒 Files selected for processing (1)
scripts/seed-performance-testing.ts
What does this PR do?
Resolves the
TODO: Make it more structured and configurable from CLIinseed-performance-testing.ts.Video Demo (if applicable):
Screencast.from.2026-04-26.19-30-14.webm
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Run
docker-compose up -d databasecd into /scripts
Three modes are available
--bookings <n>— number of bookings per event type (default:100)--start-from <n>— start user index for many-users mode (default:0), enables resuming an interrupted run--till-user <n>— end user index for many-users mode (default:20)--mode many-bookings | many-users— replaces the previously commented-outcreateManyDifferentUserscallExamples