Skip to content

fix: Resolve version mismatch between local env and ci (#2861)#2862

Merged
KATO-Hiro merged 3 commits intostagingfrom
#2861
Nov 20, 2025
Merged

fix: Resolve version mismatch between local env and ci (#2861)#2862
KATO-Hiro merged 3 commits intostagingfrom
#2861

Conversation

@KATO-Hiro
Copy link
Collaborator

@KATO-Hiro KATO-Hiro commented Nov 20, 2025

close #2861

Summary by CodeRabbit

  • Bug Fixes

    • Resolved Prisma version mismatch between local and CI environments so database migrations run consistently across preview and production pipelines.
  • Documentation

    • Added a detailed implementation plan (in Japanese) outlining scope, checklist, validation steps, and future migration considerations to guide updating Prisma and related tooling.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 20, 2025

Walkthrough

Updates CI workflow to run Prisma migrate via pnpm exec instead of pnpm dlx in preview and production jobs. Adds a Japanese plan document describing steps to resolve Prisma version mismatch between local (v5.22) and CI (v7.x).

Changes

Cohort / File(s) Summary
CI Workflow Command Update
\.github/workflows/ci.yml``
Replaces pnpm dlx prisma migrate deploy with pnpm exec prisma migrate deploy in both preview and production job steps.
Version Mismatch Resolution Plan
\docs/dev-notes/2025-11-20/resolve_version_mismatch_between_local_env_and_ci/plan.md``
Adds a comprehensive plan (in Japanese) documenting scope, background, CI edits (the exact YAML diff), checklist, validation criteria, future tasks, references, Q&A, and an implementation log.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review focus: confirm both CI job steps were updated consistently and that no other CI changes were introduced.
  • Verify the plan document content for accuracy and clarity (non-executable).

Poem

🐰
I hopped through YAML, keen and quick,
Swapped dlx for exec — a tiny trick.
Docs penned in Japanese, neat and spry,
Versions align beneath the sky.
Pipelines hum; the migrations fly.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR changes only the Prisma migration launcher command but does not address the core P1012 errors requiring schema file modifications and PrismaClient configuration updates specified in issue #2861. Remove datasource url and directUrl from prisma/schema.prisma, create prisma.config.ts with connection URLs, and update PrismaClient constructor to pass adapter or accelerateUrl parameter.
Out of Scope Changes check ❓ Inconclusive The PR introduces a documentation file (plan.md) explaining the version mismatch resolution, which is supplementary but slightly outside the core code changes needed to resolve issue #2861. Clarify whether documentation files should be included in this PR or deferred to a separate documentation update after code changes are completed.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—resolving version mismatch between local and CI environments by updating the Prisma migration command.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch #2861

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 04a6c28 and bf0e6a6.

📒 Files selected for processing (1)
  • docs/dev-notes/2025-11-20/resolve_version_mismatch_between_local_env_and_ci/plan.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: preview

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between a863eb2 and 04a6c28.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml (2 hunks)
  • docs/dev-notes/2025-11-20/resolve_version_mismatch_between_local_env_and_ci/plan.md (1 hunks)
🔇 Additional comments (7)
.github/workflows/ci.yml (2)

105-109: Correct version targeting for preview migrations.

Switching from pnpm dlx to pnpm exec ensures Prisma v5.22 (from node_modules per package.json) runs instead of the latest registry version (v7.x). This resolves the breaking change where Prisma v7 deprecated url and directUrl in schema files. As of Prisma v7, the url and directUrl fields in the datasource block are deprecated and must be configured in Prisma Config instead. The environment variables are correctly propagated.


157-161: Correct version targeting for production migrations.

Same fix as the preview job: pnpm exec ensures v5.22 compatibility. Environment variables are correctly set for production. The change aligns with the documented version mismatch resolution strategy.

docs/dev-notes/2025-11-20/resolve_version_mismatch_between_local_env_and_ci/plan.md (5)

11-50: Excellent root-cause analysis and clear problem statement.

The overview and background sections accurately identify why the mismatch occurs (pnpm dlx downloads v7.x vs pnpm exec uses v5.22) and correctly attribute the breaking change to Prisma v7's deprecation of url/directUrl in schema files. The rationale for staying on v5.22 (Lucia v2.7.7 compatibility) is reasonable as a temporary measure.


57-99: Clear and correct modification plan with appropriate diffs.

Both preview and production jobs are covered identically. The before/after examples are accurate and environment variable handling is unchanged, which is correct.


112-129: Implementation checklist properly reflects completed CI changes.

Both YAML modifications are marked complete. Deployment verification steps are appropriately marked incomplete—these should be confirmed once the PR passes CI and deploys to preview/production.

Ensure the pending verification steps (lines 122-124) are completed and logged before considering this fix fully validated. The checklist should be updated with CI log inspection once GitHub Actions runs.


142-178: Well-structured future work with clear dependencies and priorities.

The three future tasks (Prisma v7 migration, Lucia library refresh, migration guide) are properly sequenced with realistic priorities and dependencies documented. Task 1 should complete before Task 2, and Task 3 naturally follows. This roadmap aligns with the decision to defer the v7 migration rather than force it immediately.


235-269: Implementation log is thorough; clarify CI/deployment completion status.

The log correctly documents that local unit tests passed and that the YAML changes are complete. However, lines 249–252 show CI execution and deployment verification as pending. The PR should not be merged until those steps are confirmed. Consider adding a note that this plan requires deployment testing before final validation.

Once the PR is deployed to preview/production and migrations execute successfully, update the completion log (lines 249–252) with ✅ or ❌ markers and any relevant error logs or version confirmations from CI output.

Copy link
Collaborator Author

@KATO-Hiro KATO-Hiro left a comment

Choose a reason for hiding this comment

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

LGTM

@KATO-Hiro KATO-Hiro merged commit a6bfdbc into staging Nov 20, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2861 branch November 20, 2025 11:54
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.

[Bug] ローカル環境とCI で Prisma のバージョンが異なるので、ローカル環境に合わせましょう

1 participant