Conversation
📝 WalkthroughWalkthroughCron validation in a shared utility is rewritten from regex-based checks to explicit numeric-bounds validation supporting wildcards, ranges, and steps. AdvancedCronSelect gains an optional validity callback and controlled-value handling. CronInput tracks per-field validity, uses unpadded numeric options, and disables the Save button when a field is invalid or a save mutation is pending. ChangesCron validation and UI wiring
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant AdvancedCronSelect
participant isValidCronPart
participant CronInput
User->>AdvancedCronSelect: edit cron field value
AdvancedCronSelect->>isValidCronPart: validate(type, value)
isValidCronPart-->>AdvancedCronSelect: valid boolean
AdvancedCronSelect->>CronInput: onValidityChange(valid)
CronInput->>CronInput: update fieldValidity, derive hasInvalidField
CronInput->>CronInput: disable Save button if invalid or pending
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. 🔧 ESLint
src/features/database/components/cron-advanced-select.tsxOops! Something went wrong! :( ESLint: 9.39.4 TypeError: Converting circular structure to JSON ... [truncated 446 characters] ... c/dist/eslintrc.cjs:3261:25) src/features/database/components/cron-input.tsxOops! Something went wrong! :( ESLint: 9.39.4 TypeError: Converting circular structure to JSON ... [truncated 446 characters] ... c/dist/eslintrc.cjs:3261:25) src/utils/cron.tsOops! Something went wrong! :( ESLint: 9.39.4 TypeError: Converting circular structure to JSON ... [truncated 446 characters] ... c/dist/eslintrc.cjs:3261:25) 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 `@src/utils/cron.ts`:
- Around line 25-47: isValidCronPart currently assumes value is always a string,
but CronInput can pass undefined through AdvancedCronSelect when cron parts are
missing. Add a falsy/non-string guard at the start of isValidCronPart before any
split/trim logic, and update AdvancedCronSelect so customValue always falls back
to an empty string instead of undefined; use the identifiers isValidCronPart and
AdvancedCronSelect to locate the fix.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 0df42ad0-6d0a-493c-8535-cb53a28cb467
📒 Files selected for processing (3)
src/features/database/components/cron-advanced-select.tsxsrc/features/database/components/cron-input.tsxsrc/utils/cron.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
- GitHub Check: build-image
🔇 Additional comments (3)
src/utils/cron.ts (1)
1-23: LGTM!src/features/database/components/cron-advanced-select.tsx (1)
1-1: LGTM!Also applies to: 15-15, 24-37, 60-60
src/features/database/components/cron-input.tsx (1)
5-5: LGTM!Also applies to: 17-27, 58-103, 128-128
Summary by CodeRabbit
New Features
Bug Fixes