From af110633c1fcbc84b9ff31d7cdcdbfb51244b698 Mon Sep 17 00:00:00 2001 From: Keith Williams Date: Thu, 1 Jan 2026 23:00:56 -0300 Subject: [PATCH] refactor: detach yarn prisma generate from yarn-install action (#26382) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: detach yarn prisma generate from yarn-install action Co-Authored-By: keith@cal.com * fix: add run-prisma-generate input for backward compatibility The yarn-install action now has a run-prisma-generate input that defaults to true for backward compatibility. This ensures CI works correctly since workflow files are pulled from the base branch (main) while actions are pulled from the PR branch. Workflows that have explicit yarn prisma generate steps now set run-prisma-generate: false to avoid running it twice after merge. Co-Authored-By: keith@cal.com * refactor: completely remove prisma generate from yarn-install action Remove all prisma-related code from the yarn-install action: - Remove the run-prisma-generate input parameter - Remove the Generate Prisma client step Remove explicit yarn prisma generate steps from all workflow files. Prisma generation is now handled by the postinstall script in package.json which runs 'turbo run post-install' after yarn install. This triggers @calcom/prisma#post-install which runs 'prisma generate && prisma format'. This makes the yarn-install action have no knowledge of Prisma at all, as requested. Co-Authored-By: keith@cal.com * fix: add generic post-install step to ensure generated files are up-to-date When all caches are hit, yarn install completes quickly without running the postinstall script. This means generated files (like Prisma types) may not be created. Add a generic 'turbo run post-install' step that runs after yarn install to ensure all post-install tasks complete regardless of cache state. This keeps the action from having Prisma-specific knowledge while ensuring the post-install pipeline runs. Co-Authored-By: keith@cal.com * refactor: remove post-install step from yarn-install action Remove the turbo run post-install step as requested. The yarn-install action now only handles yarn install with caching, with no knowledge of post-install tasks or Prisma generation. Let CI show what fails without explicit post-install handling. Co-Authored-By: keith@cal.com * Add back Prisma schema loaded from schema.prisma ✔ Generated Prisma Client (6.16.1) to ./generated/prisma in 442ms ✔ Generated Zod Prisma Types to ./zod in 1.43s ✔ Generated Kysely types (2.2.0) to ./../kysely in 271ms ✔ Generated Prisma Enum Generator to ./enums/index.ts in 176ms where needed * Adding Prisma schema loaded from schema.prisma ✔ Generated Prisma Client (6.16.1) to ./generated/prisma in 451ms ✔ Generated Zod Prisma Types to ./zod in 1.40s ✔ Generated Kysely types (2.2.0) to ./../kysely in 271ms ✔ Generated Prisma Enum Generator to ./enums/index.ts in 205ms where needed for E2E --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/actions/yarn-install/action.yml | 4 +--- .github/workflows/api-v2-unit-tests.yml | 1 + .github/workflows/check-api-v2-breaking-changes.yml | 4 +++- .github/workflows/e2e-app-store.yml | 1 + .github/workflows/e2e-embed-react.yml | 1 + .github/workflows/e2e-embed.yml | 1 + .github/workflows/e2e.yml | 1 + .github/workflows/integration-tests.yml | 1 + .github/workflows/setup-db.yml | 2 ++ .github/workflows/unit-tests.yml | 1 + 10 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/actions/yarn-install/action.yml b/.github/actions/yarn-install/action.yml index a930ce326d..e30334a1c9 100644 --- a/.github/actions/yarn-install/action.yml +++ b/.github/actions/yarn-install/action.yml @@ -112,9 +112,7 @@ runs: - name: Install dependencies if: ${{ inputs.skip-install-if-cache-hit != 'true' || steps.all-caches-check.outputs.all-hit != 'true' }} shell: bash - run: | - yarn install --inline-builds - yarn prisma generate + run: yarn install --inline-builds env: # CI optimizations. Overrides yarnrc.yml options (or their defaults) in the CI action. YARN_ENABLE_IMMUTABLE_INSTALLS: "false" # So it doesn't try to remove our private submodule deps diff --git a/.github/workflows/api-v2-unit-tests.yml b/.github/workflows/api-v2-unit-tests.yml index 20d599ccd8..5c6fd7b69c 100644 --- a/.github/workflows/api-v2-unit-tests.yml +++ b/.github/workflows/api-v2-unit-tests.yml @@ -14,6 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/dangerous-git-checkout - uses: ./.github/actions/yarn-install + - run: yarn prisma generate - name: Run API v2 unit tests working-directory: apps/api/v2 run: | diff --git a/.github/workflows/check-api-v2-breaking-changes.yml b/.github/workflows/check-api-v2-breaking-changes.yml index cc124fc538..b41d3b719b 100644 --- a/.github/workflows/check-api-v2-breaking-changes.yml +++ b/.github/workflows/check-api-v2-breaking-changes.yml @@ -39,7 +39,9 @@ jobs: - name: Generate Swagger working-directory: apps/api/v2 - run: yarn generate-swagger + run: | + yarn prisma generate + yarn generate-swagger - name: Check API v2 breaking changes run: | diff --git a/.github/workflows/e2e-app-store.yml b/.github/workflows/e2e-app-store.yml index 8a4ca30454..e3e1774c80 100644 --- a/.github/workflows/e2e-app-store.yml +++ b/.github/workflows/e2e-app-store.yml @@ -84,6 +84,7 @@ jobs: - uses: ./.github/actions/dangerous-git-checkout - uses: ./.github/actions/yarn-install - uses: ./.github/actions/yarn-playwright-install + - run: yarn prisma generate - uses: ./.github/actions/cache-db env: DATABASE_URL: ${{ secrets.CI_DATABASE_URL }} diff --git a/.github/workflows/e2e-embed-react.yml b/.github/workflows/e2e-embed-react.yml index 80112c3e4b..a58cac8484 100644 --- a/.github/workflows/e2e-embed-react.yml +++ b/.github/workflows/e2e-embed-react.yml @@ -76,6 +76,7 @@ jobs: - uses: ./.github/actions/dangerous-git-checkout - uses: ./.github/actions/yarn-install - uses: ./.github/actions/yarn-playwright-install + - run: yarn prisma generate - uses: ./.github/actions/cache-db - uses: ./.github/actions/cache-build - name: Run Tests diff --git a/.github/workflows/e2e-embed.yml b/.github/workflows/e2e-embed.yml index 614b098d93..c3b9b5e3c6 100644 --- a/.github/workflows/e2e-embed.yml +++ b/.github/workflows/e2e-embed.yml @@ -84,6 +84,7 @@ jobs: - uses: ./.github/actions/dangerous-git-checkout - uses: ./.github/actions/yarn-install - uses: ./.github/actions/yarn-playwright-install + - run: yarn prisma generate - uses: ./.github/actions/cache-db - uses: ./.github/actions/cache-build - name: Run Tests diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a5132a89d1..54a20cb066 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -85,6 +85,7 @@ jobs: - uses: ./.github/actions/dangerous-git-checkout - uses: ./.github/actions/yarn-install - uses: ./.github/actions/yarn-playwright-install + - run: yarn prisma generate - uses: ./.github/actions/cache-db - uses: ./.github/actions/cache-build - name: Run Tests diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index c9c6563e88..83605ea5cc 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -81,6 +81,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/dangerous-git-checkout - uses: ./.github/actions/yarn-install + - run: yarn prisma generate - uses: ./.github/actions/cache-db - name: Run Tests run: VITEST_MODE=integration yarn test diff --git a/.github/workflows/setup-db.yml b/.github/workflows/setup-db.yml index a4618d1fb9..f0634a0c68 100644 --- a/.github/workflows/setup-db.yml +++ b/.github/workflows/setup-db.yml @@ -50,5 +50,7 @@ jobs: - uses: ./.github/actions/dangerous-git-checkout - uses: ./.github/actions/yarn-install if: inputs.DB_CACHE_HIT != 'true' + - run: yarn prisma generate + if: inputs.DB_CACHE_HIT != 'true' - uses: ./.github/actions/cache-db if: inputs.DB_CACHE_HIT != 'true' diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 34fd4c1d08..a922ec9698 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -14,6 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/dangerous-git-checkout - uses: ./.github/actions/yarn-install + - run: yarn prisma generate - run: yarn test -- --no-isolate # We could add different timezones here that we need to run our tests in - run: TZ=America/Los_Angeles VITEST_MODE=timezone yarn test -- --no-isolate