Skip to content
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

perf: Load bookings used for limits in bulk #13474

Merged
merged 18 commits into from
Feb 6, 2024

Conversation

keithwillcode
Copy link
Contributor

What does this PR do?

Fixes #13358

Instead of running a query for every user in a team event when finding bookings that hit limit boundaries, get all bookings used for this for all users in the group at the beginning.

Type of change

  • Chore (refactoring code, technical debt, workflow improvements)

How should this be tested?

  • Ensure booking limits are adhered to

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

@keithwillcode keithwillcode requested a review from a team January 30, 2024 19:47
@github-actions github-actions bot added the bookings area: bookings, availability, timezones, double booking label Jan 30, 2024
Copy link
Contributor

github-actions bot commented Jan 30, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@github-actions github-actions bot added foundation performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive Urgent Created by Linear-GitHub Sync labels Jan 30, 2024
Copy link

vercel bot commented Jan 30, 2024

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

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2024 5:09pm
qa 🔄 Building (Inspect) Visit Preview 💬 Add feedback Feb 6, 2024 5:09pm
5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview Feb 6, 2024 5:09pm
cal ⬜️ Ignored (Inspect) Visit Preview Feb 6, 2024 5:09pm
cal-demo ⬜️ Ignored (Inspect) Visit Preview Feb 6, 2024 5:09pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Feb 6, 2024 5:09pm
ui ⬜️ Ignored (Inspect) Visit Preview Feb 6, 2024 5:09pm

@keithwillcode keithwillcode added this to the v3.8 milestone Jan 30, 2024
@keithwillcode keithwillcode added core area: core, team members only High priority Created by Linear-GitHub Sync and removed Urgent Created by Linear-GitHub Sync bookings area: bookings, availability, timezones, double booking core area: core, team members only labels Jan 30, 2024
@github-actions github-actions bot added bookings area: bookings, availability, timezones, double booking Urgent Created by Linear-GitHub Sync labels Jan 30, 2024
@keithwillcode keithwillcode added the core area: core, team members only label Jan 30, 2024
Copy link
Contributor

github-actions bot commented Jan 30, 2024

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

deploysentinel bot commented Jan 30, 2024

Current Playwright Test Results Summary

✅ 440 Passing - ⚠️ 19 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 02/06/2024 05:25:34pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: cf05e82

Started: 02/06/2024 05:16:44pm UTC

⚠️ Flakes

📄   apps/web/playwright/booking/multipleEmailQuestion.e2e.ts • 3 Flakes

Top 1 Common Error Messages

null

3 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Multiple Email Question and Each Other Question Booking With Multiple Email Question and Long text Question Multiple Email required and Long text required
Retry 1Initial Attempt
0.34% (1) 1 / 295 run
failed over last 7 days
6.78% (20) 20 / 295 runs
flaked over last 7 days
Booking With Multiple Email Question and Each Other Question Booking With Multiple email Question and phone Question Multiple email and Phone not required
Retry 1Initial Attempt
0% (0) 0 / 292 runs
failed over last 7 days
5.14% (15) 15 / 292 runs
flaked over last 7 days
Booking With Multiple Email Question and Each Other Question Booking With Multiple Email Question and Radio group Question Booking With Multiple Email Question and Short text question Multiple Email and Short text not required
Retry 1Initial Attempt
0.34% (1) 1 / 290 run
failed over last 7 days
7.59% (22) 22 / 290 runs
flaked over last 7 days

📄   apps/web/playwright/booking/selectQuestion.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Phone Question and Each Other Question Booking With Select Question and Multi email Question Select required and Multi email required
Retry 1Initial Attempt
0.38% (1) 1 / 265 run
failed over last 7 days
8.68% (23) 23 / 265 runs
flaked over last 7 days
Booking With Phone Question and Each Other Question Booking With Select Question and Number Question Select and Number not required
Retry 1Initial Attempt
0% (0) 0 / 264 runs
failed over last 7 days
3.41% (9) 9 / 264 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 8 Flakes

Top 1 Common Error Messages

null

8 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should open embed iframe on click - Configured with light theme
Retry 1Initial Attempt
-3.32% (-10) -10 / 301 runs
failed over last 7 days
50.17% (151) 151 / 301 runs
flaked over last 7 days
Popup Tests should be able to reschedule
Retry 1Initial Attempt
-94.97% (-151) -151 / 159 runs
failed over last 7 days
94.97% (151) 151 / 159 runs
flaked over last 7 days
Popup Tests should open Routing Forms embed on click
Retry 1Initial Attempt
-83.65% (-133) -133 / 159 runs
failed over last 7 days
86.16% (137) 137 / 159 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe according to system theme when configured with 'auto' theme using Embed API
Retry 1Initial Attempt
-88.39% (-137) -137 / 155 runs
failed over last 7 days
88.39% (137) 137 / 155 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe according to system theme when no theme is configured through Embed API
Retry 1Initial Attempt
-88.39% (-137) -137 / 155 runs
failed over last 7 days
88.39% (137) 137 / 155 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe(Booker Profile Page) with dark theme when configured with dark theme using Embed API
Retry 1Initial Attempt
-88.39% (-137) -137 / 155 runs
failed over last 7 days
88.39% (137) 137 / 155 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe(Event Booking Page) with dark theme when configured with dark theme using Embed API
Retry 1Initial Attempt
-88.39% (-137) -137 / 155 runs
failed over last 7 days
88.39% (137) 137 / 155 runs
flaked over last 7 days
Popup Tests prendered embed should be loaded and apply the config given to it
Retry 1Initial Attempt
-88.39% (-137) -137 / 155 runs
failed over last 7 days
88.39% (137) 137 / 155 runs
flaked over last 7 days

📄   apps/web/playwright/booking/longTextQuestion.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Long Text Question and Each Other Question Booking With Long Text Question and Phone Question Long Text and Phone required
Retry 1Initial Attempt
0% (0) 0 / 281 runs
failed over last 7 days
3.20% (9) 9 / 281 runs
flaked over last 7 days

📄   apps/web/playwright/login.2fa.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
2FA Tests should allow a user to enable 2FA and login using 2FA
Retry 2Retry 1Initial Attempt
1.41% (4) 4 / 283 runs
failed over last 7 days
33.22% (94) 94 / 283 runs
flaked over last 7 days

📄   apps/web/playwright/login.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Login and logout tests -- future Login flow validations -- future Should warn when user does not exist
Retry 1Initial Attempt
0% (0) 0 / 283 runs
failed over last 7 days
4.95% (14) 14 / 283 runs
flaked over last 7 days

📄   apps/web/playwright/booking/radioGroupQuestion.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Radio Question and Each Other Question Booking With Radio Question and Address Question Booking With Radio Question and checkbox Question Radio required and checkbox required
Retry 1Initial Attempt
0.35% (1) 1 / 287 run
failed over last 7 days
3.83% (11) 11 / 287 runs
flaked over last 7 days

📄   apps/web/playwright/booking/addressQuestione2e/addressQuestion.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Address Question and Each Other Question Booking With Address Question and multiselect Question Address and multiselect text not required
Retry 1Initial Attempt
0% (0) 0 / 300 runs
failed over last 7 days
4.67% (14) 14 / 300 runs
flaked over last 7 days

📄   apps/web/playwright/booking/phoneQuestion.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Phone Question and Each Other Question Booking With Phone Question and Address Question Booking With Phone Question and Long text Question Phone and Long text required
Retry 1Initial Attempt
0.34% (1) 1 / 293 run
failed over last 7 days
5.46% (16) 16 / 293 runs
flaked over last 7 days

View Detailed Build Results


Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Looking good so far

@github-actions github-actions bot added the Urgent Created by Linear-GitHub Sync label Feb 6, 2024
@keithwillcode keithwillcode marked this pull request as draft February 6, 2024 14:22
…alcom/cal.com into perf/get-schedule-limits-bookings-bulk
Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Code LGTM 👍🏽 Testing locally and waiting for checks

@zomars zomars merged commit 512628e into main Feb 6, 2024
38 checks passed
@zomars zomars deleted the perf/get-schedule-limits-bookings-bulk branch February 6, 2024 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookings area: bookings, availability, timezones, double booking core area: core, team members only foundation High priority Created by Linear-GitHub Sync performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive Urgent Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-2994] Fix round robin perf issues
2 participants