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

🔧 Configure Prisma extension in trigger.config.ts #906

Merged
merged 1 commit into from
Mar 14, 2025

Conversation

sasamuku
Copy link
Member

@sasamuku sasamuku commented Mar 14, 2025

Issue

  • resolve:

Why is this change needed?

What would you like reviewers to focus on?

Testing Verification

What was done

🤖 Generated by PR Agent at 76eeab7

  • Added Prisma extension configuration in trigger.config.ts.
  • Updated dependencies in package.json to include @trigger.dev/build.
  • Adjusted dependency versions in pnpm-lock.yaml for compatibility.

Detailed Changes

Relevant files
Enhancement
trigger.config.ts
Configure Prisma extension in trigger configuration           

frontend/apps/app/trigger.config.ts

  • Imported prismaExtension from @trigger.dev/build/extensions/prisma.
  • Added a build configuration with Prisma extension setup.
  • Configured schema path for Prisma extension.
  • +8/-0     
    Dependencies
    package.json
    Update dependencies in package.json                                           

    frontend/apps/app/package.json

  • Added @trigger.dev/build as a new dependency.
  • Ensured version alignment for @trigger.dev/sdk.
  • +1/-0     
    pnpm-lock.yaml
    Update dependency versions in pnpm-lock.yaml                         

    pnpm-lock.yaml

  • Updated dependency versions for @langchain/core, @langchain/openai,
    and zod.
  • Added new dependency details for @trigger.dev/build.
  • Adjusted transitive dependencies for compatibility.
  • +30/-11 

    Additional Notes


    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Copy link

    changeset-bot bot commented Mar 14, 2025

    ⚠️ No Changeset found

    Latest commit: 76eeab7

    Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

    This PR includes no changesets

    When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

    Click here to learn what changesets are, and how to add one.

    Click here if you're a maintainer who wants to add a changeset to this PR

    Copy link

    vercel bot commented Mar 14, 2025

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

    Name Status Preview Comments Updated (UTC)
    liam-docs 🛑 Canceled (Inspect) Mar 14, 2025 10:43am
    liam-erd-sample 🛑 Canceled (Inspect) 💬 Add feedback Mar 14, 2025 10:43am
    3 Skipped Deployments
    Name Status Preview Comments Updated (UTC)
    test-liam-docs ⬜️ Ignored (Inspect) Mar 14, 2025 10:43am
    test-liam-erd-sample ⬜️ Ignored (Inspect) Mar 14, 2025 10:43am
    test-liam-erd-web ⬜️ Ignored (Inspect) Mar 14, 2025 10:43am

    Copy link

    supabase bot commented Mar 14, 2025

    Updates to Preview Branch (add_prisma_extention_for_trigger_dev) ↗︎

    Deployments Status Updated
    Database Fri, 14 Mar 2025 10:38:16 UTC
    Services Fri, 14 Mar 2025 10:38:16 UTC
    APIs Fri, 14 Mar 2025 10:38:16 UTC

    Tasks are run on every commit but only new migration files are pushed.
    Close and reopen this PR if you want to apply changes from existing seed or migration files.

    Tasks Status Updated
    Configurations Fri, 14 Mar 2025 10:38:17 UTC
    Migrations Fri, 14 Mar 2025 10:38:17 UTC
    Seeding Fri, 14 Mar 2025 10:38:17 UTC
    Edge Functions Fri, 14 Mar 2025 10:38:17 UTC

    View logs for this Workflow Run ↗︎.
    Learn more about Supabase for Git ↗︎.

    Copy link
    Contributor

    qodo-merge-pro-for-open-source bot commented Mar 14, 2025

    CI Feedback 🧐

    (Feedback updated until commit 35cc019)

    A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

    Action: Deploy (app, VERCEL_PROJECT_ID_ERD_WEB)

    Failed stage: Run /./.github/actions/pnpm-setup [❌]

    Failure summary:

    The action failed because the pnpm-lock.yaml file is out of date with the
    frontend/apps/app/package.json file. Specifically:

  • The CI is running with the default --frozen-lockfile flag which prevents automatic updates to the
    lock file
  • There's a version mismatch for the @trigger.dev/build package:
    - In lock file: ^3.3.17 (allows any
    compatible version)
    - In package.json: 3.3.17 (requires exact version)
  • The action requires the lock file to be updated before merging the PR

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    170:  VERCEL_PROJECT_ID: prj_hCQJm6etB4Gon8ZpRF5pJ4XrujNb
    171:  PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
    172:  ##[endgroup]
    173:  Scope: all 12 workspace projects
    174:  ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with frontend/apps/app/package.json
    175:  Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
    176:  Failure reason:
    177:  specifiers in the lockfile ({"@langchain/core":"0.3.42","@langchain/openai":"0.4.4","@liam-hq/db":"workspace:*","@liam-hq/db-structure":"workspace:*","@liam-hq/erd-core":"workspace:*","@liam-hq/ui":"workspace:*","@next/third-parties":"15.1.5","@octokit/auth-app":"6.1.3","@octokit/rest":"20.0.2","@prisma/client":"6.4.1","@sentry/nextjs":"8","@trigger.dev/build":"^3.3.17","@trigger.dev/sdk":"3.3.17","cheerio":"1.0.0","date-fns":"4.1.0","dotenv":"16.4.7","flags":"3.1.1","next":"15.1.2","react":"18.3.1","react-dom":"18","ts-pattern":"5.4.0","valibot":"^1.0.0-beta.5","@biomejs/biome":"1.9.3","@octokit/openapi-types":"24.0.0","@prisma/nextjs-monorepo-workaround-plugin":"6.5.0","@types/gtag.js":"0.0.20","@types/node":"22.9.0","@types/react":"18","@types/react-dom":"18","esbuild":"0.25.1","trigger.dev":"3.3.17","typed-css-modules":"0.9.1","typescript":"5","vitest":"3.0.8"}) don't match specs in package.json ({"@biomejs/biome":"1.9.3","@octokit/openapi-types":"24.0.0","@prisma/nextjs-monorepo-workaround-plugin":"6.5.0","@types/gtag.js":"0.0.20","@types/node":"22.9.0","@types/react":"18","@types/react-dom":"18","esbuild":"0.25.1","trigger.dev":"3.3.17","typed-css-modules":"0.9.1","typescript":"5","vitest":"3.0.8","@langchain/core":"0.3.42","@langchain/openai":"0.4.4","@liam-hq/db":"workspace:*","@liam-hq/db-structure":"workspace:*","@liam-hq/erd-core":"workspace:*","@liam-hq/ui":"workspace:*","@next/third-parties":"15.1.5","@octokit/auth-app":"6.1.3","@octokit/rest":"20.0.2","@prisma/client":"6.4.1","@sentry/nextjs":"8","@trigger.dev/build":"3.3.17","@trigger.dev/sdk":"3.3.17","cheerio":"1.0.0","date-fns":"4.1.0","dotenv":"16.4.7","flags":"3.1.1","next":"15.1.2","react":"18.3.1","react-dom":"18","ts-pattern":"5.4.0","valibot":"^1.0.0-beta.5"})
    178:  ##[error]Process completed with exit code 1.
    

    @sasamuku sasamuku force-pushed the add_prisma_extention_for_trigger_dev branch from 35cc019 to 76eeab7 Compare March 14, 2025 10:37
    @sasamuku sasamuku changed the title ✨ Configure Prisma extension in trigger.config.ts 🔧 Configure Prisma extension in trigger.config.ts Mar 14, 2025
    @sasamuku sasamuku marked this pull request as ready for review March 14, 2025 10:53
    @sasamuku sasamuku requested a review from a team as a code owner March 14, 2025 10:53
    @sasamuku sasamuku requested review from hoshinotsuyoshi, FunamaYukina, junkisai, MH4GF and NoritakaIkeda and removed request for a team March 14, 2025 10:53
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Schema Path Validation

    The Prisma schema path is set to a relative path '../../packages/db/prisma/schema.prisma'. Verify that this path is correct and accessible from the app's runtime environment, especially in production deployments.

    schema: '../../packages/db/prisma/schema.prisma',

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Verify Prisma schema path

    Verify that the relative path to the Prisma schema file is correct. The path
    should be relative to the location of the trigger.config.ts file. An incorrect
    path will cause Prisma extension initialization to fail.

    frontend/apps/app/trigger.config.ts [31-37]

    -+  build: {
    -+    extensions: [
    -+      prismaExtension({
    -+        schema: '../../packages/db/prisma/schema.prisma',
    -+      }),
    -+    ],
    -+  },
    +build: {
    +  extensions: [
    +    prismaExtension({
    +      schema: '../../packages/db/prisma/schema.prisma',
    +      // Consider adding a validation check here
    +      // validateSchema: true,
    +    }),
    +  ],
    +},

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 5

    __

    Why: The suggestion correctly identifies the importance of verifying the Prisma schema path, which is a valid concern when setting up the Prisma extension. However, the improved code only adds a commented-out option rather than making a concrete change, making it somewhat less actionable.

    Low
    • More

    Comment on lines +31 to +37
    build: {
    extensions: [
    prismaExtension({
    schema: '../../packages/db/prisma/schema.prisma',
    }),
    ],
    },
    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
    Member

    @hoshinotsuyoshi hoshinotsuyoshi left a comment

    Choose a reason for hiding this comment

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

    Thank you!

    @hoshinotsuyoshi hoshinotsuyoshi added this pull request to the merge queue Mar 14, 2025
    Merged via the queue into main with commit 5902f64 Mar 14, 2025
    20 checks passed
    @hoshinotsuyoshi hoshinotsuyoshi deleted the add_prisma_extention_for_trigger_dev branch March 14, 2025 11:05
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants