Skip to content

Upgrade Prisma to 7#191

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/upgrade-prisma-to-version-7
Draft

Upgrade Prisma to 7#191
Copilot wants to merge 4 commits intomasterfrom
copilot/upgrade-prisma-to-version-7

Conversation

Copy link

Copilot AI commented Nov 30, 2025

Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

Related issues: N/A
Closes #N/A

Further information:

Upgrades Prisma ecosystem from v6 to v7, handling breaking changes including the pg adapter API and enum value mapping.

Dependency Updates

  • prisma, @prisma/client, @prisma/adapter-pg, @prisma/instrumentation → 7.0.1
  • prisma-json-types-generator → 4.0.0-beta.1

Breaking Changes Addressed

Prisma 7 Configuration

  • Added prisma.config.ts for adapter configuration
  • Removed url from datasource in schema (adapter provides connection)

Enum Value Changes

  • Prisma 7 uses @map() database values ('Created', 'In-Progress') instead of TypeScript keys ('CREATED', 'IN_PROGRESS')
  • Created src/common/utils/statusMapping.ts for bidirectional API ↔ Prisma conversion

Architecture

  • Managers accept API types at public interface, convert at DAL boundary
  • Controllers unchanged
// API types (uppercase) vs Prisma types (database mapped)
convertJobStatusToPrisma('PENDING')    // → 'Pending'
convertJobStatusToApi('Pending')       // → 'PENDING'

Testing

  • Created mock PrismaClient for unit tests (Prisma 7 requires adapter for instantiation)
  • Updated test expectations for API status format
  • All 122 unit tests passing

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint.prisma.io
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.21.1/bin/node /home/REDACTED/.nvm/versions/node/v22.21.1/bin/node /home/REDACTED/work/jobnik-manager/jobnik-manager/node_modules/prisma/build/child {"product":"prisma","version":"6.19.0","cli_install_type":"local","information":"","local_timestamp":"2025-11-30T11:30:29Z","project_hash":"09e7c99d","cli_path":"/home/REDACTED/work/jobnik-manager/jobnik-manager/node_modules/.bin/prisma","cli_path_hash":"f1 (dns block)
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.21.1/bin/node /home/REDACTED/.nvm/versions/node/v22.21.1/bin/node /home/REDACTED/work/jobnik-manager/jobnik-manager/node_modules/prisma/build/child {"product":"prisma","version":"7.0.1","cli_install_type":"local","information":"","local_timestamp":"2025-11-30T11:33:15Z","project_hash":"09e7c99d","cli_path":"/home/REDACTED/work/jobnik-manager/jobnik-manager/node_modules/.bin/prisma","cli_path_hash":"f1c (dns block)
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.21.1/bin/node /home/REDACTED/.nvm/versions/node/v22.21.1/bin/node /home/REDACTED/work/jobnik-manager/jobnik-manager/node_modules/prisma/build/child {"product":"prisma","version":"7.0.1","cli_install_type":"local","information":"","local_timestamp":"2025-11-30T11:33:54Z","project_hash":"09e7c99d","cli_path":"/home/REDACTED/work/jobnik-manager/jobnik-manager/node_modules/.bin/prisma","cli_path_hash":"f1c (dns block)
  • iojs.org
    • Triggering command: /usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o - (dns block)
  • scarf.sh
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.21.1/bin/node node ./report.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Upgrade prisma to 7</issue_title>
<issue_description>We want to upgrade prisma and all its ecosystem packages to 7.
it should take into account all the breaking changes like the pg adaptor.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 30, 2025
Copilot AI and others added 3 commits November 30, 2025 11:55
- Upgraded prisma, @prisma/client, @prisma/adapter-pg, @prisma/instrumentation to 7.0.1
- Upgraded prisma-json-types-generator to 4.0.0-beta.1
- Created prisma.config.ts for Prisma 7 configuration
- Removed url from datasource in schema.prisma (Prisma 7 breaking change)
- Added status mapping utilities for converting between API and Prisma enum values
- Updated managers to accept API types and convert at the DAL boundary
- Updated all internal cross-manager calls to use proper status conversions
- Created mock PrismaClient for unit tests (Prisma 7 requires adapter)

Co-authored-by: CptSchnitz <12687466+CptSchnitz@users.noreply.github.com>
- Updated unit tests to use API status values (uppercase like 'CREATED', 'PENDING')
- Updated test expectations to expect API format in responses
- Created mock PrismaClient for unit tests (Prisma 7 requires adapter)

Co-authored-by: CptSchnitz <12687466+CptSchnitz@users.noreply.github.com>
… handling

- Added runtime validation to status/priority conversion functions
- Improved error handling in getSummaryKeyForStatus
- Updated prisma.config.ts with more obvious placeholder URL
- Fixed remaining tests to use API status values

Co-authored-by: CptSchnitz <12687466+CptSchnitz@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Nov 30, 2025

Coverage Report

Status Category Percentage Covered / Total
🔴 Lines 0% (🎯 80%) 0 / 1979
🔴 Statements 0% (🎯 80%) 0 / 1979
🔴 Functions 51.85% (🎯 80%) 14 / 27
🔴 Branches 51.85% (🎯 80%) 14 / 27
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/common/errors.ts 0% 100% 100% 0% 3-25
src/common/utils/statusMapping.ts 0% 100% 100% 0% 11-166
src/jobs/models/manager.ts 0% 100% 100% 0% 2-298
src/stages/DAL/stageRepository.ts 0% 0% 0% 0% 1-62
src/stages/models/helper.ts 0% 0% 0% 0% 1-122
src/stages/models/manager.ts 0% 100% 100% 0% 2-506
src/tasks/models/helper.ts 0% 100% 100% 0% 2-34
src/tasks/models/manager.ts 0% 100% 100% 0% 2-568
Generated in workflow #613 for commit 5eb27f6 by the Vitest Coverage Report Action

Copilot AI changed the title [WIP] Upgrade prisma and ecosystem packages to version 7 Upgrade Prisma to 7 Nov 30, 2025
Copilot AI requested a review from CptSchnitz November 30, 2025 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade prisma to 7

2 participants