Repository navigation
#125 — pin override-only edits surface in the YAML text-diff drawer (verify-and-pin) - #144
Conversation
#125) cute-dbt#125 verify-and-pin: a unit test's `overrides` block (macros/vars/env_vars) is sliced into the #69/#96 YAML block by construction, so an override-only edit surfaces in the test-details Authoring-YAML Diff view via the existing #96 text-diff path — no new render surface. The edit leaves given/expect cells byte-identical, so the #98 cell diff correctly returns None (no spurious/misleading cell view), and the drawer is the only place the change shows. - domain: end-to-end guard in cell_diff.rs — an override-line hunk on a test with given/expect rows + a 3-kind overrides block yields a reconstruct_block_diffs change pair (with the sibling override keys and given/expect data riding along as context, proving the slice spans the whole entry) AND an empty reconstruct_table_diffs. - headless: rendered-visibility proof in headless_toggle.rs — the override change shows in the drawer Diff view while the given/expect grids render Current-only (no .cell-diff-toggle / .cell-diff-table). - docs: how-it-works note — override changes ride the text diff; the dropped structured `overrides` payload is irrelevant to this path. No production code or template change; examples and snapshots stay byte-identical. Closes #125 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Advisor follow-up: the cell_diff.rs end-to-end test hand-builds its UnitTestYamlBlock, so it never exercised the real extract_unit_test_block slicer — the function that actually decides whether `overrides:` rides along (the foundational #125 link, and the issue's explicit Discovery item "confirm the working-tree YAML block span includes the overrides lines"). Add a dedicated slicer test that invokes extract_unit_test_block on a 3-kind overrides block and asserts overrides:/macros:/vars:/env_vars: + a deep value ride along (and the slice still spans to given/expect). Soften the cell_diff test comment so it no longer overclaims slicer behavior — that test asserts only that reconstruction preserves untouched sibling lines around the change pair. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 12 minutes and 4 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR adds test coverage and documentation for surfacing unit-test ChangesOverride-only edit text-diff fallback
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
|
Ready to review this PR? Stage has broken it down into 5 individual chapters for you: Chapters generated by Stage for commit 6f03eb0 on Jun 6, 2026 8:58pm UTC. |
📄 Rendered report previewAll examples regenerated cleanly. This PR touches
Click Download to fetch the rendered HTML. Each artifact Alternative: GitHub CLI# gh CLI >= 2.63 extracts into ./report-preview-playground/.
gh run download 27073726408 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.htmlPosted by |
There was a problem hiding this comment.
Code Review
This pull request introduces documentation and comprehensive tests for handling 'override-only' edits in cute-dbt unit tests, ensuring that changes confined to the overrides block correctly surface in the YAML text diff without producing spurious cell-level diffs. The review feedback identifies an issue in the headless integration test where the character offsets for text highlighting in the mock BlockDiff are off-by-two, and provides a code suggestion to correct them.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…PR#144) Gemini flagged the hand-built BlockDiff mock's `emphasis` ranges as off-by-two: `cutoff_days: ` is 13 chars after the 8-space indent (indices 8..=20), so the changed value starts at codepoint 21, not 19. Old `(19,_)` highlighted the `: ` rather than the value. Corrected to `7` → [21,22), `30` → [21,23). Cosmetic in this test (assertions key on the change LINES, not emphasis) but the mock should describe a faithful diff. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e diff is visible The #125 product change shipped without a paired dbt-fixture change, so no consumed project actually carried an `overrides:` block — the feature was mechanically correct but INVISIBLE in the downloadable PR-diff artifact (Christopher's report: "I don't see overrides on the authored YML"). Pair the product change with the dbt change: - showcase (durable, downloadable): add a 3-kind `overrides` block (macros.dbt.current_timestamp pins the non-deterministic clock the test's own description calls out, plus vars + env_vars) to test_mart_dq_summary_zero_quarantined_when_all_valid in tests/fixtures/playground-source/.../_analytics__models.yml, placed AFTER `expect:` so the existing SQL/cell hunks don't shift; add an override-only edit hunk (dq_quarantine_threshold 10 -> 5) to playground-pr-diff.patch; regenerate examples/playground-pr-diff-report.html. The Authoring-YAML Diff view now visibly carries the override change pair; the existing SQL diff (fct_provider_metrics 3/3) and cell diff (mart_dq_summary expect) are intact. MANIFEST.toml SHAs updated for the two touched fixtures. - live self-dogfood: add a vars/env_vars `overrides` block to a dbt-project unit test (dbt parse clean under fusion 2.0-preview; inert here since no model reads them — meaningful macro overrides like is_incremental arrive with the incremental-model work, #145). No production code or template change. The regenerated example is root_path-free, byte-deterministic, and zero-egress (verified). The process gap (feature without a paired consumed-project fixture) is captured as a durable memory. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…des fixture examples/playground-report.html reads tests/fixtures/playground-source for its authoring-YAML drawer, so adding the overrides block to the showcase source changed it too (the in-scope test's drawer now shows the overrides in File view). Regenerated; byte-deterministic, root_path-free. (The pr-diff showcase + the fixtures + dbt-project override landed in e91bd7e; this is the paired baseline example the same source feeds.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Verify-and-pin + dogfood demonstration. cute-dbt#125 asks that an
override-only edit (a change confined to a unit test's
overrides:block —macros/vars/env_vars) show up in the PR-diff test-details drawer. Theexisting #96 YAML text diff already surfaces it by construction:
extract_unit_test_block) spans the whole- name:entry, so
overrides:rides along — nothing special-cases it out.cli/mod.rscomputes the feature: block-precise PrDiff updated-test detection + inline YAML diff #96yaml_diffs(text) and feature: cell-level data-table diff in PR-review report (report-mode, diff-sourced) #98data_diffs(cells)independently. An override-only edit leaves
given/expectbyte-identical,so the feature: cell-level data-table diff in PR-review report (report-mode, diff-sourced) #98 cell diff correctly returns None — and the Authoring-YAML Diff
view (independent of
data_diff) is the one place the change shows.This PR pins that behavior and makes it visible in the dogfooded artifacts.
What's here
Pins (tests + doc):
domain/unit_test_yaml.rs):extract_unit_test_blockon a3-kind
overrides:block assertsoverrides:/macros:/vars:/env_vars:+a deep value ride along, and the slice still spans
given/expect.domain/cell_diff.rs): an override-line hunk yields areconstruct_block_diffschange pair and an emptyreconstruct_table_diffs(data_diff None).
tests/headless_toggle.rs, real Chromium): theoverride change shows in the drawer Diff view; the
given/expectgrids renderCurrent-only (no
.cell-diff-toggle/.cell-diff-table).book/src/how-it-works.md): override changes ride the text diff;the dropped structured
overridespayload is irrelevant to this path.Dogfood (the consumed dbt projects now carry overrides — else the feature is
invisible in the downloadable artifact):
overridesblock added totest_mart_dq_summary_zero_quarantined_when_all_validin the playground source(
macros.dbt.current_timestamppins the non-deterministic clock the test's owndescription calls out, +
vars+env_vars), an override-only edit hunk inplayground-pr-diff.patch, and a regeneratedexamples/playground-pr-diff-report.html.The Authoring-YAML Diff view now visibly carries the override change pair; the
existing SQL diff (
fct_provider_metrics3/3) and cell diff (mart_dq_summary)are intact. MANIFEST.toml SHAs updated.
vars/env_varsoverridesblock on adbt-project/unit test (
dbt parseclean under fusion; inert here since no model reads them— meaningful macro overrides like
is_incrementalarrive with feat: surface incremental-model unit-test semantics (incremental badge + expect=merged-rows tooltip) #145).On "multiple override edits for each type"
The diff substrate is type-agnostic — macros/vars/env_vars are just YAML lines
to the text diff. So all three kinds are present in the fixture content, with one
representative edit covering the mechanism, rather than three near-identical scenarios.
Acceptance criteria (#125)
rendered showcase artifact).
all 3 override kinds — now in the consumed dbt projects, not just unit tests.
Gates
fmt · clippy
--locked -D warnings· nextest (690) · bdd · rustdoc-D warnings·mdbook · deny · llvm-cov ≥85 · headless_toggle (+ the new visibility test) ·
headless_zero_egress (on the regenerated example) · fixture-manifest SHA gate ·
example byte-identity (regenerated deterministically; root_path-free, verified).
Not in this PR
Incremental-model unit-test support (badges + the
expect = merged rows, not the final tabletooltip) is a separate feature (distinct surface, needsoverridesingestion) — filed as #145.
Closes #125
🤖 Generated with Claude Code