Skip to content

Commit eb11901

Browse files
authored
Merge branch 'main' into app-install-flow-followup
2 parents 7b62c2d + 7ff255d commit eb11901

File tree

158 files changed

+4969
-574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+4969
-574
lines changed

.github/workflows/api-v1-production-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- uses: ./.github/actions/yarn-install
6666
- uses: ./.github/actions/cache-db
6767
- name: Cache API v1 production build
68-
uses: buildjet/cache@v3
68+
uses: buildjet/cache@v4
6969
id: cache-api-v1-build
7070
env:
7171
cache-name: api-v1-build

.github/workflows/api-v2-production-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- uses: ./.github/actions/dangerous-git-checkout
3535
- uses: ./.github/actions/yarn-install
3636
- name: Cache API v2 production build
37-
uses: buildjet/cache@v3
37+
uses: buildjet/cache@v4
3838
id: cache-api-v2-build
3939
env:
4040
cache-name: api-v2-build

.github/workflows/nextjs-bundle-analysis.yml

-6
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@ env:
4545
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
4646

4747
jobs:
48-
build:
49-
name: Production builds
50-
if: ${{ github.event_name == 'push' }}
51-
uses: ./.github/workflows/production-build-without-database.yml
52-
secrets: inherit
5348
analyze:
54-
needs: build
5549
if: always()
5650
runs-on: buildjet-2vcpu-ubuntu-2204
5751
steps:

.github/workflows/pr-review.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: PR Reviewed
2+
3+
on:
4+
pull_request_review:
5+
types: [submitted]
6+
7+
jobs:
8+
label-pr:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Label PR as ready for E2E
13+
if: github.event.review.state == 'approved'
14+
uses: actions-ecosystem/action-add-labels@v1
15+
with:
16+
github_token: ${{ secrets.GITHUB_TOKEN }}
17+
labels: 'ready-for-e2e'

.github/workflows/pr.yml

+119-10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: PR Update
22

33
on:
44
pull_request_target:
5+
types: [opened, synchronize, reopened, labeled]
56
branches:
67
- main
78
workflow_dispatch:
@@ -27,37 +28,145 @@ jobs:
2728
filters: |
2829
has-files-requiring-all-checks:
2930
- "!(**.md|.github/CODEOWNERS)"
31+
32+
check-label:
33+
runs-on: buildjet-2vcpu-ubuntu-2204
34+
name: Check for E2E label
35+
outputs:
36+
run-e2e: ${{ steps.check-if-pr-has-label.outputs.run-e2e == 'true' && (github.event_name != 'labeled' || (github.event_name == 'labeled' && github.event.label.name == 'ready-for-e2e')) }}
37+
run-jobs: ${{ github.event_name != 'labeled' }}
38+
steps:
39+
- name: Get PR from branch name
40+
id: check-if-pr-has-label
41+
uses: actions/github-script@v7
42+
with:
43+
script: |
44+
let pr;
45+
console.log('github.event_name', '${{ github.event_name }}');
46+
const parsedEvent = ${{ github.event }};
47+
if (parsedEvent && parsedEvent.pull_request) {
48+
const response = await github.rest.pulls.get({
49+
owner: github.context.repo.owner,
50+
repo: github.context.repo.repo,
51+
pull_number: parsedEvent.pull_request.number
52+
});
53+
54+
pr = response.data;
55+
} else {
56+
const ref = '${{ github.ref }}';
57+
const branch = ref.replace('refs/heads/', '');
58+
console.log('ref', ref);
59+
console.log('branch', branch);
60+
const response = await github.rest.pulls.list({
61+
owner: context.repo.owner,
62+
repo: context.repo.repo,
63+
state: 'open',
64+
head: `${context.repo.owner}:${branch}`
65+
});
66+
67+
if (response.data.length > 0) {
68+
pr = response.data[0];
69+
}
70+
}
71+
72+
if (!pr) {
73+
core.setOutput('run-e2e', false);
74+
console.log('No PR found');
75+
return;
76+
}
77+
78+
const labels = pr.labels.map(label => label.name);
79+
const labelFound = labels.includes('ready-for-e2e');
80+
console.log('PR #', pr.number);
81+
console.log('Found the label?', labelFound);
82+
core.setOutput('run-e2e', labelFound);
83+
3084
type-check:
3185
name: Type check
32-
needs: [changes]
33-
if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
86+
needs: [changes, check-label]
87+
if: ${{ needs.check-label.outputs.run-jobs == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
3488
uses: ./.github/workflows/check-types.yml
3589
secrets: inherit
3690

3791
lint:
3892
name: Linters
39-
needs: [changes]
40-
if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
93+
needs: [changes, check-label]
94+
if: ${{ needs.check-label.outputs.run-jobs == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
4195
uses: ./.github/workflows/lint.yml
4296
secrets: inherit
4397

4498
unit-test:
4599
name: Tests
46-
needs: [changes]
47-
if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
100+
needs: [changes, check-label]
101+
if: ${{ needs.check-label.outputs.run-jobs == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
48102
uses: ./.github/workflows/unit-tests.yml
49103
secrets: inherit
50104

51105
integration-test:
52106
name: Tests
53-
needs: [changes]
54-
if: ${{ needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
107+
needs: [changes, check-label]
108+
if: ${{ needs.check-label.outputs.run-jobs == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
55109
uses: ./.github/workflows/integration-tests.yml
56110
secrets: inherit
57111

112+
build-api-v1:
113+
name: Production builds
114+
needs: [changes, check-label]
115+
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
116+
uses: ./.github/workflows/api-v1-production-build.yml
117+
secrets: inherit
118+
119+
build-api-v2:
120+
name: Production builds
121+
needs: [changes, check-label]
122+
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
123+
uses: ./.github/workflows/api-v2-production-build.yml
124+
secrets: inherit
125+
126+
build:
127+
name: Production builds
128+
needs: [changes, check-label]
129+
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
130+
uses: ./.github/workflows/production-build-without-database.yml
131+
secrets: inherit
132+
133+
e2e:
134+
name: Tests
135+
needs: [changes, check-label, build]
136+
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
137+
uses: ./.github/workflows/e2e.yml
138+
secrets: inherit
139+
140+
e2e-app-store:
141+
name: Tests
142+
needs: [changes, check-label, build]
143+
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
144+
uses: ./.github/workflows/e2e-app-store.yml
145+
secrets: inherit
146+
147+
e2e-embed:
148+
name: Tests
149+
needs: [changes, check-label, build]
150+
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
151+
uses: ./.github/workflows/e2e-embed.yml
152+
secrets: inherit
153+
154+
e2e-embed-react:
155+
name: Tests
156+
needs: [changes, check-label, build]
157+
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
158+
uses: ./.github/workflows/e2e-embed-react.yml
159+
secrets: inherit
160+
161+
analyze:
162+
name: Analyze Build
163+
needs: [build]
164+
uses: ./.github/workflows/nextjs-bundle-analysis.yml
165+
secrets: inherit
166+
58167
required:
59-
needs: [changes, lint, type-check, unit-test, integration-test]
60-
if: always()
168+
needs: [changes, lint, type-check, unit-test, integration-test, check-label, build, build-api-v1, build-api-v2, e2e, e2e-embed, e2e-embed-react, e2e-app-store]
169+
if: ${{ needs.check-label.outputs.run-e2e == 'true' }}
61170
runs-on: buildjet-2vcpu-ubuntu-2204
62171
steps:
63172
- name: fail if conditional jobs failed

apps/api/v2/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
},
2626
"dependencies": {
2727
"@calcom/platform-constants": "*",
28+
"@calcom/platform-libraries-0.0.13": "npm:@calcom/platform-libraries@0.0.13",
2829
"@calcom/platform-libraries-0.0.2": "npm:@calcom/platform-libraries@0.0.2",
2930
"@calcom/platform-libraries-0.0.4": "npm:@calcom/platform-libraries@0.0.4",
3031
"@calcom/platform-types": "*",

apps/api/v2/src/config/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const loadConfig = (): AppConfig => {
1717
}/v2`,
1818
keyPrefix: getEnv("API_KEY_PREFIX", "cal_"),
1919
licenseKey: getEnv("CALCOM_LICENSE_KEY", ""),
20-
licenceKeyUrl: getEnv("GET_LICENSE_KEY_URL", "https://console.cal.com/api/license"),
20+
licenseKeyUrl: getEnv("GET_LICENSE_KEY_URL", "https://console.cal.com/api/license"),
2121
},
2222
db: {
2323
readUrl: getEnv("DATABASE_READ_URL"),

apps/api/v2/src/config/type.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type AppConfig = {
88
url: string;
99
keyPrefix: string;
1010
licenseKey: string;
11-
licenceKeyUrl: string;
11+
licenseKeyUrl: string;
1212
};
1313
db: {
1414
readUrl: string;

apps/api/v2/src/ee/event-types/event-types.module.ts

-17
This file was deleted.

apps/api/v2/src/ee/event-types/controllers/event-types.controller.e2e-spec.ts apps/api/v2/src/ee/event-types/event-types_2024_04_15/controllers/event-types.controller.e2e-spec.ts

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { bootstrap } from "@/app";
22
import { AppModule } from "@/app.module";
3-
import { EventTypesModule } from "@/ee/event-types/event-types.module";
4-
import { CreateEventTypeInput } from "@/ee/event-types/inputs/create-event-type.input";
5-
import { Editable } from "@/ee/event-types/inputs/enums/editable";
6-
import { BaseField } from "@/ee/event-types/inputs/enums/field-type";
7-
import { UpdateEventTypeInput } from "@/ee/event-types/inputs/update-event-type.input";
8-
import { GetEventTypePublicOutput } from "@/ee/event-types/outputs/get-event-type-public.output";
9-
import { GetEventTypeOutput } from "@/ee/event-types/outputs/get-event-type.output";
10-
import { GetEventTypesPublicOutput } from "@/ee/event-types/outputs/get-event-types-public.output";
3+
import { Editable } from "@/ee/event-types/event-types_2024_04_15//inputs/enums/editable";
4+
import { EventTypesModule_2024_04_15 } from "@/ee/event-types/event-types_2024_04_15/event-types.module";
5+
import { CreateEventTypeInput_2024_04_15 } from "@/ee/event-types/event-types_2024_04_15/inputs/create-event-type.input";
6+
import { BaseField } from "@/ee/event-types/event-types_2024_04_15/inputs/enums/field-type";
7+
import { UpdateEventTypeInput_2024_04_15 } from "@/ee/event-types/event-types_2024_04_15/inputs/update-event-type.input";
8+
import { GetEventTypePublicOutput } from "@/ee/event-types/event-types_2024_04_15/outputs/get-event-type-public.output";
9+
import { GetEventTypeOutput } from "@/ee/event-types/event-types_2024_04_15/outputs/get-event-type.output";
10+
import { GetEventTypesPublicOutput } from "@/ee/event-types/event-types_2024_04_15/outputs/get-event-types-public.output";
1111
import { HttpExceptionFilter } from "@/filters/http-exception.filter";
1212
import { PrismaExceptionFilter } from "@/filters/prisma-exception.filter";
1313
import { PermissionsGuard } from "@/modules/auth/guards/permissions/permissions.guard";
@@ -40,7 +40,7 @@ describe("Event types Endpoints", () => {
4040
beforeAll(async () => {
4141
const moduleRef = await Test.createTestingModule({
4242
providers: [PrismaExceptionFilter, HttpExceptionFilter],
43-
imports: [AppModule, UsersModule, EventTypesModule, TokensModule],
43+
imports: [AppModule, UsersModule, EventTypesModule_2024_04_15, TokensModule],
4444
})
4545
.overrideGuard(PermissionsGuard)
4646
.useValue({
@@ -83,7 +83,7 @@ describe("Event types Endpoints", () => {
8383
userEmail,
8484
Test.createTestingModule({
8585
providers: [PrismaExceptionFilter, HttpExceptionFilter],
86-
imports: [AppModule, UsersModule, EventTypesModule, TokensModule],
86+
imports: [AppModule, UsersModule, EventTypesModule_2024_04_15, TokensModule],
8787
})
8888
)
8989
.overrideGuard(PermissionsGuard)
@@ -132,7 +132,7 @@ describe("Event types Endpoints", () => {
132132
});
133133

134134
it("should create an event type", async () => {
135-
const body: CreateEventTypeInput = {
135+
const body: CreateEventTypeInput_2024_04_15 = {
136136
title: "Test Event Type",
137137
slug: "test-event-type",
138138
description: "A description of the test event type.",
@@ -173,7 +173,7 @@ describe("Event types Endpoints", () => {
173173
it("should update event type", async () => {
174174
const newTitle = "Updated title";
175175

176-
const body: UpdateEventTypeInput = {
176+
const body: UpdateEventTypeInput_2024_04_15 = {
177177
title: newTitle,
178178
disableGuests: false,
179179
slotInterval: 30,
@@ -207,7 +207,7 @@ describe("Event types Endpoints", () => {
207207
it("should return 400 if param event type id is null", async () => {
208208
const locations = [{ type: "inPerson", address: "123 Main St" }];
209209

210-
const body: UpdateEventTypeInput = {
210+
const body: UpdateEventTypeInput_2024_04_15 = {
211211
locations,
212212
};
213213

@@ -217,7 +217,7 @@ describe("Event types Endpoints", () => {
217217
it("should update event type locations", async () => {
218218
const locations = [{ type: "inPerson", address: "123 Main St" }];
219219

220-
const body: UpdateEventTypeInput = {
220+
const body: UpdateEventTypeInput_2024_04_15 = {
221221
locations,
222222
};
223223

@@ -266,7 +266,7 @@ describe("Event types Endpoints", () => {
266266
},
267267
];
268268

269-
const body: UpdateEventTypeInput = {
269+
const body: UpdateEventTypeInput_2024_04_15 = {
270270
bookingFields,
271271
};
272272

0 commit comments

Comments
 (0)