Skip to content

ci(api-v2): publish the Platform API v2 image and fix its declaration build - #72

Merged
JOY (JOY) merged 2 commits into
mainfrom
dev
Sep 13, 2026
Merged

JOY (JOY) merged 2 commits into
mainfrom
dev

Conversation

@JOY

@JOY JOY (JOY) commented Sep 13, 2026

Copy link
Copy Markdown

Adds a workflow that builds apps/api/v2/Dockerfile and publishes ghcr.io/dos/crove-cal-api, so the Platform API v2 can be deployed as its own service - the web image rewrites /api/v2/* to a calcom-api service that did not exist until now. Also fixes the build itself: nest build failed with six TS4094 errors inside packages/prisma/generated/prisma/internal/prismaNamespace.ts because declaration emit cannot represent the #private marker Prisma generates. apps/api/v2 is an application whose entrypoint is dist/apps/api/v2/src/main.js and nothing in the repo imports @calcom/api-v2, so declaration output was never consumed. Build args for prisma generate are format-valid placeholders rather than production credentials, since generate only parses the schema and real values would be baked into image layers. Note: the image builds and publishes, but running it still needs a packaging fix - packages/prisma declares main: index.ts with no compiled output, which plain node cannot load.


Note

Low Risk
Changes are limited to CI packaging and TypeScript build output; database URLs in the workflow are placeholders and runtime config is unchanged by this diff.

Overview
Adds GitHub Actions to build apps/api/v2/Dockerfile and push ghcr.io/dos/crove-cal-api (latest and commit SHA) on pushes to dev/main when API v2, shared packages, or the workflow change, with manual workflow_dispatch support.

The workflow uses Buildx, GHCR login via GITHUB_TOKEN, GHA layer cache scoped to api-v2, and cache-to mode=min so a build stage that sets DATABASE_URL in ENV is not fully cached. DATABASE_URL / DATABASE_DIRECT_URL build-args are dummy connection strings for prisma generate only, avoiding real secrets in image layers.

apps/api/v2/tsconfig.json sets declaration: false so nest build no longer emits .d.ts and fails on Prisma’s #private types (TS4094); API v2 is not consumed as a published typings package.

Reviewed by Cursor Bugbot for commit 6752eeb. Configure here.

Summary by CodeRabbit

  • Chores

    • Added automated Docker image builds and publishing for API v2 deployments.
    • Added support for both automatic builds on relevant branch changes and manually triggered builds.
  • Refactor

    • API v2 builds no longer generate TypeScript declaration files.

JOY added 2 commits September 13, 2026 02:43
The web image rewrites /api/v2/* to the calcom-api service, but that service was never deployed, so every Platform API v2 call against cal.crove.com failed. Publishes ghcr.io/dos/crove-cal-api from apps/api/v2/Dockerfile. Build args for prisma generate are format-valid placeholders rather than production credentials, because generate only parses the schema and real build args would be baked into image layers.
… compile

nest build failed with six TS4094 errors inside packages/prisma/generated/prisma/internal/prismaNamespace.ts because declaration emit cannot represent the #private marker Prisma generates. apps/api/v2 is an application whose entrypoint is dist/apps/api/v2/src/main.js, and nothing in the repo imports @calcom/api-v2, so the emitted .d.ts files were never consumed.
@cursor

cursor Bot commented Sep 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_850a1332-3819-4c61-8699-65c2882e971b)

@JOY
JOY (JOY) merged commit 4659d1a into main Sep 13, 2026
28 of 29 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the TypeScript configuration in apps/api/v2/tsconfig.json to set the declaration option to false, disabling the generation of declaration files. There are no review comments, and I have no feedback to provide.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 6d35e048-3d9d-43c8-9104-e9a89843a913

📥 Commits

Reviewing files that changed from the base of the PR and between 9b308e3 and 6752eeb.

📒 Files selected for processing (2)
  • .github/workflows/deploy-api-v2-docker.yml
  • apps/api/v2/tsconfig.json

📝 Walkthrough

Walkthrough

API v2 no longer emits TypeScript declaration files. A new GitHub Actions workflow builds and pushes the API v2 Docker image to GHCR on selected branch changes or manual dispatch.

Changes

API v2 delivery

Layer / File(s) Summary
API v2 compiler output
apps/api/v2/tsconfig.json
The declaration compiler option is set to false, so compilation does not emit .d.ts files.
API v2 container publishing
.github/workflows/deploy-api-v2-docker.yml
A workflow builds the API v2 Dockerfile and pushes latest and commit SHA tags to GHCR. It runs for selected paths on dev and main, or through manual dispatch. It uses Buildx caching and placeholder database build arguments.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant DockerBuildx
  participant GHCR
  GitHubActions->>DockerBuildx: Build API v2 Docker image
  DockerBuildx->>GHCR: Push latest and commit SHA tags
Loading
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Warning

Some tools did not complete. Review the errors below.

🔧 Biome (2.5.10)
apps/api/v2/tsconfig.json

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.


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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant