Skip to content

Comments

perf: create quarantine tRPC router for app-store dependent handlers#23555

Closed
keithwillcode wants to merge 19 commits intomainfrom
devin/quarantine-trpc-router-1756917282
Closed

perf: create quarantine tRPC router for app-store dependent handlers#23555
keithwillcode wants to merge 19 commits intomainfrom
devin/quarantine-trpc-router-1756917282

Conversation

@keithwillcode
Copy link
Contributor

What does this PR do?

This PR creates a new "quarantine" tRPC router to isolate all handlers that import from @calcom/app-store. The goal is to separate app-store dependencies for easier management and assessment.

Key changes:

  • New quarantine router: Created packages/trpc/server/routers/viewer/quarantine/_router.tsx
  • Moved 28+ handlers: Relocated handlers from various routers (apps, payments, eventTypes, bookings, me, etc.) that depend on @calcom/app-store
  • Updated client references: Changed all client-side calls from trpc.viewer.appRoutingForms.* to trpc.viewer.quarantine.appRoutingForms.* (and similar for appBasecamp3)
  • Organized by function: Handlers are organized into subdirectories: apps/, payments/, eventTypes/, bookings/, me/, misc/

Requested by: @keithwillcode
Link to Devin run: https://app.devin.ai/sessions/f451fc6dd4da49f2adc2bae6b8a3932e

Visual Demo (For contributors especially)

N/A - This is an internal API restructuring without UI changes.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A - No documentation changes required for internal API restructuring
  • ⚠️ CRITICAL: Automated tests need verification - this PR moves live endpoints and requires thorough testing

How should this be tested?

⚠️ HIGH PRIORITY TESTING NEEDED - This PR moves 28+ live API endpoints:

  1. Verify quarantine router registration: Check that /api/trpc/quarantine/[trpc].ts endpoint exists and routes correctly
  2. Test moved handlers: Verify each category of moved handlers still works:
    • Apps: App installation, toggling, key saving (appById, toggle, saveKeys, etc.)
    • Routing Forms: Form creation, editing, deletion (appRoutingForms.*)
    • Basecamp3: Project integration (appBasecamp3.*)
    • Payments: Card charging functionality
    • Bookings: Confirmation, location editing, reschedule requests
    • Event Types: Creation and updates with app integrations
  3. Check client integration: Test that updated client calls (using quarantine.appRoutingForms.*) work in the actual UI
  4. Verify no missing references: Search codebase for remaining appRoutingForms or appBasecamp3 references that weren't updated

Environment setup: Standard Cal.com development environment with app-store integrations enabled.

Critical Review Points

⚠️ High Risk Items for Review:

  1. Handler registration: Verify all 28+ moved handlers are correctly registered in the quarantine router
  2. Import path accuracy: Check that all relative import paths were updated correctly when moving files
  3. Client-side completeness: Ensure ALL references to appRoutingForms and appBasecamp3 were updated to use quarantine paths
  4. No duplicated handlers: Confirm handlers were removed from original routers and not accidentally duplicated
  5. API endpoint accessibility: Test that the new quarantine endpoints are actually reachable via HTTP

Scope concerns: This PR touches 59 files with 5000+ line changes. The large scope increases risk of subtle integration issues that may not surface until runtime.

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

- Created new quarantine router at packages/trpc/server/routers/viewer/quarantine/
- Moved 28+ handlers that import from @calcom/app-store to quarantine router
- Organized handlers into subdirectories: apps, payments, eventTypes, bookings, me, misc
- Updated all import paths and router registrations
- Removed moved handlers from original routers
- Registered quarantine router in main viewer router
- Updated all client-side references to use quarantine.appRoutingForms and quarantine.appBasecamp3

This isolates all app-store dependencies into a single quarantine router for easier management and assessment.

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 3, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/quarantine-trpc-router-1756917282

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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@keithwillcode keithwillcode added core area: core, team members only foundation labels Sep 3, 2025
- Created API route at apps/web/pages/api/trpc/quarantine/[trpc].ts
- Added 'quarantine' to ENDPOINTS array in packages/trpc/react/shared.ts
- Updated resolveEndpoint functions in both Pages and App Router tRPC clients
- Added support for 4-segment paths like viewer.quarantine.appRoutingForms.forms
- Quarantine router is now fully accessible via tRPC client calls

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
@vercel
Copy link

vercel bot commented Sep 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Sep 4, 2025 0:18am
cal-eu Ignored Ignored Sep 4, 2025 0:18am

…p3 handler types

- Update 23 frontend files to use quarantine router paths (e.g. trpc.viewer.quarantine.updateProfile)
- Fix basecamp3 handler type compatibility by passing explicit context structure
- Remove forbidden 'as any' type casting for proper type safety
- All handlers properly moved with git mv to preserve file history

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
devin-ai-integration bot and others added 2 commits September 3, 2025 18:36
- Update PrismaClient import from @calcom/prisma/client to @calcom/prisma
- Ensures type compatibility with tRPC context prisma client
- Fixes remaining TypeScript errors in quarantine router

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
- Move 71+ handlers from original routers to quarantine using git mv operations
- Update all frontend imports to use quarantine router paths
- Clean up original routers by removing moved handlers and imports
- Fix import paths in moved handlers for new directory structure
- Add nested routers (appRoutingForms, appBasecamp3) to quarantine
- Update tRPC client configuration to support 4-part router paths
- Create quarantine API endpoint at /api/trpc/quarantine/[trpc].ts
- Preserve file history through proper git move operations
- Remove duplicate handlers from apps, payments, eventTypes, bookings, me routers
- Fix localStorage import and remove unused handler cache types
- Resolve basecamp3 handler Prisma type compatibility issues

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
devin-ai-integration bot and others added 2 commits September 3, 2025 19:14
…g context

- Import bookingsProcedure in quarantine router for handlers that need booking context
- Fix API routes to use viewerRouter instead of bookingsRouter to access quarantine router
- Update RerouteDialog test mocks to use quarantine router paths
- Resolve remaining TypeScript errors and test compatibility issues

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
- Update all remaining frontend components to use quarantine router paths
- Fix import references in test files and component wrappers
- Ensure all app-store dependent handlers are properly routed through quarantine
- Complete the quarantine router implementation with all necessary changes

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
devin-ai-integration bot and others added 5 commits September 3, 2025 20:14
…arantine router

- Fix TestFormDialog.test.tsx mock to use quarantine router path for findTeamMembersMatchingAttributeLogicOfRoute
- Update next/navigation mock to include useSearchParams, useParams, and ReadonlyURLSearchParams
- Update btcpayserver, hitpay, and paypal setup pages to use quarantine.saveKeys instead of apps.updateAppCredentials
- All 13 TestFormDialog tests now passing locally

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
…uter paths

- Update AppPage, CalendarListContainer, ConnectCalendars, ConnectedVideoStep components
- Update installed-category-view to use quarantine router for integrations and conferencing apps
- Update alby, make, wipemycalother, zapier setup pages to use quarantine.saveKeys
- Update EventAppsTab, InstantEventController, EventWebhooksTab, webhook-edit-view
- Update AdditionalCalendarSelector and EventTypeWebWrapper components
- Complete quarantine router implementation with all client-side calls updated

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
…e correct router paths

- Move eventTypes.get mock back to main viewer router (not moved to quarantine)
- Update locationOptions mock to use quarantine router path
- Fix test failures for components using quarantine router handlers

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
- Update outOfOffice.handler.test.ts to import from quarantine/misc
- Update confirm.handler.test.ts to import from quarantine/bookings
- Update editLocation.handler.test.ts to import from quarantine/bookings
- Resolves test failures due to moved handlers in quarantine router

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
- Update relative path from ../quarantine to ../../quarantine
- Resolves test import error for editLocation.handler.test.ts

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
…heck

- Replace non-null assertion with safe conditional check in embed.ts
- Change any type to unknown type in embed.test.ts for better type safety
- Prefix unused variable with underscore in EmbedElement.test.ts
- Add proper null check for custom element in EmbedElement.test.ts

These fixes address pre-existing lint issues that were blocking the required CI check.

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
devin-ai-integration bot and others added 3 commits September 3, 2025 23:08
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2025

E2E results are ready!

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
…isma/client to @calcom/prisma/enums

- Update eventTypes/update.handler.ts to import WorkflowTriggerEvents from @calcom/prisma/enums
- Update me/checkForInvalidAppCredentials.ts to import MembershipRole from @calcom/prisma/enums
- Integrate latest changes from main branch into quarantine router files

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
@keithwillcode keithwillcode changed the title feat: create quarantine tRPC router for app-store dependent handlers perf: create quarantine tRPC router for app-store dependent handlers Sep 4, 2025
@keithwillcode
Copy link
Contributor Author

Closing in favor of smaller PRs like #23664

@keithwillcode keithwillcode deleted the devin/quarantine-trpc-router-1756917282 branch September 17, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant