chore(deps): bump the prisma group with 2 updates#1813
chore(deps): bump the prisma group with 2 updates#1813dependabot[bot] wants to merge 17 commits intomainfrom
Conversation
c1896dc to
c171b71
Compare
ae48384 to
9f707b2
Compare
4c20be5 to
b69f405
Compare
5eb57e0 to
561dd98
Compare
e5733ee to
509933e
Compare
Co-authored-by: Natasha <novembertang@users.noreply.github.com>
add esm format, copy package.json
509933e to
fb59712
Compare
tjsilver
left a comment
There was a problem hiding this comment.
Looks good! I tested this branch locally by deleting all node_modules folders and reinstalling packages. This failed until I also deleted the prisma client in \packages/common/src/prisma-client\, which I guess makes sense.
kelvin-chappell
left a comment
There was a problem hiding this comment.
Looks good as far as I can tell! Interested to see copilot's take on it
There was a problem hiding this comment.
Pull request overview
Updates the repository to Prisma v7, adapting runtime/database setup and build tooling to Prisma’s new client generation and Postgres adapter approach, plus Node 20 Lambda TLS CA handling.
Changes:
- Switch Prisma type/client imports from
@prisma/clientto generated code atcommon/prisma-client/client.jsand update Prisma schema/config for v7. - Update database setup to use
@prisma/adapter-pgand adjust lint/tsconfig to accommodate generated client + ESM constraints. - Update Lambda build/deployment configuration (esbuild ESM banner, postbuild package.json copy, and
NODE_EXTRA_CA_CERTSenv var) for Prisma + Node 20.
Reviewed changes
Copilot reviewed 63 out of 66 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/build.sh | Adjust Prisma Lambda packaging |
| packages/repocop/src/types.ts | Update Prisma type imports |
| packages/repocop/src/remediation/vuln-digest/vuln-digest.ts | Update Prisma type imports |
| packages/repocop/src/remediation/vuln-digest/vuln-digest.test.ts | Update Prisma type imports |
| packages/repocop/src/remediation/topics/topic-monitor-production.ts | Update Prisma type imports |
| packages/repocop/src/remediation/topics/topic-monitor-interactive.ts | Update Prisma type imports |
| packages/repocop/src/remediation/topics/topic-monitor-interactive.test.ts | Update Prisma type imports |
| packages/repocop/src/remediation/shared-utilities.ts | Update Prisma type imports |
| packages/repocop/src/remediation/dependency_graph-integrator/send-to-sns.ts | Update Prisma type imports |
| packages/repocop/src/remediation/dependency_graph-integrator/send-to-sns.test.ts | Update Prisma type imports |
| packages/repocop/src/remediation/branch-protector/branch-protection.ts | Update Prisma type imports |
| packages/repocop/src/remediation/branch-protector/branch-protection.test.ts | Update Prisma type imports |
| packages/repocop/src/query.ts | Update Prisma type imports |
| packages/repocop/src/metrics.ts | Update Prisma type imports |
| packages/repocop/src/index.ts | Update Prisma type imports |
| packages/repocop/src/evaluation/repository.ts | Update Prisma type imports |
| packages/repocop/src/evaluation/repository.test.ts | Update Prisma type imports |
| packages/repocop/package.json | esbuild ESM + postbuild |
| packages/refresh-materialized-view/package.json | esbuild ESM + postbuild |
| packages/obligatron/src/obligations/github-topics.ts | Update Prisma type imports |
| packages/obligatron/src/obligations/github-topics.test.ts | Update Prisma type imports |
| packages/obligatron/src/obligations/dependency-vulnerabilities.ts | Update Prisma type imports |
| packages/obligatron/src/obligations/aws-vulnerabilities.ts | Update Prisma type imports |
| packages/obligatron/src/index.ts | Update Prisma type imports |
| packages/obligatron/package.json | esbuild ESM + postbuild |
| packages/github-actions-usage/src/db-write.ts | Update Prisma type imports |
| packages/github-actions-usage/src/db-read.ts | Update Prisma type imports |
| packages/github-actions-usage/package.json | esbuild ESM + postbuild |
| packages/data-audit/src/audit/database.ts | Update Prisma type imports |
| packages/data-audit/src/audit/aws-s3-buckets.ts | Update Prisma type imports |
| packages/data-audit/src/audit/aws-lambda.ts | Update Prisma type imports |
| packages/data-audit/src/audit/aws-accounts.ts | Update Prisma type imports |
| packages/data-audit/package.json | esbuild ESM + postbuild |
| packages/common/tsconfig.json | Adjust TS config for Prisma v7 |
| packages/common/src/types.ts | Update Prisma type imports |
| packages/common/src/projects-graphql.ts | Add eslint disables for Octokit typing |
| packages/common/src/functions.ts | Add eslint disables for Octokit typing |
| packages/common/src/database-setup.ts | Switch to adapter-pg + generated client |
| packages/common/src/database-queries.ts | Update Prisma type imports |
| packages/common/prisma/schema.prisma | Prisma v7 generator/output changes |
| packages/common/prisma.config.ts | New Prisma config datasource url |
| packages/common/package.json | Bump Prisma deps + add adapter |
| packages/cloudquery-usage/src/transform.ts | Update Prisma type imports |
| packages/cloudquery-usage/src/transform.test.ts | Update Prisma type imports |
| packages/cloudquery-usage/src/db-write.ts | Update Prisma type imports |
| packages/cloudquery-usage/package.json | esbuild ESM + postbuild |
| packages/cloudbuster/src/types.ts | Update Prisma type imports |
| packages/cloudbuster/src/index.ts | Update Prisma type imports |
| packages/cloudbuster/src/findings.ts | Update Prisma type imports |
| packages/cloudbuster/src/findings.test.ts | Update Prisma type imports |
| packages/cloudbuster/src/digests.ts | Update Prisma type imports |
| packages/cloudbuster/src/digests.test.ts | Update Prisma type imports |
| packages/cloudbuster/package.json | esbuild ESM + postbuild |
| packages/cli/src/database.ts | Update migration flow for Prisma v7 |
| packages/cdk/lib/repocop.ts | Add NODE_EXTRA_CA_CERTS env |
| packages/cdk/lib/refresh-materialized-view.ts | Add NODE_EXTRA_CA_CERTS env |
| packages/cdk/lib/obligatron.ts | Add NODE_EXTRA_CA_CERTS env |
| packages/cdk/lib/github-actions-usage.ts | Add NODE_EXTRA_CA_CERTS env |
| packages/cdk/lib/data-audit.ts | Add NODE_EXTRA_CA_CERTS env |
| packages/cdk/lib/cloudquery-usage.ts | Add NODE_EXTRA_CA_CERTS env |
| packages/cdk/lib/cloudbuster.ts | Add NODE_EXTRA_CA_CERTS env |
| packages/cdk/lib/snapshots/service-catalogue.test.ts.snap | Snapshot updates for env |
| eslint.config.mjs | Ignore generated Prisma client dir |
| .gitignore | Ignore generated Prisma client dir |
| .github/workflows/ci.yml | Provide DATABASE_URL for CI migration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
packages/cli/src/database.ts
Outdated
| const dbConfig = await getDevDatabaseConfig(); | ||
| const connectionString = getDatabaseConnectionString(dbConfig); | ||
|
|
||
| console.log('Setting DATABASE_URL'); | ||
| process.env.DATABASE_URL = connectionString; | ||
|
|
||
| console.log(`Running prisma migrate reset --force`); | ||
| const { stdout } = await $`npx -w common prisma migrate reset --force`; | ||
| const { stdout } = | ||
| await $`npx -w common prisma migrate reset --force --config prisma.config.ts --schema prisma/schema.prisma`; | ||
| console.log(stdout); |
| /* eslint-disable @typescript-eslint/no-unsafe-assignment -- this is not unsafe */ | ||
| /* eslint-disable @typescript-eslint/no-unsafe-call -- this is not unsafe */ | ||
| export async function getGithubClient( |
| /* eslint-disable @typescript-eslint/no-unsafe-assignment -- this is not unsafe */ | ||
| /* eslint-disable @typescript-eslint/no-unsafe-call -- this is not unsafe */ | ||
|
|
||
| export async function addPrToProject( | ||
| stage: string, | ||
| shortRepoName: string, | ||
| boardNumber: number, | ||
| author: string, | ||
| ) { | ||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- this is not unsafe | ||
| const graphqlWithAuth = (await stageAwareOctokit(stage)).graphql; | ||
|
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ba990b8 to
21945f0
Compare
Prisma 6->7 has a few breaking changes. Most of this PR is modifications to imports and the lockfile, so I'll highlight the key bits below
prisma schema file - Prisma now generates typescript code that can be placed alongside your regular code. It has deprecated
datasource->url, and this is now handled by the@prisma/adapter-pglibrary. The autogenerated code needs to be excluded from the lint step.Node CA certs are no longer loaded by default in lambdas running node 20+. To fix this, we are now including
NODE_EXTRA_CA_CERTSas an environment variable in lambdas that use prisma, as this is required for the TLS handshake to the DBtsconfig - prisma v7 is not compatible with NodeNext. We are now using ESNext, so have adjusted the build scripts of the relavent lambdas to make this compatible. It also doesn't play very nicely with octokit's types so we've disabled some warnings for now. This PR is already large enough that resolving those issues should be a separate PR