Skip to content

chore: add auto recording #22723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 25, 2025
Merged

chore: add auto recording #22723

merged 8 commits into from
Jul 25, 2025

Conversation

Udit-takkar
Copy link
Contributor

@Udit-takkar Udit-takkar commented Jul 24, 2025

What does this PR do?

  • Fixes #XXXX (GitHub issue number)
  • Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Adds a new property to API v2

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.

How should this be tested?

@Udit-takkar Udit-takkar requested review from a team as code owners July 24, 2025 20:42
@Udit-takkar Udit-takkar changed the title Chore/add auto recording chore: add auto recording Jul 24, 2025
@graphite-app graphite-app bot requested a review from a team July 24, 2025 20:42
@keithwillcode keithwillcode added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Jul 24, 2025
Copy link
Contributor

coderabbitai bot commented Jul 24, 2025

Walkthrough

A new boolean property, enableAutomaticRecordingForOrganizer, was added to the CalVideoSettings schema in the API, OpenAPI documentation, and input types to indicate whether automatic recording is enabled when the organizer joins a call. The event type creation handler was updated to set this property and related transcription and recording flags with default values if undefined. The internal Zod schema for calVideoSettings was extended with this and three other optional boolean fields, and nullability handling was adjusted. End-to-end tests were updated to include and verify the new property during event type creation and update. Additionally, the dependency version for @calcom/platform-libraries was updated. No exported or public entity signatures were changed except for the addition of this property.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d9b108 and c314f2a.

⛔ 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 (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/api/v2/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Socket Security: Pull Request Alerts
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/add-auto-recording

🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

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

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • 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.

@dosubot dosubot bot added the api area: API, enterprise API, access token, OAuth label Jul 24, 2025
Copy link

graphite-app bot commented Jul 24, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (07/24/25)

1 reviewer was added to this PR based on Keith Williams's automation.

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: 2

🧹 Nitpick comments (2)
docs/api-reference/v2/openapi.json (1)

15709-15712: Add explicit default: false for the new boolean flag.

Down-stream code already uses false as the implicit default; documenting it here prevents drift and improves generated client typings.

           "enableAutomaticRecordingForOrganizer": {
             "type": "boolean",
-            "description": "If true, enables the automatic recording for the event when organizer joins the call"
+            "description": "If true, enables the automatic recording for the event when organizer joins the call",
+            "default": false
           }
apps/api/v2/swagger/documentation.json (1)

15709-15712: Tighten wording & add explicit default

  1. Wording is a bit clunky—​“enables the automatic recording for the event when organizer joins the call”.
  2. The schema omits an explicit "default": false although the handler applies that default. Surfacing it in the spec prevents client confusion.
-          "enableAutomaticRecordingForOrganizer": {
-            "type": "boolean",
-            "description": "If true, enables the automatic recording for the event when organizer joins the call"
-          }
+          "enableAutomaticRecordingForOrganizer": {
+            "type": "boolean",
+            "description": "If true, automatically starts recording once the organizer joins the call.",
+            "default": false
+          }

Ensure the OpenAPI file and the generated client types remain in sync after the default is added.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f991669 and a62042e.

📒 Files selected for processing (5)
  • apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts (5 hunks)
  • apps/api/v2/swagger/documentation.json (1 hunks)
  • docs/api-reference/v2/openapi.json (1 hunks)
  • packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts (1 hunks)
  • packages/trpc/server/routers/viewer/eventTypes/create.handler.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)

Flag excessive Day.js use in performance-critical code. Functions like .add, .diff, .isBefore, and .isAfter are slow, especially in timezone mode. Prefer .utc() for better performance. Where possible, replace with native Date and direct .valueOf() comparisons for faster execution. Recommend using native methods or Day.js .utc() consistently in hot paths like loops.

Files:

  • packages/trpc/server/routers/viewer/eventTypes/create.handler.ts
  • packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts
  • apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts
docs/api-reference/v2/openapi.json

📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)

docs/api-reference/v2/openapi.json: When docs changes are made in /docs/api-reference/v2/openapi.json, ensure the following: 'summary' fields are short and concise.
When docs changes are made in /docs/api-reference/v2/openapi.json, ensure the following: 'summary' fields do not end with a period.
When docs changes are made in /docs/api-reference/v2/openapi.json, ensure the following: 'summary' fields are written in proper American english.

Files:

  • docs/api-reference/v2/openapi.json
🧠 Learnings (1)
apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts (3)

Learnt from: vijayraghav-io
PR: #21072
File: packages/prisma/schema.prisma:891-891
Timestamp: 2025-07-18T08:47:01.264Z
Learning: In Cal.com's calendar integration, both Google Calendar and Outlook Calendar are designed to allow multiple eventTypeIds to share the same subscription ID (googleChannelId or outlookSubscriptionId). This is an intentional design pattern to reuse existing subscriptions for efficiency rather than creating separate subscriptions for each event type. Therefore, unique constraints like @@unique([outlookSubscriptionId, eventTypeId]) should not be added as they would break this subscription sharing functionality.

Learnt from: hariombalhara
PR: #22547
File: packages/embeds/embed-core/src/lib/eventHandlers/scrollByDistanceEventHandler.ts:11-14
Timestamp: 2025-07-16T11:46:28.759Z
Learning: In Cal.com's embed system, internal events like "__scrollByDistance" are fired by Cal.com's own code, so runtime validation of event data structure is unnecessary since TypeScript type system guarantees type safety for internal events.

Learnt from: vijayraghav-io
PR: #21072
File: packages/prisma/schema.prisma:891-891
Timestamp: 2025-07-18T08:47:01.264Z
Learning: The Outlook Calendar integration in Cal.com intentionally reuses subscription IDs across multiple event types for efficiency. The upsertSelectedCalendarsForEventTypeIds method creates separate SelectedCalendar records for each eventTypeId, all sharing the same outlookSubscriptionId. This subscription sharing pattern means that unique constraints like @@unique([outlookSubscriptionId, eventTypeId]) should not be applied as they would prevent this intended functionality.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: required
🔇 Additional comments (7)
packages/trpc/server/routers/viewer/eventTypes/create.handler.ts (1)

74-77: LGTM! Clean implementation of new calVideoSettings properties.

The implementation correctly follows the established pattern with proper default values and conditional handling. All four new properties (enableAutomaticTranscription, enableAutomaticRecordingForOrganizer, disableTranscriptionForGuests, disableTranscriptionForOrganizer) are consistently implemented using the nullish coalescing operator with false defaults.

apps/api/v2/swagger/documentation.json (1)

15709-15712: Confirm naming consistency across all specs & input DTOs

Double-check that every location (OpenAPI v2 JSON, TS input DTOs, Prisma models, e2e test payloads) uses the exact camel-case key enableAutomaticRecordingForOrganizer. Any mismatch will silently drop the field on validation.

apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts (5)

970-970: LGTM: New property correctly included in update test

The enableAutomaticRecordingForOrganizer property is properly included in the calVideoSettings object for testing the update functionality.


1099-1101: LGTM: Proper assertion for the new property

The assertion correctly verifies that the enableAutomaticRecordingForOrganizer property is properly persisted and returned in the API response after updating an event type.


1122-1122: LGTM: Proper test state maintenance

Correctly updates the local eventType object with the updated calVideoSettings to maintain test state consistency for subsequent operations.


1879-1879: LGTM: New property correctly included in creation test

The enableAutomaticRecordingForOrganizer property is properly included in the calVideoSettings object for testing the event type creation functionality.


1902-1902: LGTM: Proper assertion for creation functionality

The assertion correctly verifies that the enableAutomaticRecordingForOrganizer property is properly set and returned in the API response after creating an event type with cal video settings.

@Udit-takkar Udit-takkar requested a review from a team as a code owner July 24, 2025 20:54
Copy link

vercel bot commented Jul 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Jul 25, 2025 6:13pm
cal-eu ⬜️ Ignored (Inspect) Jul 25, 2025 6:13pm

@Udit-takkar Udit-takkar enabled auto-merge (squash) July 25, 2025 08:03
Copy link
Member

@alishaz-polymath alishaz-polymath left a comment

Choose a reason for hiding this comment

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

LGTM

joeauyeung
joeauyeung previously approved these changes Jul 25, 2025
@SomayChauhan SomayChauhan dismissed stale reviews from alishaz-polymath and joeauyeung via c314f2a July 25, 2025 18:13
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedmemory-cache@​0.2.010010010076100
Addedbcryptjs@​2.4.31001001008080

View full report

@Udit-takkar Udit-takkar merged commit 9ccf5f3 into main Jul 25, 2025
40 checks passed
@Udit-takkar Udit-takkar deleted the chore/add-auto-recording branch July 25, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api area: API, enterprise API, access token, OAuth core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ready-for-e2e 🚨 urgent Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants