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

fix: v2 event-types versioning #15549

Merged
merged 20 commits into from
Jun 24, 2024
Merged

fix: v2 event-types versioning #15549

merged 20 commits into from
Jun 24, 2024

Conversation

supalarry
Copy link
Contributor

@supalarry supalarry commented Jun 24, 2024

Problem

Was testing platform starter kit and noticed that event-types can't be fetched:

Screenshot 2024-06-24 at 11 21 11

Reason

I refactored event-types in PR #15457 and versioned old event-types endpoints at version VERSION_2024_04_15 while the new event-types at VERSION_2024_06_14, but forgot that there are people using version VERSION_2024_06_11 that is between, which is version that platform starter kit is using.

Solution

Add version VERSION_2024_06_11 to the old event-types controller aka make it process all event-types before latest VERSION_2024_06_14 in event-types.controller.ts.

Then, change old event-types tests to add VERSION_2024_04_15 headers to requests, and then a new test with api version header at VERSION_2024_06_11. To run event-types tests run:

npx jest apps/api/v2/src/ee/event-types/event-types_2024_04_15/controllers/event-types.controller.e2e-spec.ts --config jest-e2e.json
npx jest apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts --config jest-e2e.json

@graphite-app graphite-app bot requested a review from a team June 24, 2024 09:30
Copy link

vercel bot commented Jun 24, 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 Jun 24, 2024 10:27am
cal ⬜️ Ignored (Inspect) Visit Preview Jun 24, 2024 10:27am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jun 24, 2024 10:27am

@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels Jun 24, 2024
@graphite-app graphite-app bot requested a review from a team June 24, 2024 09:30
@dosubot dosubot bot added api area: API, enterprise API, access token, OAuth 🐛 bug Something isn't working labels Jun 24, 2024
@supalarry supalarry removed the request for review from a team June 24, 2024 09:33
Copy link

graphite-app bot commented Jun 24, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (06/24/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 • (06/24/24)

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

@keithwillcode keithwillcode changed the title fix: v2 even-types versioning fix: v2 event-types versioning Jun 24, 2024
@@ -375,13 +405,17 @@ describe("Event types Endpoints", () => {
it(`/GET/:id not existing`, async () => {
await request(app.getHttpServer())
.get(`/api/v2/event-types/1000`)
.set(CAL_API_VERSION_HEADER, VERSION_2024_04_15)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it needed to add this header to all these calls since it's the default and fallback when the header isn't supplied?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically no, but I added it because the modified controller now has version array version: [] instead of string version: string and I just make sure that it works as expected.

Copy link
Contributor

📦 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! 🙌

@keithwillcode keithwillcode changed the base branch from main to gh-actions-test-branch June 24, 2024 10:26
@keithwillcode
Copy link
Contributor

keithwillcode commented Jun 24, 2024

@supalarry I temporarily changed the target branch of this to gh-actions-test-branch because it has failing E2E, the same ones that are failing for a lot of PRs trying to go into main right now. I've made some changes in gh-actions-test-branch to the CI workflow and I want to see if they help.

@keithwillcode keithwillcode changed the base branch from gh-actions-test-branch to main June 24, 2024 10:43
@keithwillcode keithwillcode added this pull request to the merge queue Jun 24, 2024
Merged via the queue into main with commit 08f4a48 Jun 24, 2024
47 of 54 checks passed
@keithwillcode keithwillcode deleted the fix-v2-versioning branch June 24, 2024 11:14
p6l-richard pushed a commit to p6l-richard/cal.com-fork that referenced this pull request Jul 22, 2024
* Added a log for pull_request

* Added labels logging

* Using labels straight from event PR object

* Converting to JSON

* Switching to use payload

* Fixed issue with undefined pr

* Fixed non-mapping issue

* Removed the types

* Added another cache key segment using the head commit sha

* Added separate workflow for labeled action

* Fixed syntax error

* Fixing payload issue

* Added log

* logging full object

* Put e2e back in the names to help find them

* Limited logging

* fix: v2 even-types versioning

* test: old v2 even-types request with VERSION_2024_06_11

* test: old v2 even-types request with VERSION_2024_04_15

---------

Co-authored-by: Keith Williams <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api area: API, enterprise API, access token, OAuth 🐛 bug Something isn't working core area: core, team members only platform Anything related to our platform plan ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants