Repository navigation
TML-2764: harden check:upgrade-coverage to verify per-PR entry correspondence - #723
Conversation
…heck Layer a second check on top of the existing directory-existence rule: when a cluster substrate is touched in the diff, the in-flight instructions.md must also appear in the diff for this PR, and its frontmatter `changes:` key must be a valid array (empty `[]` for incidental diffs, or non-empty for real entries). This prevents a transition directory created by an earlier PR from silently satisfying the gate for a later substrate-touching PR. Exports `parseChangesFrontmatter` for unit testing, consistent with the file's existing export-for-test pattern. Adds 10 new tests (4 unit, 6 integration). Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: wmadden-electric <[email protected]>
…er-agnostic block entries Two review findings hardened in parseChangesFrontmatter: Finding 1: A non-empty flow array (e.g. `changes: [foo]`) was false-rejected as "not an array" because only `changes: []` had an inline-array branch. Add a non-empty flow-array branch before the block-sequence path; parse elements by splitting on comma. Finding 2: A block entry whose first key is not `id:` (e.g. `- summary: foo\n id: bar`) was false-rejected because the block detection counted entries by `- id:` bullet matches, not by `- ` bullets. Count entries by bullet lines at list indentation; key order is now unrestricted. Regressions kept: `changes: []` → ok/empty; absent `changes:` → not ok. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: wmadden-electric <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR strengthens the upgrade-coverage gating script by adding per-PR validation: it parses ChangesUpgrade Coverage Validation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes The changes span two files with moderate logic density: a new parsing function with clear structure, infrastructure helpers, a revised validation loop integrating these pieces, and updated rendering logic. The test suites are substantial but follow consistent patterns. Heterogeneous changes across parsing, infrastructure, validation, and rendering require separate reasoning for each layer, and the integration tests are large enough to demand careful review. Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
size-limit report 📦
|
…upgrade-coverage-to-verify-per-pr-entry-not-just
… line walk to eliminate ReDoS The nested quantifiers in `(?:[ \t]+-[ \t]+[\s\S]*?)*` caused exponential backtracking on adversarial inputs. Replace with a simple line-by-line scan: find the `changes:` key, then iterate subsequent lines collecting bullet entries until the first non-blank, non-indented line. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Will Madden <[email protected]>
|
CodeQL findings resolved (both findings, IDs 3357241270 + 3357241276): The multi-line block-sequence regex Fix: replaced with a linear line walk — All 45 tests pass. Commit |
@prisma-next/extension-author-tools
@prisma-next/mongo-runtime
@prisma-next/family-mongo
@prisma-next/sql-runtime
@prisma-next/family-sql
@prisma-next/extension-arktype-json
@prisma-next/middleware-cache
@prisma-next/mongo
@prisma-next/extension-paradedb
@prisma-next/extension-pgvector
@prisma-next/extension-postgis
@prisma-next/postgres
@prisma-next/sql-orm-client
@prisma-next/sqlite
@prisma-next/target-mongo
@prisma-next/adapter-mongo
@prisma-next/driver-mongo
@prisma-next/contract
@prisma-next/utils
@prisma-next/config
@prisma-next/errors
@prisma-next/framework-components
@prisma-next/operations
@prisma-next/ts-render
@prisma-next/contract-authoring
@prisma-next/ids
@prisma-next/psl-parser
@prisma-next/psl-printer
@prisma-next/cli
@prisma-next/cli-telemetry
@prisma-next/emitter
@prisma-next/migration-tools
prisma-next
@prisma-next/vite-plugin-contract-emit
@prisma-next/mongo-codec
@prisma-next/mongo-contract
@prisma-next/mongo-value
@prisma-next/mongo-contract-psl
@prisma-next/mongo-contract-ts
@prisma-next/mongo-emitter
@prisma-next/mongo-schema-ir
@prisma-next/mongo-query-ast
@prisma-next/mongo-orm
@prisma-next/mongo-query-builder
@prisma-next/mongo-lowering
@prisma-next/mongo-wire
@prisma-next/sql-contract
@prisma-next/sql-errors
@prisma-next/sql-operations
@prisma-next/sql-schema-ir
@prisma-next/sql-contract-psl
@prisma-next/sql-contract-ts
@prisma-next/sql-contract-emitter
@prisma-next/sql-lane-query-builder
@prisma-next/sql-relational-core
@prisma-next/sql-builder
@prisma-next/target-postgres
@prisma-next/target-sqlite
@prisma-next/adapter-postgres
@prisma-next/adapter-sqlite
@prisma-next/driver-postgres
@prisma-next/driver-sqlite
commit: |
…rge) Signed-off-by: Will Madden <[email protected]>
Harden
scripts/check-upgrade-coverage.mjsso the upgrade-coverage gate verifies entry↔substrate correspondence per PR, not just that the in-flight transition directory exists.Why
The gate only asserted that
upgrades/<M>-to-<M+1>/exists when a PR touched a cluster's substrate (examples/→ user skill;packages/3-extensions/→ extension-author skill). Once any earlier PR created that directory, a later PR could introduce a real breaking change with no upgrade entry and still pass — which is exactly how thedomain-planeslice (#653 / TML-2751) shipped a breaking change with no entries. The gate was necessary-but-not-sufficient; the missing-entry case was left to human review.Change
Layered a per-PR correspondence check on top of the existing directory-existence precondition (which is unchanged, as are the new-entries rule, the coverage-chain logic, and the
--mode/--prev/--headinterface). Whengit diff <base>..HEADtouches a cluster's substrate:instructions.mdmust be in the PR's changed files — forcing a deliberate per-PR act, so a prior PR's entry can no longer cover a later PR.changes:must be a present array — either a real entry, or an explicitchanges: []no-op (the documented escape hatch for genuinely incidental substrate diffs such as dev-dep bumps).A new exported
parseChangesFrontmatterhandles the YAML spellings (changes: [], non-empty flow arrays[a, b], and block sequences regardless of which key leads each entry). Missing/malformedchanges:while substrate is touched → violation.Scope / verification
node --test scripts/check-upgrade-coverage.test.mjs→ 45/45 (15 new, including all six correspondence cases + flow/block-order parser cases).pnpm check:upgrade-coverage --mode prpasses on this branch; biome clean.changes: [].Refs: TML-2764
🤖 Generated with Claude Code
Summary by CodeRabbit
Tests
Chores