Skip to content

chore: deploy api v2 on vercel#26735

Merged
keithwillcode merged 34 commits intomainfrom
deploy-api-v2-vercel
Jan 13, 2026
Merged

chore: deploy api v2 on vercel#26735
keithwillcode merged 34 commits intomainfrom
deploy-api-v2-vercel

Conversation

@ThyMinimalDev
Copy link
Contributor

@ThyMinimalDev ThyMinimalDev commented Jan 12, 2026

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

Updates since last revision

  • Replaced console.log with logger.log in the Vercel serverless handler (line 86) to address Cubic AI review feedback about using the logging framework consistently

Summary by cubic

Deploy API v2 on Vercel by adding a serverless handler with a cached Nest app and adjusting boot logic. Local development startup remains unchanged.

  • New Features

    • Added a Vercel serverless handler that initializes Nest once and reuses the Express instance.
    • Unified query parsing with qs for both Express and the Vercel handler.
    • Disabled shutdown hooks when running on Vercel.
  • Refactors

    • Simplified build script to run only nest build; added build:docker and updated Dockerfile to build platform packages in the correct order.
    • Configured Turbo to cache dist/** outputs for @calcom/api-v2.
    • Updated Biome config to include bootstrap.ts and main.ts.
    • Enabled esModuleInterop and switched cookie-parser to a default import; used Nest logger in the serverless handler and startup code; switched Prisma to PrismaPg adapter in the non-pool path.
    • Standardized USE_POOL handling via Dockerfile and Vite define.

Written for commit 83914bc. Summary will update on new commits.


Link to Devin run: https://app.devin.ai/sessions/c1e01c049b2c42f98010428232035889
Requested by: unknown ()

@ThyMinimalDev ThyMinimalDev requested a review from a team as a code owner January 12, 2026 09:59
@graphite-app graphite-app bot added foundation core area: core, team members only labels Jan 12, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/api/v2/src/main.ts">

<violation number="1" location="apps/api/v2/src/main.ts:86">
P2: Replace console.log with logger.log for consistency with the logging framework</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Contributor

Devin AI is addressing Cubic AI's review feedback

A Devin session has been created to address the issues identified by Cubic AI.

View Devin Session

devin-ai-integration bot and others added 2 commits January 12, 2026 10:07
Address Cubic AI review feedback to use the logging framework
consistently instead of console.log in the serverless handler.

Co-Authored-By: unknown <>
@github-actions
Copy link
Contributor

Devin AI is resolving merge conflicts

This PR has merge conflicts with the main branch. The existing Devin session has been notified to resolve them.

View Devin Session

Devin will:

  1. Merge the latest main into this branch
  2. Resolve any conflicts intelligently
  3. Run lint/type checks to ensure validity
  4. Push the resolved changes

If you prefer to resolve conflicts manually, you can close the Devin session and handle it yourself.

Resolve merge conflict in biome.json by accepting main branch's
broader trpc import restrictions for atoms package.

Co-Authored-By: unknown <>
@keithwillcode keithwillcode added this to the v6.1 milestone Jan 12, 2026
Copy link
Member

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to be sure with comma:true otherwise okay

@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2026

E2E results are ready!

@pull-request-size pull-request-size bot added size/M and removed size/L labels Jan 12, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/api/v2/src/bootstrap.ts">

<violation number="1">
P1: Shutdown hooks are now incorrectly enabled on Vercel. The code change contradicts both the PR description and serverless best practices. According to NestJS documentation, `enableShutdownHooks()` should NOT be called in serverless environments like Vercel/Lambda because shutdown hooks rely on system signals that don't work properly in serverless contexts. This could cause runtime issues, execution timeouts, or improper lifecycle management. Revert to the conditional check or invert the logic to disable shutdown hooks on Vercel.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Contributor

Devin AI is addressing Cubic AI's review feedback

New feedback has been sent to the existing Devin session.

View Devin Session

devin-ai-integration bot and others added 2 commits January 12, 2026 18:31
Wrap usePool with JSON.stringify() to properly serialize the string value.
Without this, Vite injects the raw value as an identifier instead of a
string literal, breaking runtime behavior.

Addresses Cubic AI review feedback (confidence 9/10)

Co-Authored-By: unknown <>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/api/v2/Dockerfile">

<violation number="1" location="apps/api/v2/Dockerfile:22">
P1: Build order violation: platform-libraries is built before its dependencies. The dev:build script in apps/api/v2/package.json shows the correct order: constants → enums → utils → types → libraries → trpc. Move the builds for platform-constants, platform-enums, platform-utils, and platform-types to occur BEFORE the platform-libraries build in the Dockerfile.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Contributor

Devin AI is addressing Cubic AI's review feedback

New feedback has been sent to the existing Devin session.

View Devin Session

devin-ai-integration bot and others added 2 commits January 12, 2026 18:39
Reorder builds to match the dependency graph from dev:build script:
constants → enums → utils → types → libraries → trpc → api-v2

platform-libraries depends on the other platform packages, so they
must be built first.

Addresses Cubic AI review feedback (confidence 9/10)

Co-Authored-By: unknown <>
@github-actions
Copy link
Contributor

Devin AI is resolving merge conflicts

This PR has merge conflicts with the main branch. The existing Devin session has been notified to resolve them.

View Devin Session

Devin will:

  1. Merge the latest main into this branch
  2. Resolve any conflicts intelligently
  3. Run lint/type checks to ensure validity
  4. Push the resolved changes

If you prefer to resolve conflicts manually, you can close the Devin session and handle it yourself.

Resolved conflict in turbo.json by keeping both:
- PR's API-related environment variables
- Main's B2 storage-related environment variables

Co-Authored-By: unknown <>
@keithwillcode
Copy link
Contributor

Waiting for next release before merging

@keithwillcode keithwillcode merged commit 9ad8aa9 into main Jan 13, 2026
49 checks passed
@keithwillcode keithwillcode deleted the deploy-api-v2-vercel branch January 13, 2026 14:31
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.

4 participants