Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

TML-2763: Correct telemetry migration target hash - #668

Merged
aqrln merged 1 commit into
mainfrom
tml-2763-correct-telemetry-migration-target
Jun 1, 2026
Merged

aqrln merged 1 commit into
mainfrom
tml-2763-correct-telemetry-migration-target

Conversation

@tensordreams

@tensordreams tensordreams commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Linked issue

Refs TML-2763; follow-up to #666.

At a glance

-  "to": "sha256:b3b741a267f995ab52646b2cba176c396e7e2b651e78d048382dc9dc9399dd96",
+  "to": "sha256:50aadcf996213451cd2876e3caf50c2752b5b8c9ce1aa55dcae24918518b4ffb",

The migration still has ops.json as []; only the target contract marker changes.

Summary

PR #666 added the right kind of telemetry migration edge, but it targeted a stale emitted contract hash. This PR replaces that package with the same zero-operation marker advance pointing to the actual current telemetry contract hash, and verifies it with the real telemetry backend .env migration command.

Decision

This PR replaces 20260601T1236_contract_hash_advance with 20260601T1347_contract_hash_advance, preserving the production starting marker 41700e… and correcting the destination marker to 50aadcf…. No SQL operations are introduced.

How it fits together

  1. Production was at the original telemetry migration hash sha256:41700ef5fda97339b39ea345a56aae72a1ff4be11ddc3ffcab7130bfc71c109d.
  2. The current committed telemetry contract hash is sha256:50aadcf996213451cd2876e3caf50c2752b5b8c9ce1aa55dcae24918518b4ffb.
  3. The previously merged migration package pointed to b3b741…, which does not satisfy the deploy-time target hash.
  4. The replacement migration package points directly from 41700e… to 50aadcf… with empty operations, so prisma-next migrate can advance or confirm the marker without touching schema objects.

Behavior changes & evidence

  • Telemetry deploy migrations now target the actual current contract hash. The app-space graph edge now matches the failure message’s target hash 50aadcf… instead of the stale b3b741… hash.
    • Implementation: migration.json, migration.ts, ops.json
    • Evidence: pnpm --dir apps/telemetry-backend run migrate with apps/telemetry-backend/.env, prisma-next migration check --json

Notes for the reviewer

  • The real telemetry backend migration command was run against the .env database before opening this PR. It reports Already up to date with marker sha256:50aadcf996213451cd2876e3caf50c2752b5b8c9ce1aa55dcae24918518b4ffb.
  • This PR intentionally removes the stale generated package and replaces it with a generated package for the current contract. Most of the diff is generated start/end contract snapshots.
  • ops.json remains empty, so there is no table/index/data mutation in this correction.

Testing performed

  • set -a; . apps/telemetry-backend/.env; set +a; pnpm --dir apps/telemetry-backend run migrate
    • Result: Already up to date; marker sha256:50aadcf996213451cd2876e3caf50c2752b5b8c9ce1aa55dcae24918518b4ffb.
  • DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres pnpm --filter @prisma-next/telemetry-backend exec prisma-next migration check --json

Skill update

n/a — migration artifact only; no user-facing CLI/API/skill surface changed.

Alternatives considered

  • Keeping TML-2763: Add telemetry contract hash advance migration #666 as-is: rejected because deploy targets 50aadcf…, not the stale b3b741… hash.
  • Adding another edge from b3b741… to 50aadcf…: rejected because production’s failing state starts at 41700e…; the deploy needs a direct reachable edge from that marker.
  • Adding SQL operations: rejected because the verified migration path only needs marker advancement.

Checklist

  • All commits are signed off (git commit -s) per the DCO. The DCO status check will block merge if any commit is missing a Signed-off-by: trailer.
  • I read CONTRIBUTING.md and the change is scoped to one logical concern.
  • Tests are updated (or n/a if the change is doc-only / refactor with no behavioural delta).
  • The PR title is in TML-NNNN: <sentence-case title> form (Linear ticket prefix + concise title naming the concrete deliverable). See .claude/skills/create-pr/SKILL.md for the full convention.
  • The Skill update section above is filled in (or stated n/a — internal only).

Summary by CodeRabbit

  • Chores
    • Updated database migration infrastructure and contract definitions.

Fixes: TML-2763

Signed-off-by: Alexey Orlenko's AI Agent <[email protected]>
@tensordreams
tensordreams requested a review from a team as a code owner June 1, 2026 13:56
@coderabbitai

coderabbitai Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 01dea6f8-4dad-4820-a189-01a3b8609eca

📥 Commits

Reviewing files that changed from the base of the PR and between 881031b and 7ff6d10.

📒 Files selected for processing (8)
  • apps/telemetry-backend/migrations/app/20260601T1236_contract_hash_advance/migration.json
  • apps/telemetry-backend/migrations/app/20260601T1347_contract_hash_advance/end-contract.d.ts
  • apps/telemetry-backend/migrations/app/20260601T1347_contract_hash_advance/end-contract.json
  • apps/telemetry-backend/migrations/app/20260601T1347_contract_hash_advance/migration.json
  • apps/telemetry-backend/migrations/app/20260601T1347_contract_hash_advance/migration.ts
  • apps/telemetry-backend/migrations/app/20260601T1347_contract_hash_advance/ops.json
  • apps/telemetry-backend/migrations/app/20260601T1347_contract_hash_advance/start-contract.d.ts
  • apps/telemetry-backend/migrations/app/20260601T1347_contract_hash_advance/start-contract.json
💤 Files with no reviewable changes (1)
  • apps/telemetry-backend/migrations/app/20260601T1236_contract_hash_advance/migration.json

📝 Walkthrough

Walkthrough

This PR advances a Prisma telemetry contract by migrating the telemetry_event model namespace from __unbound__ to public. The TypeScript definitions, JSON contract schema, and migration metadata are updated to reflect this namespace change, with hashes recomputed throughout.

Changes

Contract Namespace Evolution

Layer / File(s) Summary
Contract namespace evolution to public
apps/telemetry-backend/migrations/app/20260601T1347_contract_hash_advance/end-contract.d.ts, apps/telemetry-backend/migrations/app/20260601T1347_contract_hash_advance/end-contract.json, apps/telemetry-backend/migrations/app/20260601T1347_contract_hash_advance/migration.json, apps/telemetry-backend/migrations/app/20260601T1347_contract_hash_advance/migration.ts
TypeScript type definitions and JSON contract schema are updated so telemetry_event moves from __unbound__ namespace to public. StorageHash is recomputed to a new value, and migration metadata (from, to, migrationHash) is updated to track the hash transition. The previous 20260601T1236 migration.json is cleaned up.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • prisma/prisma-next#666: This PR directly alters the migration package by deleting the contents of 20260601T1236_contract_hash_advance/migration.json, which represents the cleanup of the previous hash-advance metadata.

Suggested reviewers

  • wmadden
  • aqrln

Poem

🐰 From shadows deep where contracts dwell,
A namespace shifts from unbound's spell,
To public light, the hashes spin,
New migrations mark where we begin,
And cleanup scrubs the old away—
The contract thrives another day! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: correcting a telemetry migration's target hash from a stale value to the current committed contract hash.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tml-2763-correct-telemetry-migration-target

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.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
postgres / no-emit 135.93 KB (0%)
postgres / emit 125.59 KB (0%)
mongo / no-emit 75.69 KB (0%)
mongo / emit 70.68 KB (0%)

@pkg-pr-new

pkg-pr-new Bot commented Jun 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

@prisma-next/extension-author-tools

npm i https://pkg.pr.new/@prisma-next/extension-author-tools@668

@prisma-next/mongo-runtime

npm i https://pkg.pr.new/@prisma-next/mongo-runtime@668

@prisma-next/family-mongo

npm i https://pkg.pr.new/@prisma-next/family-mongo@668

@prisma-next/sql-runtime

npm i https://pkg.pr.new/@prisma-next/sql-runtime@668

@prisma-next/family-sql

npm i https://pkg.pr.new/@prisma-next/family-sql@668

@prisma-next/extension-arktype-json

npm i https://pkg.pr.new/@prisma-next/extension-arktype-json@668

@prisma-next/middleware-cache

npm i https://pkg.pr.new/@prisma-next/middleware-cache@668

@prisma-next/mongo

npm i https://pkg.pr.new/@prisma-next/mongo@668

@prisma-next/extension-paradedb

npm i https://pkg.pr.new/@prisma-next/extension-paradedb@668

@prisma-next/extension-pgvector

npm i https://pkg.pr.new/@prisma-next/extension-pgvector@668

@prisma-next/extension-postgis

npm i https://pkg.pr.new/@prisma-next/extension-postgis@668

@prisma-next/postgres

npm i https://pkg.pr.new/@prisma-next/postgres@668

@prisma-next/sql-orm-client

npm i https://pkg.pr.new/@prisma-next/sql-orm-client@668

@prisma-next/sqlite

npm i https://pkg.pr.new/@prisma-next/sqlite@668

@prisma-next/target-mongo

npm i https://pkg.pr.new/@prisma-next/target-mongo@668

@prisma-next/adapter-mongo

npm i https://pkg.pr.new/@prisma-next/adapter-mongo@668

@prisma-next/driver-mongo

npm i https://pkg.pr.new/@prisma-next/driver-mongo@668

@prisma-next/contract

npm i https://pkg.pr.new/@prisma-next/contract@668

@prisma-next/utils

npm i https://pkg.pr.new/@prisma-next/utils@668

@prisma-next/config

npm i https://pkg.pr.new/@prisma-next/config@668

@prisma-next/errors

npm i https://pkg.pr.new/@prisma-next/errors@668

@prisma-next/framework-components

npm i https://pkg.pr.new/@prisma-next/framework-components@668

@prisma-next/operations

npm i https://pkg.pr.new/@prisma-next/operations@668

@prisma-next/ts-render

npm i https://pkg.pr.new/@prisma-next/ts-render@668

@prisma-next/contract-authoring

npm i https://pkg.pr.new/@prisma-next/contract-authoring@668

@prisma-next/ids

npm i https://pkg.pr.new/@prisma-next/ids@668

@prisma-next/psl-parser

npm i https://pkg.pr.new/@prisma-next/psl-parser@668

@prisma-next/psl-printer

npm i https://pkg.pr.new/@prisma-next/psl-printer@668

@prisma-next/cli

npm i https://pkg.pr.new/@prisma-next/cli@668

@prisma-next/cli-telemetry

npm i https://pkg.pr.new/@prisma-next/cli-telemetry@668

@prisma-next/emitter

npm i https://pkg.pr.new/@prisma-next/emitter@668

@prisma-next/migration-tools

npm i https://pkg.pr.new/@prisma-next/migration-tools@668

prisma-next

npm i https://pkg.pr.new/prisma-next@668

@prisma-next/vite-plugin-contract-emit

npm i https://pkg.pr.new/@prisma-next/vite-plugin-contract-emit@668

@prisma-next/mongo-codec

npm i https://pkg.pr.new/@prisma-next/mongo-codec@668

@prisma-next/mongo-contract

npm i https://pkg.pr.new/@prisma-next/mongo-contract@668

@prisma-next/mongo-value

npm i https://pkg.pr.new/@prisma-next/mongo-value@668

@prisma-next/mongo-contract-psl

npm i https://pkg.pr.new/@prisma-next/mongo-contract-psl@668

@prisma-next/mongo-contract-ts

npm i https://pkg.pr.new/@prisma-next/mongo-contract-ts@668

@prisma-next/mongo-emitter

npm i https://pkg.pr.new/@prisma-next/mongo-emitter@668

@prisma-next/mongo-schema-ir

npm i https://pkg.pr.new/@prisma-next/mongo-schema-ir@668

@prisma-next/mongo-query-ast

npm i https://pkg.pr.new/@prisma-next/mongo-query-ast@668

@prisma-next/mongo-orm

npm i https://pkg.pr.new/@prisma-next/mongo-orm@668

@prisma-next/mongo-query-builder

npm i https://pkg.pr.new/@prisma-next/mongo-query-builder@668

@prisma-next/mongo-lowering

npm i https://pkg.pr.new/@prisma-next/mongo-lowering@668

@prisma-next/mongo-wire

npm i https://pkg.pr.new/@prisma-next/mongo-wire@668

@prisma-next/sql-contract

npm i https://pkg.pr.new/@prisma-next/sql-contract@668

@prisma-next/sql-errors

npm i https://pkg.pr.new/@prisma-next/sql-errors@668

@prisma-next/sql-operations

npm i https://pkg.pr.new/@prisma-next/sql-operations@668

@prisma-next/sql-schema-ir

npm i https://pkg.pr.new/@prisma-next/sql-schema-ir@668

@prisma-next/sql-contract-psl

npm i https://pkg.pr.new/@prisma-next/sql-contract-psl@668

@prisma-next/sql-contract-ts

npm i https://pkg.pr.new/@prisma-next/sql-contract-ts@668

@prisma-next/sql-contract-emitter

npm i https://pkg.pr.new/@prisma-next/sql-contract-emitter@668

@prisma-next/sql-lane-query-builder

npm i https://pkg.pr.new/@prisma-next/sql-lane-query-builder@668

@prisma-next/sql-relational-core

npm i https://pkg.pr.new/@prisma-next/sql-relational-core@668

@prisma-next/sql-builder

npm i https://pkg.pr.new/@prisma-next/sql-builder@668

@prisma-next/target-postgres

npm i https://pkg.pr.new/@prisma-next/target-postgres@668

@prisma-next/target-sqlite

npm i https://pkg.pr.new/@prisma-next/target-sqlite@668

@prisma-next/adapter-postgres

npm i https://pkg.pr.new/@prisma-next/adapter-postgres@668

@prisma-next/adapter-sqlite

npm i https://pkg.pr.new/@prisma-next/adapter-sqlite@668

@prisma-next/driver-postgres

npm i https://pkg.pr.new/@prisma-next/driver-postgres@668

@prisma-next/driver-sqlite

npm i https://pkg.pr.new/@prisma-next/driver-sqlite@668

commit: 7ff6d10

@aqrln
aqrln enabled auto-merge (rebase) June 1, 2026 14:00
@aqrln
aqrln disabled auto-merge June 1, 2026 14:01
@aqrln
aqrln merged commit f78139a into main Jun 1, 2026
20 checks passed
@aqrln
aqrln deleted the tml-2763-correct-telemetry-migration-target branch June 1, 2026 14:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants