cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

refactor: organization creation handler

Open Ryukemeister opened this issue 1 year ago • 5 comments

What does this PR do?

This PR refactors the create handler that we use for organizations. We use the same handler in order to create a platform user as well, thats why now we have two different handlers, one that handles the creation of a platform user i.e. createPlatformUser and the other one that handles the creation of an org user i.e. createOrgUser. I've tried to split everything else in smaller and more meaningful functions for better readability and understanding of what piece does what.

Ryukemeister avatar May 07 '24 08:05 Ryukemeister

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

github-actions[bot] avatar May 07 '24 08:05 github-actions[bot]

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

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview May 17, 2024 8:07am
cal ⬜️ Ignored (Inspect) Visit Preview May 17, 2024 8:07am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview May 17, 2024 8:07am

vercel[bot] avatar May 07 '24 08:05 vercel[bot]

Graphite Automations

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

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

graphite-app[bot] avatar May 07 '24 08:05 graphite-app[bot]

📦 Next.js Bundle Analysis for @calcom/web

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

Three Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/settings/platform 261.21 KB 489.84 KB 139.95% (🟢 -0.18%)
/settings/platform/oauth-clients/[clientId]/edit 259.82 KB 488.45 KB 139.56% (🟢 -0.18%)
/settings/platform/oauth-clients/create 259.1 KB 487.73 KB 139.35% (🟢 -0.18%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/-

github-actions[bot] avatar May 07 '24 08:05 github-actions[bot]

Current Playwright Test Results Summary

✅ 310 Passing - ❌ 5 Failing - ⚠️ 12 Flaky

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

(Last updated on 05/17/2024 08:23:57am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: bee7ff321e6acb7ad4247a79983e3fa93883c6e7

Started: 05/17/2024 08:20:29am UTC

❌ Failures

📄   apps/web/playwright/profile.e2e.ts • 2 Failures

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Update Profile Can update a users email (verification enabled)
Retry 2Retry 1Initial Attempt
Error: page.waitForURL: Timeout 30000ms exceeded....
page.waitForURL: Timeout 30000ms exceeded.
=========================== logs ===========================
waiting for navigation to "/event-types" until "load"
  navigated to "http://localhost:3000/auth/login"
============================================================
39.83% (96) 96 / 241 runs
failed over last 7 days
31.95% (77) 77 / 241 runs
flaked over last 7 days
Update Profile Can resend verification link if the secondary email is unverified
Retry 2Retry 1Initial Attempt
Error: expect(received).toEqual(expected) // deep equality...
expect(received).toEqual(expected) // deep equality

Expected: true
Received: false
12.76% (31) 31 / 243 runs
failed over last 7 days
30.04% (73) 73 / 243 runs
flaked over last 7 days

📄   apps/web/playwright/webhook.e2e.ts • 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
MEETING_ENDED, MEETING_STARTED should create/remove scheduledWebhookTriggers for existing bookings
Retry 1Initial Attempt
Error: expect(received).toBe(expected) // Object.is equality...
expect(received).toBe(expected) // Object.is equality

Expected: 0
Received: 2
4.22% (7) 7 / 166 runs
failed over last 7 days
34.94% (58) 58 / 166 runs
flaked over last 7 days

📄   apps/web/playwright/team/team-invitation.e2e.ts • 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Team Invitation (non verified)
Retry 2Retry 1Initial Attempt
Error: expect(received).toBe(expected) // Object.is equality...
expect(received).toBe(expected) // Object.is equality

Expected: 1
Received: 0
6.99% (16) 16 / 229 runs
failed over last 7 days
4.80% (11) 11 / 229 runs
flaked over last 7 days

📄   apps/web/playwright/organization/organization-creation.e2e.ts • 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Organization Admin should be able to create an org where an existing user is made an owner
Retry 2Retry 1Initial Attempt
Error: Email with subject Your organization has been created not found
Email with subject Your organization has been created not found
100% (6) 6 / 6 runs
failed over last 7 days
0% (0) 0 / 6 runs
flaked over last 7 days

⚠️ Flakes

📄   apps/web/playwright/integrations-stripe.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Stripe integration Paid booking should be able to be rescheduled
Retry 1Initial Attempt
3.03% (6) 6 / 198 runs
failed over last 7 days
14.14% (28) 28 / 198 runs
flaked over last 7 days

📄   apps/web/playwright/event-types.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
Event Types tests -- legacy user Different Locations Tests Can remove location from multiple locations that are saved
Retry 2Retry 1Initial Attempt
3.72% (8) 8 / 215 runs
failed over last 7 days
19.53% (42) 42 / 215 runs
flaked over last 7 days
Event Types tests -- legacy user Different Locations Tests can add single organizer address location without display location public option
Retry 1Initial Attempt
0% (0) 0 / 216 runs
failed over last 7 days
5.09% (11) 11 / 216 runs
flaked 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 1Initial Attempt
7.11% (16) 16 / 225 runs
failed over last 7 days
28.89% (65) 65 / 225 runs
flaked over last 7 days

📄   apps/web/playwright/team/team-invitation.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Team Invitation (verified)
Retry 2Retry 1Initial Attempt
3.49% (8) 8 / 229 runs
failed over last 7 days
6.99% (16) 16 / 229 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/namespacing.e2e.ts • 4 Flakes

Top 1 Common Error Messages

null

4 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Namespacing Inline Embed Add inline embed using a namespace without reload
Retry 1Initial Attempt
0.47% (1) 1 / 213 run
failed over last 7 days
60.56% (129) 129 / 213 runs
flaked over last 7 days
Namespacing Inline Embed Double install Embed Snippet with inline embed using a namespace
Retry 1Initial Attempt
0.47% (1) 1 / 213 run
failed over last 7 days
59.62% (127) 127 / 213 runs
flaked over last 7 days
Namespacing Inline Embed Double install Embed Snippet with inline embed without a namespace(i.e. default namespace)
Retry 1Initial Attempt
0% (0) 0 / 213 runs
failed over last 7 days
63.38% (135) 135 / 213 runs
flaked over last 7 days
Namespacing Different namespaces can have different init configs
Retry 1Initial Attempt
0% (0) 0 / 211 runs
failed over last 7 days
60.19% (127) 127 / 211 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Update Profile Newly added secondary email should show as Unverified
Retry 1Initial Attempt
2.06% (5) 5 / 243 runs
failed over last 7 days
26.75% (65) 65 / 243 runs
flaked 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 Router URL should work
Retry 1Initial Attempt
0.47% (1) 1 / 215 run
failed over last 7 days
15.35% (33) 33 / 215 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Bookings Team Event Can create a booking for Round Robin EventType
Retry 1Initial Attempt
8.11% (18) 18 / 222 runs
failed over last 7 days
26.58% (59) 59 / 222 runs
flaked over last 7 days

View Detailed Build Results


deploysentinel[bot] avatar May 07 '24 08:05 deploysentinel[bot]

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Jul 02 '24 00:07 github-actions[bot]

This PR is being closed due to staleness. Please reopen if work is to continue.

keithwillcode avatar Jul 29 '24 04:07 keithwillcode