Skip to content

Comments

refactor: v2 use workspace platform libraries#23841

Closed
supalarry wants to merge 2 commits intomainfrom
lauris/cal-6009-refactor-v2-rely-on-workspace-platform-libraries
Closed

refactor: v2 use workspace platform libraries#23841
supalarry wants to merge 2 commits intomainfrom
lauris/cal-6009-refactor-v2-rely-on-workspace-platform-libraries

Conversation

@supalarry
Copy link
Contributor

Linear CAL-6009

@supalarry supalarry requested a review from a team September 15, 2025 11:26
@supalarry supalarry requested a review from a team as a code owner September 15, 2025 11:26
@linear
Copy link

linear bot commented Sep 15, 2025

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 15, 2025

Walkthrough

Updated apps/api/v2 docs and startup scripts to change local/dev flows and Docker narration; replaced yarn dev:no-docker with yarn dev, yarn run start with yarn local in README, and removed the explicit dev:build:watch guidance. apps/api/v2/package.json: dev:build now builds @calcom/platform-libraries; dev no longer runs dev:build; the @calcom/platform-libraries dependency changed from an npm: alias to *. Deleted three automation scripts in packages/platform/libraries/scripts: local.js, prepublish.js, and postpublish.js, removing the repo-level automated version bump/publish/update workflow.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The PR partially implements CAL-6009: apps/api/v2/package.json now points to workspace libraries (dependency changed to "*") and dev:build was extended to include @calcom/platform-libraries, which addresses the workspace-resolution objective; however, the PR removes or fails to provide the watch-based local workflow described in the issue (the README and scripts indicate the dev:build:watch workflow was removed and the dev script no longer invokes dev:build) and deletes scripts that managed prepublish/postpublish/local versioning, and there are no CI changes shown to ensure CI/production explicitly builds and resolves the freshly created artifacts, so several key linked-issue objectives remain unmet. Restore or reintroduce a watch-based local build or ensure the dev script invokes the dependency build and document the local workflow; update CI to explicitly build all v2 dependencies and make v2 resolve those build artifacts during CI runs; and either restore or migrate the removed publish/versioning automation into CI (or split those deletions into a separate PR) so the CI/production and publishing guarantees described in CAL-6009 are preserved.
Out of Scope Changes Check ⚠️ Warning The PR deletes publishing/local helper scripts (packages/platform/libraries/scripts/prepublish.js, postpublish.js, and local.js) and alters publish/versioning-related automation which impacts release and install flows but is not required strictly to make v2 resolve workspace libraries, so those deletions appear to be out-of-scope for the refactor objective. Either revert the publishing-automation deletions or move them into a separate, clearly documented PR that updates CI/publishing behavior with tests; at minimum document the new release process and ensure CI still produces the intended builds so the refactor PR remains focused on workspace dependency resolution only.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly and accurately summarizes the primary change—refactoring v2 to use workspace platform libraries—and is concise and specific enough for a teammate scanning history to understand the main intent of the changeset.
Description Check ✅ Passed The PR description links to Linear issue CAL-6009 and directly relates to the changeset objective of refactoring v2 to rely on workspace platform libraries, so it is on-topic and satisfies this lenient check.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lauris/cal-6009-refactor-v2-rely-on-workspace-platform-libraries

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a3a6a3f and d706af4.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • apps/api/v2/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/api/v2/package.json

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

@graphite-app graphite-app bot requested a review from a team September 15, 2025 11:26
@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels Sep 15, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
apps/api/v2/README.md (3)

61-61: Clarify Nest/CJS rationale; fix casing.

“v2 api … nest.js works only with cjs” is misleading. Nest supports ESM; this project appears to target CJS. Reword for accuracy and casing.

-v2 api can't directly re-use monorepo code because nest.js works only with cjs. Which is why we have dependencies that we first build and watch for changes:
+v2 API can't directly reuse monorepo code because this project targets CommonJS. We build dependent packages and watch for changes:

63-63: Fix markdownlint MD014: drop shell prompt symbols.

Remove leading “$ ” to satisfy MD014 and improve copy/paste.

-$ yarn local
+yarn local
-$ yarn dev
+yarn dev
-$ yarn dev:no-docker
+yarn dev:no-docker

Also applies to: 68-68, 76-76


71-71: Tighten guidance on edits in platform-libraries.

Be explicit about when to rerun the local build vs. relying on auto-restart.

-if you make changes to code that v2 uses from platform-libraries or some other manually built dependency changes then wait for v2 to restart.
+If you change code in platform-libraries or other manually built deps, let v2 auto‑restart. If outputs look stale, rerun `yarn local` to rebuild.
apps/api/v2/package.json (1)

19-21: Guard the new dev flow against missing prebuilds.

Since dev no longer runs dev:build, add a lightweight precheck or fallback to prevent “module not found” errors when contributors run yarn dev directly.

-    "dev": "ts-node scripts/docker-start.ts && yarn copy-swagger-module && yarn start --watch",
+    "dev": "node -e \"process.exit(0)\" && ts-node scripts/docker-start.ts && yarn copy-swagger-module && yarn start --watch",

If acceptable, replace the no-op with a small pre-script that asserts required workspace build artifacts exist and instructs to run yarn local otherwise. I can draft that.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 88391c7 and a3a6a3f.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • apps/api/v2/README.md (1 hunks)
  • apps/api/v2/package.json (2 hunks)
  • packages/platform/libraries/scripts/local.js (0 hunks)
  • packages/platform/libraries/scripts/postpublish.js (0 hunks)
  • packages/platform/libraries/scripts/prepublish.js (0 hunks)
💤 Files with no reviewable changes (3)
  • packages/platform/libraries/scripts/prepublish.js
  • packages/platform/libraries/scripts/postpublish.js
  • packages/platform/libraries/scripts/local.js
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-09-02T12:29:32.592Z
Learnt from: CR
PR: calcom/cal.com#0
File: AGENTS.md:0-0
Timestamp: 2025-09-02T12:29:32.592Z
Learning: Use `yarn dev` to start the development server

Applied to files:

  • apps/api/v2/README.md
📚 Learning: 2025-09-02T12:29:32.592Z
Learnt from: CR
PR: calcom/cal.com#0
File: AGENTS.md:0-0
Timestamp: 2025-09-02T12:29:32.592Z
Learning: Use `yarn build` to build all packages

Applied to files:

  • apps/api/v2/README.md
📚 Learning: 2025-09-02T12:29:32.592Z
Learnt from: CR
PR: calcom/cal.com#0
File: AGENTS.md:0-0
Timestamp: 2025-09-02T12:29:32.592Z
Learning: Run `yarn type-check` for TypeScript type checking

Applied to files:

  • apps/api/v2/README.md
📚 Learning: 2025-09-02T12:29:32.592Z
Learnt from: CR
PR: calcom/cal.com#0
File: AGENTS.md:0-0
Timestamp: 2025-09-02T12:29:32.592Z
Learning: Run integration tests with `yarn test <filename> -- --integrationTestsOnly`

Applied to files:

  • apps/api/v2/README.md
🪛 markdownlint-cli2 (0.17.2)
apps/api/v2/README.md

63-63: Dollar signs used before commands without showing output

(MD014, commands-show-output)


68-68: Dollar signs used before commands without showing output

(MD014, commands-show-output)


76-76: Dollar signs used before commands without showing output

(MD014, commands-show-output)

⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (5)
apps/api/v2/package.json (3)

19-19: Build order: include platform-libraries earlier if it’s a transitive dep.

If other packages consume platform-libraries during their build, put it first to avoid race/failures.

-    "dev:build": "yarn workspace @calcom/platform-constants build && yarn workspace @calcom/platform-enums build && yarn workspace @calcom/platform-utils build && yarn workspace @calcom/platform-types build && yarn workspace @calcom/platform-libraries build",
+    "dev:build": "yarn workspace @calcom/platform-libraries build && yarn workspace @calcom/platform-constants build && yarn workspace @calcom/platform-enums build && yarn workspace @calcom/platform-utils build && yarn workspace @calcom/platform-types build",

Confirm actual dependency graph before changing order.


91-113: TypeScript beta may be unstable with Nest/ts-jest.

You’re on typescript "^5.9.0-beta". Ensure CI green across ts-jest, Nest CLI, and tooling; pin to a stable if not required.


20-20: Confirmed: scripts/docker-start.ts exists in the repository.
Found at apps/api/v2/scripts/docker-start.ts.

apps/api/v2/README.md (2)

73-77: Double-check parity between docker and no-docker dev flows.

In apps/api/v2/package.json: dev = "ts-node scripts/docker-start.ts && yarn copy-swagger-module && yarn start --watch", dev:no-docker = "yarn dev:build && yarn copy-swagger-module && yarn start --watch". Confirm both paths produce equivalent build artifacts and runtime behavior; if they intentionally differ, either make the scripts consistent or document the difference in apps/api/v2/README.md.


66-69: Docs-to-scripts consistency: verify top-level yarn local exists and builds required workspaces.

Automated check failed ("/bin/bash: line 10: /dev/fd/63: No such file or directory") and did not confirm a 'local' script. Verify the repo's top-level package.json defines a "local" script that runs the workspace build/watch steps referenced in the README, and confirm scripts/docker-start.ts (or the equivalent) exists.

@vercel
Copy link

vercel bot commented Sep 15, 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 15, 2025 11:37am
cal-eu Ignored Ignored Sep 15, 2025 11:37am

@github-actions
Copy link
Contributor

E2E results are ready!

@supalarry
Copy link
Contributor Author

Closing for #23834

@supalarry supalarry closed this Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only platform Anything related to our platform plan ready-for-e2e 💻 refactor size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants