Skip to content

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 29, 2026

Benchmark PR from agentic-review-benchmarks#4

Summary by CodeRabbit

  • New Features

    • Added displayEmail field to booking responses for attendees, hosts, and guests, providing a sanitized email address for display purposes alongside the original email.
  • Tests

    • Updated test expectations across multiple booking scenarios to validate the new displayEmail field in API responses.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Walkthrough

The changes introduce a new displayEmail field across the booking system that provides a sanitized version of email addresses by stripping plus-addressing suffixes. This field is added to output DTOs, service transformation logic, API specifications, and test expectations for consistent application across booking responses.

Changes

Cohort / File(s) Summary
Configuration & API Errors
.github/oasdiff-err-ignore.txt
Adds six new entries for various booking endpoints to suppress OpenAPI schema difference warnings related to oneOf subschemas in status 200/201 responses.
Type & DTO Definitions
packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts
Introduces displayEmail: string property to BookingAttendee, BookingHost, and ReassignedToDto classes. Adds a static helper method cleanEmailForDisplay(email: string): string to sanitize emails by stripping plus-addressing suffixes.
Service Logic
apps/api/v2/src/ee/bookings/2024-08-13/services/output.service.ts
Implements email transformation across booking outputs using a new private helper. Applies displayEmail to attendees, hosts, guests, and reassigned users in multiple output methods (getOutputBooking, getOutputRecurringBooking, getOutputSeatedBooking, etc.). Updates handling of displayGuests by mapping through the sanitization helper.
API Specification
docs/api-reference/v2/openapi.json
Adds optional displayEmail property to multiple schemas: BookingHost, BookingAttendee, BookingOutput_2024_08_13, RecurringBookingOutput_2024_08_13, GetSeatedBookingOutput_2024_08_13, and GetRecurringSeatedBookingOutput_2024_08_13. Examples set to mirror corresponding email fields.
Bookings E2E Tests
apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/*-bookings.e2e-spec.ts
Updates test expectations across seven test files (api-key-bookings, managed-user-bookings, reassign-bookings, recurring-bookings, seated-bookings, team-bookings, user-bookings) to include displayEmail field in attendee, host, and guest objects matching the input email values. managed-user-bookings.e2e-spec.ts introduces a new "displayEmail fields" test suite.
Organizations E2E Tests
apps/api/v2/src/modules/organizations/*/bookings/*.e2e-spec.ts
Adds displayEmail field expectations to attendee objects in three organization-related test files (organizations-bookings.controller.e2e-spec.ts, organizations-teams-bookings.controller.e2e-spec.ts, organizations-users-bookings.e2e-spec.ts).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A fluff of email, clean and bright,
No plus-signs hiding, polished sight!
From service to schema, field takes flight,
Attendees display with pure delight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding displayEmail fields to booking responses that return email addresses without OAuth suffixes.
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 docstrings

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

Copy link

@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/api/v2/src/ee/bookings/2024-08-13/services/output.service.ts (1)

411-424: Add sorting to getOutputRecurringSeatedBookings to match other recurring methods.

The similar methods getOutputRecurringBookings (line 243) and getOutputCreateRecurringSeatedBooking (line 448) both sort results by start time using .sort((a, b) => new Date(a.start).getTime() - new Date(b.start).getTime()). The seated variant should apply the same sort before returning.

🧹 Nitpick comments (4)
.github/oasdiff-err-ignore.txt (1)

5-10: Consider adding comments to document the rationale.

Adding inline comments explaining why these particular subschemas are being ignored would help future maintainers understand the context, especially since this relates to the new displayEmail field additions mentioned in the PR summary.

📝 Example with explanatory comments
+# Ignoring displayEmail field additions in booking responses
 POST /v2/bookings added 'subschema `#2`, subschema `#4`' to the 'data' response property 'oneOf' list for the response status '201'
 GET /v2/bookings/{bookingUid} added 'subschema `#3`, subschema `#6`' to the 'data' response property 'oneOf' list for the response status '200'
 POST /v2/bookings/{bookingUid}/cancel added 'subschema `#3`, subschema `#6`' to the 'data' response property 'oneOf' list for the response status '200'
 POST /v2/bookings/{bookingUid}/confirm added 'subschema `#3`, subschema `#6`' to the 'data' response property 'oneOf' list for the response status '200'
 POST /v2/bookings/{bookingUid}/decline added 'subschema `#3`, subschema `#6`' to the 'data' response property 'oneOf' list for the response status '200'
 POST /v2/bookings/{bookingUid}/guests added 'subschema `#3`, subschema `#6`' to the 'data' response property 'oneOf' list for the response status '200'
packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts (1)

59-62: Consider tightening and centralizing the email-sanitizing regex.

Anchoring the suffix removal to the local part end reduces accidental stripping and keeps behavior aligned with the OAuth suffix format. Also, keep this helper aligned with OutputBookingsService_2024_08_13.getDisplayEmail to avoid drift.

🛠️ Suggested tweak
-  static cleanEmailForDisplay(email: string): string {
-    return email.replace(/\+[a-zA-Z0-9]{25}/, "");
-  }
+  static cleanEmailForDisplay(email: string): string {
+    return email.replace(/\+[A-Za-z0-9]{25}(?=@)/, "");
+  }
apps/api/v2/src/ee/bookings/2024-08-13/services/output.service.ts (1)

96-98: Centralize email-sanitizing logic to avoid drift.

getDisplayEmail duplicates the helper in BookingAttendee.cleanEmailForDisplay. Consider reusing a single utility (e.g., import the static helper or move to a shared util) so regex updates stay consistent.

docs/api-reference/v2/openapi.json (1)

31715-31719: Consider examples that illustrate the actual use case.

The displayEmail field is intended to show a "clean" email by stripping OAuth/plus-addressing suffixes. However, the examples show identical values for both email and displayEmail. To better communicate the field's purpose to API consumers, consider using examples that demonstrate when these values differ:

"email": {
  "type": "string",
  "example": "[email protected]"
},
"displayEmail": {
  "type": "string",
  "example": "[email protected]",
  "description": "Clean email for display purposes"
}

This applies to all schemas where displayEmail is added (BookingHost, BookingAttendee, seated booking attendees, and ReassignedToDto).

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 35012c1 and f6968d6.

📒 Files selected for processing (14)
  • .github/oasdiff-err-ignore.txt
  • apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/api-key-bookings.e2e-spec.ts
  • apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/managed-user-bookings.e2e-spec.ts
  • apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/reassign-bookings.e2e-spec.ts
  • apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/recurring-bookings.e2e-spec.ts
  • apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/seated-bookings.e2e-spec.ts
  • apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/team-bookings.e2e-spec.ts
  • apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/user-bookings.e2e-spec.ts
  • apps/api/v2/src/ee/bookings/2024-08-13/services/output.service.ts
  • apps/api/v2/src/modules/organizations/bookings/organizations-bookings.controller.e2e-spec.ts
  • apps/api/v2/src/modules/organizations/teams/bookings/organizations-teams-bookings.controller.e2e-spec.ts
  • apps/api/v2/src/modules/organizations/users/bookings/controllers/organizations-users-bookings.e2e-spec.ts
  • docs/api-reference/v2/openapi.json
  • packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts
🧰 Additional context used
🧬 Code graph analysis (1)
apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/managed-user-bookings.e2e-spec.ts (2)
apps/api/index.js (1)
  • app (13-13)
packages/platform/constants/api.ts (2)
  • CAL_API_VERSION_HEADER (72-72)
  • VERSION_2024_08_13 (59-59)
🔇 Additional comments (16)
.github/oasdiff-err-ignore.txt (1)

5-10: Subschema numbers verified as correct.

Line 5 correctly references subschema #2, subschema #4 (POST /v2/bookings, status 201 response), and lines 6-10 correctly reference `subschema `#3`, subschema `#6 (GET/POST endpoints, status 200 responses). The oneOf schemas in the OpenAPI spec confirm these indices are accurate. The difference correlates with the response types: POST /v2/bookings uses CreateSeatedBookingOutput schemas, while the other endpoints use GetSeatedBookingOutput schemas.

apps/api/v2/src/modules/organizations/users/bookings/controllers/organizations-users-bookings.e2e-spec.ts (1)

233-240: LGTM!

The test expectations are correctly updated to include the new displayEmail field. Since the test data uses regular email addresses without OAuth suffixes, displayEmail correctly mirrors email in all three booking scenarios (personal, personal via username, and team bookings).

Also applies to: 292-299, 349-356

apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/recurring-bookings.e2e-spec.ts (1)

185-192: LGTM!

Test expectations for recurring bookings are correctly updated to include displayEmail for each attendee across all recurrence instances. The pattern is consistent with other e2e test updates in this PR.

Also applies to: 207-214, 264-271, 287-294, 308-315

apps/api/v2/src/modules/organizations/teams/bookings/organizations-teams-bookings.controller.e2e-spec.ts (1)

250-257: LGTM!

Test expectation correctly includes the new displayEmail field for the team booking attendee.

apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/api-key-bookings.e2e-spec.ts (1)

177-184: LGTM!

Test expectation correctly includes the new displayEmail field for the API key booking scenario.

apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/reassign-bookings.e2e-spec.ts (1)

491-496: LGTM!

Test expectations for booking reassignment correctly include displayEmail in the reassignedTo response object, matching the user's email who receives the reassigned booking.

Also applies to: 532-537

apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/seated-bookings.e2e-spec.ts (1)

201-215: LGTM!

Test expectations for seated bookings are correctly updated to include displayEmail across all scenarios:

  • Initial seat booking
  • Subsequent seat bookings (correctly references displayEmail from previously stored attendee data)
  • Rescheduled seated bookings (uses optional chaining appropriately)
  • Cancellation scenarios

Also applies to: 276-291, 293-307, 421-434, 845-859

apps/api/v2/src/modules/organizations/bookings/organizations-bookings.controller.e2e-spec.ts (1)

335-342: DisplayEmail expectations align with the new attendee shape.

These assertions correctly validate the new displayEmail field alongside existing attendee attributes.

Also applies to: 389-396, 443-450, 497-504

apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/user-bookings.e2e-spec.ts (4)

483-506: Create-booking expectations updated correctly for displayEmail/displayGuests.


569-576: Recurring booking attendee assertions include displayEmail as expected.

Also applies to: 592-599, 614-621


2083-2106: Username-based booking expectations now match the displayEmail/displayGuests additions.


2536-2552: SMS-reminder booking responses correctly assert displayEmail fields.

apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/team-bookings.e2e-spec.ts (1)

519-526: Team-booking tests now correctly assert displayEmail across attendee shapes.

Also applies to: 574-582, 631-646, 694-701, 749-756, 933-941, 1017-1024

apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/managed-user-bookings.e2e-spec.ts (1)

627-709: Nice coverage for displayEmail/displayGuests with OAuth-managed users.

packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts (1)

32-35: DTOs correctly expose displayEmail for attendees/hosts/reassigned users.

Also applies to: 108-112, 414-418

docs/api-reference/v2/openapi.json (1)

31729-31736: Making displayEmail required is appropriate.

Adding displayEmail to the required arrays across all affected schemas (BookingHost, BookingAttendee, seated booking attendees, ReassignedToDto) is correct since the service layer will always populate this field. For API response schemas, this is not a breaking change as long as the backend always provides the field, which the implementation changes ensure.

Also applies to: 31833-31839, 32267-32273, 33370-33375

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

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.

2 participants