Skip to content

fix: add @calcom/api-v2 to dev:api script#28738

Open
Vitalini wants to merge 4 commits into
calcom:mainfrom
Vitalini:fix/add-api-v2-to-dev-script
Open

fix: add @calcom/api-v2 to dev:api script#28738
Vitalini wants to merge 4 commits into
calcom:mainfrom
Vitalini:fix/add-api-v2-to-dev-script

Conversation

@Vitalini
Copy link
Copy Markdown

@Vitalini Vitalini commented Apr 4, 2026

Problem

The dev:api script in the root package.json starts the web app, API proxy, and API v1 via Turborepo filters, but does not include @calcom/api-v2. Developers working on API v2 need to start it separately.

Solution

Add --filter="@calcom/api-v2" to the dev:api turbo command:

- "dev:api": "turbo run dev --filter=\"@calcom/web\" --filter=\"@calcom/api-proxy\" --filter=\"@calcom/api\"",
+ "dev:api": "turbo run dev --filter=\"@calcom/web\" --filter=\"@calcom/api-proxy\" --filter=\"@calcom/api\" --filter=\"@calcom/api-v2\"",

This ensures both API v1 and v2 start together during local development.

Fixes #28736

@Vitalini Vitalini requested a review from a team as a code owner April 4, 2026 18:12
@github-actions github-actions Bot added the 🐛 bug Something isn't working label Apr 4, 2026
Copy link
Copy Markdown
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.

No issues found across 1 file

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a90decd3-c5da-4dc4-88fe-59b916da5dc3

📥 Commits

Reviewing files that changed from the base of the PR and between 3734ea6 and e4116e1.

📒 Files selected for processing (1)
  • apps/api/index.js

📝 Walkthrough

Walkthrough

Updated monorepo dev scripts to include the @calcom/api-v2 workspace in turbo run filters. In the API app, hard-coded ports were replaced with environment-driven constants (PROXY_PORT, API_V1_PORT, API_V2_PORT), proxy targets now use those ports, the v2 proxy is mounted before the root proxy, and the server listens on PROXY_PORT.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive The changes to apps/api/index.js (replacing hard-coded ports with environment variables) appear to be scope-related infrastructure improvements supporting the v2 server integration, though this goes slightly beyond the simple filter addition described in the PR title. Clarify whether the port configuration changes in apps/api/index.js are necessary for the v2 integration or represent scope creep; consider splitting into separate PRs if the port changes are unrelated improvements.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly describes the main change: adding @calcom/api-v2 to the dev:api script, which matches the primary objective of the changeset.
Description check ✅ Passed The description explains the problem and solution, directly relating to the changes made in package.json and apps/api/index.js to include @calcom/api-v2 in development scripts.
Linked Issues check ✅ Passed The PR addresses issue #28736 by adding @calcom/api-v2 filter to dev:api and dev:api:console scripts in package.json, and updates apps/api/index.js to use environment-driven configuration for ports to support the v2 server startup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

@sahitya-chandra sahitya-chandra added ready-for-e2e run-ci Approve CI to run for external contributors labels Apr 9, 2026
sahitya-chandra
sahitya-chandra previously approved these changes Apr 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active.

@github-actions github-actions Bot added the Stale label Apr 17, 2026
@Vitalini
Copy link
Copy Markdown
Author

Thanks for the ping. This PR is ready from my side and still relevant. Please let me know if you’d like any changes, and I can update it promptly.

@github-actions github-actions Bot removed the Stale label Apr 18, 2026
Copy link
Copy Markdown
Member

@romitg2 romitg2 left a comment

Choose a reason for hiding this comment

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

@Vitalini please resolve merge conflicts

@Vitalini
Copy link
Copy Markdown
Author

@romitg2 rebased onto latest main and resolved conflicts in package.json. The final diff now only adds @calcom/api-v2 filter to dev:api and dev:api:console scripts (upstream had already removed the @calcom/api filter). Ready for another look 🙏

Vitalini and others added 2 commits April 28, 2026 11:13
The dev:api script starts the web app, API proxy, and API v1 for local
development, but omits API v2. This means developers working on API v2
need to start it separately or use a different script.

Add --filter="@calcom/api-v2" to the dev:api turbo command so that
both API versions start together during local development.

Fixes calcom#28736
@Vitalini Vitalini force-pushed the fix/add-api-v2-to-dev-script branch from 79dce8d to 9d7ca1c Compare April 28, 2026 15:13
@romitg2 romitg2 enabled auto-merge (squash) May 6, 2026 21:07
@romitg2 romitg2 added run-ci Approve CI to run for external contributors and removed run-ci Approve CI to run for external contributors labels May 6, 2026
romitg2
romitg2 previously approved these changes May 6, 2026
@romitg2 romitg2 disabled auto-merge May 6, 2026 21:11
- API_V1_PORT defaults to 3000 (matching web's default)
- API_V2_PORT defaults to 5555 (matching api-v2's default)
- API_PROXY_PORT defaults to 3002
- Fixed route order: /v2 before / to prevent catch-all
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 7, 2026

CLA assistant check
All committers have signed the CLA.

@Vitalini
Copy link
Copy Markdown
Author

Vitalini commented May 8, 2026

Thanks @romitg2 — really nice catch on the middleware ordering. With apiProxyV1 mounted at / ahead of /v2, every /v2/* request was being shadowed by the v1 proxy and never reaching the v2 mount, so dev:api adding @calcom/api-v2 would have started the process but no traffic would have flowed to it. The env-driven ports are a nice cleanup on top of that — makes the multi-API local setup much easier to override per machine.

Glad to keep this moving — let me know if there's anything you'd like me to do on my side.

@Vitalini
Copy link
Copy Markdown
Author

Quick status update: the CLA is now signed (see the CLAassistant comment above — signed badge). The remaining required check is the external-PR CI gate that needs the run-ci label from a maintainer to trigger. Once that's applied the rest of the workflow should run end-to-end. Thanks for the patience!

@Vitalini Vitalini force-pushed the fix/add-api-v2-to-dev-script branch from 7b0eb06 to e4116e1 Compare May 29, 2026 17:28
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 7, 2026

This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active.

@github-actions github-actions Bot added the Stale label Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working ready-for-e2e run-ci Approve CI to run for external contributors size/S Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvement: Add @calcom/api-v2 to the dev:api script in root package.json

4 participants