Skip to content

docs(composer): update the Composer pages to Composer 0.41.2: required targetRef, upgrade steps, region fix - #9030

Merged
wmadden-electric merged 6 commits into
mainfrom
docs/composer-0.41.2
Dec 3, 2026
Merged

wmadden-electric merged 6 commits into
mainfrom
docs/composer-0.41.2

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Composer 0.41.2 is now latest on npm, but the Composer pages on docs.prisma.io still describe Composer 0.40.0. An app that follows them today fails its type check, because Composer 0.41 requires every postgres({ ... }) database to name a targetRef: the migration ref the database is migrated to on each deploy. This pull request brings the Composer pages, and the pages elsewhere that describe the same things, up to Composer 0.41.2, Prisma ORM 8.0.0-rc.28 and prisma 8.0.0-rc.39.

At a glance

const db = provision(
  postgres({
    name: 'database',
    contract: catalogData,
    config: './prisma.config.ts',
    targetRef: resolve([environment.name], ([name]) => (name === 'dev' ? '@contract' : name)),
  }),
);

'@contract' means the contract the current commit emits; any other value names a committed ref file in migrations/app/refs/. Every deploy and every prisma dev rebuild runs prisma db migrate --to <targetRef> on the database.

What changed in Composer since 0.40.0

These pages are a rewritten copy of the guides in the prisma/composer repository, so each change there has to be carried over by hand. These changes affect the pages:

  • targetRef is required, and every deploy runs the ORM's migrate to it. Before, Composer judged for itself whether a database was up to date and refused any ref that declared policies. Now the ORM checks the policies, and a deploy stops with the ORM's own error when they differ from the database's.
  • The app lists the ORM's packages itself, all at the exact version Composer names, plus pg, @types/pg and temporal-polyfill. The contract entry in prisma.config.ts gains a requiredCapabilities field.
  • Prisma ORM 8.0.0-rc.26 changed how contract hashes are computed. An app upgrading from Composer 0.40.0 moves its contract, migrations, refs and each database's signature to the new hashes once, by hand.
  • The region. Only an app's first deploy needs one. But when one is set, every deploy creates the app's services and databases in it, so changing it later replaces a database with a new, empty one. The pages said the region was ignored once the project existed.
  • The skills postinstall hook belongs in a monorepo's root package.json, not a workspace package's.

What this pull request changes

  • composer/databases.mdx, composer/api-reference.mdx: the postgres() section, the database example and "How migrations are applied". The example installs the ORM's packages at 8.0.0-rc.28, sets a production ref before its first deploy, and passes targetRef.
  • composer/deploying.mdx: a Region subsection, and new sections on a ref for each new environment, on a deploy that refuses a ref's policies, and on three upgrades: to a required targetRef, to the new contract hashes, and from Composer 0.41.0 or 0.41.1. Review the upgrade steps closely. Readers run them against production databases, and a step done out of order can make a later deploy apply every migration again. They match Composer's own guide step for step.
  • compute/deploy-on-push.mdx: the database migrates to its targetRef. Deploy on push names each preview after its Git branch, which has no ref of its own, so deploying.mdx migrates production and staging to their refs and every other environment to '@contract'. A preview then tests its branch's schema, but not the ref or the policies production will migrate to; the page says so and gives the alternative.
  • cli/deploy.mdx, (index)/prisma-compute/deploy.mdx, guides/compute/astro-marketing-site.mdx: the region.
  • composer/getting-started.mdx: the skills hook in a monorepo.
  • guides/compute/deploy-existing-app.mdx: one sentence saying the Console installs Composer 0.40.0 while the Composer pages describe 0.41.2, and which section moves an app up.
  • composer/local-development.mdx, composer/service-input.mdx, composer/apps-and-modules.mdx: the migrate wording, the upgrade link and versions.
  • guides/upgrade-prisma-orm/index.mdx: only the marker described next.

Pages the version lint skips

Web's lint:versions --fix job runs every three hours and rewrites any 8.0.0-rc.N that is not the newest release. Five pages get its lint-versions-ignore-file marker, which turns the check off for the whole page until someone removes it:

  • composer/databases.mdx and composer/deploying.mdx. Their ORM versions are the ones Composer 0.41.2 pins, not the ORM's newest release; the job would rewrite them and break the install line and the upgrade steps. They move the next time these pages are brought up to date with Composer.
  • composer/service-input.mdx, whose upgrade steps pin the versions Composer 0.40.0 was built with.
  • guides/compute/deploy-existing-app.mdx and guides/upgrade-prisma-orm/index.mdx. They state the versions the Prisma Console's Compute setup installs, still Composer 0.40.0 and ORM 8.0.0-rc.25. They move when the Console moves.

Left out

  • A Prisma ORM bug. Composer's guide warns that prisma dev refuses a local database moved with prisma db update until a migration ends at its contract. Web's docs rules say to fix or file a tool's defect, not to document it. It is filed as Linear issue TML-3999. Readers who plan a migration for each schema change, as these pages say, never reach it.
  • The Vike and Remix guides also break on 0.41.2, because they install Composer without a version and call postgres() without targetRef. Each needs a tested rewrite, which comes in a follow-up pull request. The full-stack tutorial scaffolds with create-prisma, which still pins Composer 0.40.0, so it is consistent for now.
  • The CLI reference lacks some commands these pages use: migration ref policy show and set, db sign --force, --permit-policy-change, and the warning MIGRATION.CONTRACT_SNAPSHOT_PROFILE_NOT_UPDATED. That gap predates this change.

Related pull requests

How it was checked

  • Two reviewers, one for the design and one for the text, compared every upgrade step with Composer's guide and, where they could, with Composer's code and npm: the targetRef type and refused values, the region error, the install lines' peer dependencies, and prisma@8.0.0-rc.39's dependencies. Their findings are fixed here, except the ones listed above.
  • Web's version check passes on the changed pages. Anchors were checked by hand; CI runs the site build and the link lint.

Agent: herodotus-23

🤖 Generated with Claude Code

Composer 0.41.2 is now latest on npm. Port what changed in Composer's own guides since 0.40.0: postgres() requires targetRef and every deploy and prisma dev run migrates to it, refs with policies take effect, the app lists the Prisma ORM packages and the contract's required capabilities, the region applies to every deploy once set, the upgrade steps for the required targetRef and the new contract hashes, and the skills postinstall hook belongs at a monorepo's workspace root.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
…alone

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Give previews named after Git branches a targetRef rule that needs no ref file per branch, and point deploy on push at it. Move the region into its own subsection and stop other pages saying it matters only at creation. Keep the targetRef upgrade inside the contract-hash upgrade for apps on 0.40.0. Leave the workspace hook section of the skills reference to its own pull request. Protect the pinned versions from the version bump job, keep the targetRef rules in the API reference, and link the Prisma ORM instructions the upgrade steps name.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
blog Ready Ready Preview Dec 3, 2026 11:58am UTC
docs Ready Ready Preview Dec 3, 2026 11:58am UTC
eclipse Ready Ready Preview Dec 3, 2026 11:58am UTC
site Ready Ready Preview Dec 3, 2026 11:58am UTC
1 Skipped Deployment
Project Deployment Actions Updated
handbook Skipped Skipped Dec 3, 2026 11:58am UTC

Request Review

@wmadden-electric
wmadden-electric temporarily deployed to prisma-preview/docs/composer-0.41.2 December 3, 2026 11:32 — with GitHub Actions Inactive
@vercel
vercel Bot temporarily deployed to Preview – handbook December 3, 2026 11:32 Inactive
@prisma-gizmo

prisma-gizmo Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ Gizmo reviewed 88b927d — posted 0 inline comment(s) this pass.

Open findings: none

Change walkthrough

This pull request updates the Prisma Composer documentation from Composer 0.40.0 to 0.41.2, carrying over by hand the behavior changes described in the prisma/composer guides: targetRef is now required on postgres(), every deploy runs the ORM's migrate to it, the app lists the ORM's packages at the exact versions Composer pins, contract hashes changed in ORM 8.0.0-rc.26, and a configured region applies to every deploy's services and databases rather than only the first.

  • Composer pages (composer/databases.mdx, composer/api-reference.mdx, composer/deploying.mdx, composer/local-development.mdx, composer/service-input.mdx, composer/apps-and-modules.mdx, composer/getting-started.mdx) restate the postgres() signature with required targetRef, add the region semantics, the ref-per-environment and policy-refusal sections, and three upgrade paths whose ordering matters because readers run them against production databases.
  • Surrounding pages (cli/deploy.mdx, (index)/prisma-compute/deploy.mdx, compute/deploy-on-push.mdx, guides/compute/astro-marketing-site.mdx, guides/compute/deploy-existing-app.mdx) correct the same region wording and explain how preview environments from branch-based deploy-on-push resolve to '@contract' instead of a committed ref.
  • Version lint: five pages get the lint-versions-ignore-file marker so the scheduled lint:versions --fix job does not rewrite the Composer-pinned ORM versions or the Console's still-older installed versions; each marker carries a comment saying why it is there and when to remove it.
  • The known gaps (the prisma dev local-database defect filed as TML-3999, the Vike and Remix guides, and the missing CLI reference entries) are explicitly left out and tracked for follow-up work.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5485426e-92b9-455a-91ef-676a2362a55e
Commits

Reviewing files that changed from the base of the PR and between a471aed and 88b927d.

Files selected for processing: 13

  • apps/docs/content/docs/(index)/prisma-compute/deploy.mdx
  • apps/docs/content/docs/cli/deploy.mdx
  • apps/docs/content/docs/composer/api-reference.mdx
  • apps/docs/content/docs/composer/apps-and-modules.mdx
  • apps/docs/content/docs/composer/databases.mdx
  • apps/docs/content/docs/composer/deploying.mdx
  • apps/docs/content/docs/composer/getting-started.mdx
  • apps/docs/content/docs/composer/local-development.mdx
  • apps/docs/content/docs/composer/service-input.mdx
  • apps/docs/content/docs/compute/deploy-on-push.mdx
  • apps/docs/content/docs/guides/compute/astro-marketing-site.mdx
  • apps/docs/content/docs/guides/compute/deploy-existing-app.mdx
  • apps/docs/content/docs/guides/upgrade-prisma-orm/index.mdx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

🍈 Lychee Link Check Report

293 links: ✅ 37 OK | 🚫 0 errors | 🔀 9 redirects | 👻 256 excluded

✅ All links are working!


Full Statistics Table
Status Count
✅ Successful 37
🔀 Redirected 9
👻 Excluded 256
🚫 Errors 0
⛔ Unsupported 0
⏳ Timeouts 0
❓ Unknown 0

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

New findings: 🟡 3 minor · trace

…ER fix

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

New findings: none · trace

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No Gizmo finding is open and the head commit has been reviewed. Approving.

@wmadden-electric
wmadden-electric merged commit 2f8f184 into main Dec 3, 2026
36 checks passed
@wmadden-electric
wmadden-electric deleted the docs/composer-0.41.2 branch December 3, 2026 12:32

This branch was successfully deployed

5 active and 1 inactive deployments
Preview – docs — 88b927d5 Deployed Dec 3, 2026 by vercel[bot]
Preview – blog — 88b927d5 Deployed Dec 3, 2026 by vercel[bot]
Preview – site — 88b927d5 Deployed Dec 3, 2026 by vercel[bot]
Preview – eclipse — 88b927d5 Deployed Dec 3, 2026 by vercel[bot]
Preview – handbook — 88b927d5 Deployed Dec 3, 2026 by vercel[bot]
prisma-preview/docs/composer-0.41.2 — 88b927d5 Deployed Dec 3, 2026 by wmadden-electric via deploy #2046
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.

2 participants