Repository navigation
Clean up shared code quality issues - #544
Conversation
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThree maintenance handlers ( ChangesShared Utility Extraction and Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 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 docstrings
🧪 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 |
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
|
🔎 Preview deployed: https://kody-pr-544.kentcdodds.workers.dev Worker: Mocks:
|
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 `@packages/worker/src/mcp/capabilities/jobs/shared.ts`:
- Around line 394-395: The exhaustiveness check using the never type assignment
for the `exhaustive` variable enforces compile-time safety, but the code then
returns this variable, which allows invalid `schedule` objects to pass through
at runtime. Instead of returning `exhaustive`, throw an error to fail fast when
malformed data reaches this code path. Apply this change to both occurrences
(around lines 394-395 and 418-419) by replacing the return statement with a
throw statement that includes a descriptive error message about the unexpected
schedule value.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6bdcf1d0-fb02-42d0-85c0-6d828a6c5369
📒 Files selected for processing (35)
packages/worker/src/capability-maintenance.tspackages/worker/src/env-schema.tspackages/worker/src/job-maintenance.tspackages/worker/src/jobs/schedule.tspackages/worker/src/maintenance-handler.node.test.tspackages/worker/src/maintenance-handler.tspackages/worker/src/mcp/capabilities/apps/domain.tspackages/worker/src/mcp/capabilities/coding/domain.tspackages/worker/src/mcp/capabilities/coding/kody-official-guide.tspackages/worker/src/mcp/capabilities/email/email-inbox-list.tspackages/worker/src/mcp/capabilities/jobs/domain.tspackages/worker/src/mcp/capabilities/jobs/job-get.tspackages/worker/src/mcp/capabilities/jobs/job-list.tspackages/worker/src/mcp/capabilities/jobs/shared.tspackages/worker/src/mcp/capabilities/meta/domain.tspackages/worker/src/mcp/capabilities/meta/meta-get-current-user.tspackages/worker/src/mcp/capabilities/meta/meta-get-mcp-server-instructions.tspackages/worker/src/mcp/capabilities/meta/meta-list-remote-connector-status.tspackages/worker/src/mcp/capabilities/packages/domain.tspackages/worker/src/mcp/capabilities/packages/list-packages.tspackages/worker/src/mcp/capabilities/services/domain.tspackages/worker/src/mcp/capabilities/types.tspackages/worker/src/mcp/capabilities/values/integration-list.tspackages/worker/src/mcp/memory/json-string-array.node.test.tspackages/worker/src/mcp/memory/json-string-array.tspackages/worker/src/mcp/memory/memory-embed.tspackages/worker/src/mcp/memory/memory-search.tspackages/worker/src/mcp/memory/service.tspackages/worker/src/mcp/resources/generated-ui-app-resource.tspackages/worker/src/mcp/secrets/allowed-capabilities.tspackages/worker/src/mcp/secrets/allowed-hosts.tspackages/worker/src/mcp/secrets/allowed-packages.tspackages/worker/src/mcp/secrets/allowed-string-list.node.test.tspackages/worker/src/mcp/secrets/allowed-string-list.tspackages/worker/src/memory-maintenance.ts
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Summary
Larger follow-up
connect-oauth.tsxhelper extraction opportunity.Testing
npx vitest run --project node-unit packages/worker/src/maintenance-handler.node.test.ts packages/worker/src/mcp/secrets/allowed-string-list.node.test.ts packages/worker/src/mcp/memory/service.node.test.ts packages/worker/src/mcp/secrets/service.node.test.ts packages/worker/src/app/handlers/account-secrets.node.test.tsnpx vitest run --project node-unit packages/worker/src/mcp/capabilities/jobs/job-schedule.node.test.ts packages/worker/src/jobs/schedule.node.test.tsnpm run typechecknpm run validateSummary by CodeRabbit
Refactor
Tests