Skip to content

chore: run migrations conditionally#13925

Merged
zomars merged 13 commits intomainfrom
zomars/cal-3243-run-auto-migrations-conditionally
Mar 13, 2024
Merged

chore: run migrations conditionally#13925
zomars merged 13 commits intomainfrom
zomars/cal-3243-run-auto-migrations-conditionally

Conversation

@zomars
Copy link
Copy Markdown
Contributor

@zomars zomars commented Feb 28, 2024

What does this PR do?

Fixes #13921

  • If DIRECT_DATABASE_URL is not set, skip migrations
  • If it's set but fails. It should prevent deployment from continuing.

Type of change

  • Chore (refactoring code, technical debt, workflow improvements)

How should this be tested?

  • yarn build with DATABASE_URL undefined (for DB-less builds)
  • yarn build with DATABASE_DIRECT_URL undefined
  • yarn build with DATABASE_DIRECT_URL defined
  • yarn build with a failed migration
  • yarn build withouth a failed migration

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

@linear
Copy link
Copy Markdown

linear Bot commented Feb 28, 2024

@zomars zomars requested a review from a team February 28, 2024 19:27
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 28, 2024

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

@keithwillcode keithwillcode added api area: API, enterprise API, access token, OAuth core area: core, team members only foundation labels Feb 28, 2024
Comment on lines +15 to +18
if (!process.env.DATABASE_DIRECT_URL) {
console.info("No DATABASE_DIRECT_URL found, skipping migration");
return;
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Working on Vercel
image

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Feb 28, 2024

Graphite Automations

A Graphite automation took an action on this PR • (02/28/24)

1 reviewer was added based on Keith Williams's automation, 'Add foundation team as reviewer'

Copy link
Copy Markdown
Contributor Author

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Self review done

import { exec as execCb } from "node:child_process";
import { promisify } from "node:util";

dotEnv.config({ path: "../../.env" });
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Load env locally.


main().catch((e) => {
console.error(e.stdout);
process.exit(1);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will prevent the build from continuing on error

keithwillcode
keithwillcode previously approved these changes Feb 28, 2024
Comment thread packages/prisma/auto-migrations.ts Outdated
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 28, 2024

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

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 13, 2024 6:40pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Mar 13, 2024 6:40pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Mar 13, 2024 6:40pm
qa ⬜️ Ignored (Inspect) Visit Preview Mar 13, 2024 6:40pm

keithwillcode
keithwillcode previously approved these changes Feb 28, 2024
@keithwillcode keithwillcode enabled auto-merge (squash) February 28, 2024 20:18
@deploysentinel
Copy link
Copy Markdown

deploysentinel Bot commented Feb 28, 2024

Current Playwright Test Results Summary

✅ 303 Passing - ⚠️ 7 Flaky

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

(Last updated on 03/13/2024 06:53:12pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 8019727

Started: 03/13/2024 06:49:01pm UTC

⚠️ Flakes

📄   apps/web/playwright/event-types.e2e.ts • 1 Flake

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 1Initial Attempt
0.44% (1) 1 / 226 run
failed over last 7 days
18.58% (42) 42 / 226 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Payment app when more than one payment app is installed the price should be updated when changing settings
Retry 1Initial Attempt
0% (0) 0 / 222 runs
failed over last 7 days
5.41% (12) 12 / 222 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 Can update a users email (verification enabled)
Retry 1Initial Attempt
7.14% (16) 16 / 224 runs
failed over last 7 days
22.77% (51) 51 / 224 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
1.76% (4) 4 / 227 runs
failed over last 7 days
27.75% (63) 63 / 227 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Organization Email not matching orgAutoAcceptEmail nonexisting user invited to an organization
Retry 1Initial Attempt
0.47% (1) 1 / 215 run
failed over last 7 days
9.77% (21) 21 / 215 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Stripe integration Pending payment booking should not be confirmed by default
Retry 1Initial Attempt
5.81% (14) 14 / 241 runs
failed over last 7 days
22.41% (54) 54 / 241 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/inline.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Inline Iframe Inline Iframe - Configured with Dark Theme
Retry 1Initial Attempt
4.55% (11) 11 / 242 runs
failed over last 7 days
46.69% (113) 113 / 242 runs
flaked over last 7 days

View Detailed Build Results


@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 28, 2024

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

Signed-off-by: zomars <zomars@me.com>
@zomars zomars marked this pull request as ready for review March 13, 2024 18:51
@zomars zomars requested a review from keithwillcode March 13, 2024 18:51
@zomars zomars dismissed keithwillcode’s stale review March 13, 2024 18:51

Checks are passing now

@zomars zomars requested a review from a team March 13, 2024 18:51
@zomars zomars enabled auto-merge (squash) March 13, 2024 19:32
@zomars zomars merged commit 502a324 into main Mar 13, 2024
@zomars zomars deleted the zomars/cal-3243-run-auto-migrations-conditionally branch March 13, 2024 19:52
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 core area: core, team members only foundation High priority Created by Linear-GitHub Sync ❗️ migrations contains migration files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CAL-3243] Run auto migrations conditionally

4 participants