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
refactor: api v2 schedules #14870
refactor: api v2 schedules #14870
Conversation
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Ignored Deployments
|
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Current Playwright Test Results Summary✅ 321 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 05/16/2024 08:24:35am UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: 2251f3c Started: 05/16/2024 08:20:02am UTC
|
|
3 Test Cases Affected |
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Stripe integration Can book a paid booking
Retry 1 • Initial Attempt |
3.43% (7)7 / 204 runsfailed over last 7 days |
15.20% (31)31 / 204 runsflaked over last 7 days |
Stripe integration Paid booking should be able to be rescheduled
Retry 1 • Initial Attempt |
3.47% (7)7 / 202 runsfailed over last 7 days |
16.34% (33)33 / 202 runsflaked over last 7 days |
Stripe integration Paid booking should be able to be cancelled
Retry 1 • Initial Attempt |
2.49% (5)5 / 201 runsfailed over last 7 days |
11.94% (24)24 / 201 runsflaked over last 7 days |
📄 apps/web/playwright/event-types.e2e.ts • 2 Flakes
Top 1 Common Error Messages
|
2 Test Cases Affected |
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Event Types tests -- future user can add multiple organizer address
Retry 1 • Initial Attempt |
1.81% (4)4 / 221 runsfailed over last 7 days |
22.62% (50)50 / 221 runsflaked over last 7 days |
Event Types tests -- future user Different Locations Tests can select 'display on booking page' option when multiple organizer input type are present
Retry 1 • Initial Attempt |
0% (0)0 / 219 runsfailed over last 7 days |
10.96% (24)24 / 219 runsflaked over last 7 days |
📄 packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 9 Flakes
Top 1 Common Error Messages
|
9 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 1 • Initial Attempt |
-0.93% (-2)-2 / 214 runsfailed over last 7 days |
61.68% (132)132 / 214 runsflaked over last 7 days |
Popup Tests should be able to reschedule
Retry 1 • Initial Attempt |
-157.14% (-132)-132 / 84 runsfailed over last 7 days |
157.14% (132)132 / 84 runsflaked over last 7 days |
Popup Tests should open Routing Forms embed on click
Retry 1 • Initial Attempt |
-154.76% (-130)-130 / 84 runsfailed over last 7 days |
154.76% (130)130 / 84 runsflaked 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 1 • Initial Attempt |
-148.81% (-125)-125 / 84 runsfailed over last 7 days |
151.19% (127)127 / 84 runsflaked 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 1 • Initial Attempt |
-154.88% (-127)-127 / 82 runsfailed over last 7 days |
154.88% (127)127 / 82 runsflaked 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 1 • Initial Attempt |
-154.88% (-127)-127 / 82 runsfailed over last 7 days |
154.88% (127)127 / 82 runsflaked 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 1 • Initial Attempt |
-154.88% (-127)-127 / 82 runsfailed over last 7 days |
154.88% (127)127 / 82 runsflaked over last 7 days |
Popup Tests prendered embed should be loaded and apply the config given to it
Retry 1 • Initial Attempt |
-154.88% (-127)-127 / 82 runsfailed over last 7 days |
154.88% (127)127 / 82 runsflaked over last 7 days |
Popup Tests should open on clicking child element
Retry 1 • Initial Attempt |
-151.85% (-123)-123 / 81 runsfailed over last 7 days |
151.85% (123)123 / 81 runsflaked over last 7 days |
📄 apps/web/playwright/profile.e2e.ts • 2 Flakes
Top 1 Common Error Messages
|
2 Test Cases Affected |
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Update Profile Can update a users email (verification enabled)
Retry 1 • Initial Attempt |
39.92% (97)97 / 243 runsfailed over last 7 days |
31.28% (76)76 / 243 runsflaked over last 7 days |
Update Profile Can verify the newly added secondary email
Retry 1 • Initial Attempt |
2.45% (6)6 / 245 runsfailed over last 7 days |
21.63% (53)53 / 245 runsflaked over last 7 days |
📄 packages/app-store/routing-forms/playwright/tests/basic.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Routing Forms Seeded Routing Form Test preview should return correct route
Retry 1 • Initial Attempt |
0.94% (2)2 / 212 runsfailed over last 7 days |
32.55% (69)69 / 212 runsflaked over last 7 days |
📄 apps/web/playwright/teams.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Teams - NonOrg -- legacy Can create a booking for Round Robin EventType
Retry 1 • Initial Attempt |
6.31% (14)14 / 222 runsfailed over last 7 days |
29.73% (66)66 / 222 runsflaked over last 7 days |
📄 packages/embeds/embed-core/playwright/tests/namespacing.e2e.ts • 4 Flakes
Top 1 Common Error Messages
|
4 Test Cases Affected |
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Namespacing Inline Embed Double install Embed Snippet with inline embed using a namespace
Retry 1 • Initial Attempt |
0% (0)0 / 212 runsfailed over last 7 days |
58.49% (124)124 / 212 runsflaked over last 7 days |
Namespacing Inline Embed Add inline embed using a namespace without reload
Retry 1 • Initial Attempt |
0.47% (1)1 / 212 runfailed over last 7 days |
58.96% (125)125 / 212 runsflaked over last 7 days |
Namespacing Different namespaces can have different init configs
Retry 1 • Initial Attempt |
0% (0)0 / 210 runsfailed over last 7 days |
58.57% (123)123 / 210 runsflaked over last 7 days |
Namespacing Inline Embed Double install Embed Snippet with inline embed without a namespace(i.e. default namespace)
Retry 1 • Initial Attempt |
0% (0)0 / 212 runsfailed over last 7 days |
62.26% (132)132 / 212 runsflaked 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 |
---|---|---|
user can login & logout succesfully -- future login flow user & logout using dashboard
Retry 1 • Initial Attempt |
4.59% (10)10 / 218 runsfailed over last 7 days |
31.65% (69)69 / 218 runsflaked over last 7 days |
📄 apps/web/playwright/ab-tests-redirect.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
apps/ A/B tests -- future should render the /getting-started
Retry 1 • Initial Attempt |
0.46% (1)1 / 217 runfailed over last 7 days |
0.92% (2)2 / 217 runsflaked over last 7 days |
…ould-be-client-agnostic
Graphite Automations"Add foundation team as reviewer" took an action on this PR • (05/14/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add platform team as reviewer" took an action on this PR • (05/14/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add consumer team as reviewer" took an action on this PR • (05/14/24)1 reviewer was added to this PR based on Keith Williams's automation. |
…ould-be-client-agnostic
…ould-be-client-agnostic
…ould-be-client-agnostic
This reverts commit c25c835.
Problem
v2
/schedules
endpoints are not intuitive to use e.g. when creating a schedule for Sunday user must pass "0" to represent Sunday, and the response is in shape that atom expects which is messy and hard to understand and contains UI specific data like "isLastSchedule":Solution
Simplify create inputs and responses to deliver good developer experience. The API does not distinguish whether the request came from an atom or not - the response is always in the same shape.
On the frontend hooks are used to fetch api data and then transformers to transform api data into atom compatible structure, and then when updating a schedule to transform atom schedule into api compatible structure.
Endpoints
Whether creating, fetching or updating schedule the response has the same shape.
POST
/schedules
GET
/schedules/default
& GET/schedules/:id
UPDATE
/schedules/id
Implementation
API inputs and outputs
For atom hooks and api to be on the same page, all of schedules inputs e.g.
CreateScheduleInput
and outputs e.g.GetScheduleOutput
have been moved to platform-typespackages/platform/types/schedules
in order to centralize inputs and outputs of API.Data transformation
We want to re-use existing functions while providing a cleaner API interface. That means that:
If you check "transformInputCreateSchedule" in point 1., then you see that to transform avaiability and overrides it uses functions imported from platform libraries. They reside there not in the class, because they are also used client side - when API data is returned by hook, that data also needs to be converted to data structure compatible with our internal functions. That brings us to client:
New hook - useSchedules
useSchedules.ts has been added to be used in PlatformAvailabilitySettingsWrapper.tsx - atom needs to know if its users last schedule do disable deleting it. We use
useSchedules
to fetch user schedules, and then pass their count totransformApiScheduleForAtom
.Tests
Docs
Swagger docs been updated with examples
schedules refactor: before & after
Creating schedule
1. Before
Request body:
Response:
2. After
availabilities
body key has been renamed toavailability
Sunday
instead of number e.g.0
Updating schedule
1. Before
body.schedule
in data format different than when creating a schedule.Request body:
Response:
2. After
Fetching schedule
1. Before
Response is in same shape as when creating.
2. After
Response is in same shape as wen creating and updating.