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

feat: license creation admin PR #15024

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

sean-brydon
Copy link
Member

@sean-brydon sean-brydon commented May 14, 2024

Sets up the inital UI for creating license keys.

Loom: https://app.campsite.co/cal/posts/u20i7qp36kfs#comment-wu34in68i2uu

If you want to test this full flow of this you can go ahead and clone
https://github.com/calcom/private-api/pull/12
setup .env vars + a new db
add the API url + secret to private api .env and also web.

Copy link
Contributor

github-actions bot commented May 14, 2024

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

Copy link

vercel bot commented May 14, 2024

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 24, 2024 0:35am
cal ⬜️ Ignored (Inspect) Visit Preview May 24, 2024 0:35am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview May 24, 2024 0:35am

Copy link
Contributor

📦 Next.js Bundle Analysis for @calcom/web

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

New Page Added

The following page was added to the bundle from the code in this PR:

Page Size (compressed) First Load % of Budget (350 KB)
/settings/license-key/new 108.47 KB 337.15 KB 96.33%

Fifteen 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)
/auth/login 118.77 KB 347.46 KB 99.27% (🟡 +0.20%)
/availability 464.82 KB 693.5 KB 198.14% (🟡 +10.63%)
/booking/[uid] 226.66 KB 455.35 KB 130.10% (🟡 +0.14%)
/booking/[uid]/embed 226.67 KB 455.35 KB 130.10% (🟡 +0.14%)
/event-types/[type] 435.72 KB 664.41 KB 189.83% (🟢 -0.16%)
/settings/admin/lockedSMS/UsersTable 78.89 KB 307.57 KB 87.88% (🟢 -0.18%)
/settings/admin/lockedSMS/lockedSMSView 118.56 KB 347.25 KB 99.21% (🟢 -0.20%)
/settings/admin/oAuth/oAuthView 94.97 KB 323.65 KB 92.47% (🟢 -0.19%)
/settings/admin/orgMigrations/_OrgMigrationLayout 250.67 KB 479.36 KB 136.96% (🟢 -0.16%)
/settings/organizations/[id]/onboard-members 171.09 KB 399.77 KB 114.22% (🟢 -0.16%)
/settings/organizations/dsync 331.56 KB 560.24 KB 160.07% (🟡 +10.56%)
/settings/organizations/members 430.65 KB 659.33 KB 188.38% (🟡 +8.77%)
/settings/organizations/teams/other/[id]/profile 468.73 KB 697.42 KB 199.26% (🟢 -0.16%)
/settings/teams/[id]/onboard-members 170.27 KB 398.95 KB 113.99% (🟢 -0.16%)
/settings/teams/[id]/profile 469.57 KB 698.25 KB 199.50% (🟢 -0.16%)
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 "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Copy link

deploysentinel bot commented May 14, 2024

Current Playwright Test Results Summary

✅ 319 Passing - ❌ 1 Failing - ⚠️ 14 Flaky

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

(Last updated on 05/14/2024 10:37:23am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: f57ccd6

Started: 05/14/2024 10:34:21am UTC

❌ Failures

📄   apps/web/playwright/hash-my-url.e2e.ts • 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
hash my url generate url hash
Retry 2Retry 1Initial Attempt
Error: apiRequestContext.post: read ECONNRESET...
apiRequestContext.post: read ECONNRESET
=========================== logs ===========================
→ POST http://localhost:3000/api/auth/callback/credentials
  user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.5563.19 Safari/537.36
  accept: */*
  accept-encoding: gzip,deflate,br
  content-type: application/json
  content-length: 230
  cookie: next-auth.csrf-token=730934c65e916fa9b1ebaf8ce323c2ed2b05b602603cbeab5d237cda47aeccf4%7Cee0def1ea3f87bb4e77dda398fea2abea0fadcfc62583fce10616024afc0ada9; next-auth.callback-url=http%3A%2F%2Flocalhost%3A3000
← 408 Request Timeout
  connection: close
============================================================
6.10% (15) 15 / 246 runs
failed over last 7 days
27.24% (67) 67 / 246 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 cancelled
Retry 1Initial Attempt
2.62% (6) 6 / 229 runs
failed over last 7 days
10.04% (23) 23 / 229 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 -- future user enabling recurring event comes with default options
Retry 1Initial Attempt
3.50% (9) 9 / 257 runs
failed over last 7 days
4.67% (12) 12 / 257 runs
flaked over last 7 days
Event Types tests -- future user Different Locations Tests Can add Link Meeting as location and book with it
Retry 1Initial Attempt
0.78% (2) 2 / 256 runs
failed over last 7 days
18.36% (47) 47 / 256 runs
flaked over last 7 days

📄   apps/web/playwright/profile.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
Update Profile Can update a users email (verification enabled)
Retry 2Retry 1Initial Attempt
38.38% (109) 109 / 284 runs
failed over last 7 days
34.15% (97) 97 / 284 runs
flaked over last 7 days
Update Profile Newly added secondary email should show as Unverified
Retry 1Initial Attempt
0.70% (2) 2 / 285 runs
failed over last 7 days
27.37% (78) 78 / 285 runs
flaked over last 7 days
Update Profile Can verify the newly added secondary email
Retry 1Initial Attempt
2.11% (6) 6 / 285 runs
failed over last 7 days
24.21% (69) 69 / 285 runs
flaked over last 7 days
Update Profile Can resend verification link if the secondary email is unverified
Retry 1Initial Attempt
15.44% (44) 44 / 285 runs
failed over last 7 days
34.74% (99) 99 / 285 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
prefill -- future logged in
Retry 1Initial Attempt
0% (0) 0 / 248 runs
failed over last 7 days
2.82% (7) 7 / 248 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 Double install Embed Snippet with inline embed using a namespace
Retry 1Initial Attempt
0.79% (2) 2 / 252 runs
failed over last 7 days
56.75% (143) 143 / 252 runs
flaked over last 7 days
Namespacing Different namespaces can have different init configs
Retry 1Initial Attempt
0% (0) 0 / 251 runs
failed over last 7 days
56.57% (142) 142 / 251 runs
flaked over last 7 days
Namespacing Inline Embed Add inline embed using a namespace without reload
Retry 1Initial Attempt
0.40% (1) 1 / 252 run
failed over last 7 days
56.35% (142) 142 / 252 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 / 252 runs
failed over last 7 days
58.73% (148) 148 / 252 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
user can login & logout succesfully -- future login flow user & logout using dashboard
Retry 1Initial Attempt
3.53% (9) 9 / 255 runs
failed over last 7 days
30.20% (77) 77 / 255 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 -- future Can create a booking for Round Robin EventType
Retry 2Retry 1Initial Attempt
5.04% (13) 13 / 258 runs
failed over last 7 days
28.68% (74) 74 / 258 runs
flaked over last 7 days

View Detailed Build Results


@keithwillcode keithwillcode added this to the v4.2 milestone May 15, 2024
@sean-brydon sean-brydon mentioned this pull request May 16, 2024
7 tasks
};

// Fetch wrapper function
const fetchWithSignature = async (
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link

graphite-app bot commented May 24, 2024

Graphite Automations

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

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


export const CreateANewLicenseKeyForm = () => {
const session = useSession();
if (session.data?.user.role !== "ADMIN") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we should be using a common function/constant here, no?

throw new Error("You do not have permission to do this.");
}

const request = await fetchWithSignature(`${privateApiUrl}/api/license`, input, signatureToken, {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should remove the /api/ segment. This is very Next.js-y. Since we are hitting an API directly, I would expect the URL to be /v1/license. We need to make sure we version it for standard API procedures/practices and we can make updates without affecting applications using the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consumer core area: core, team members only ✨ feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants