Repository navigation
#84 — BDD: pr_diff_scoping.feature step impls (Scenario 14 rewrite + gate updates) - #88
Conversation
…ates) Wire features/pr_diff_scoping.feature (14 scenarios) to step impls for the --scope-from-pr-diff CI/PR-review path (#84). Each scenario builds a synthetic in-memory Manifest, serializes it to a temp file, runs the real cute-dbt subprocess, and asserts against the embedded cute-dbt-data JSON payload — no committed fixture files (synthetic-only invariant satisfied trivially). cucumber-rs has one global step namespace, so colliding Given wordings were re-authored to pr-diff-unique, self-contained phrasing that builds world.current_manifest; every When/Then is kept verbatim (the audited behavioral contract). Scenario 14 rewritten from the GITHUB_EVENT_PATH contract (which production GitHub events do not carry) to the real @file argument form (Fix A1). Scenario 11 gained an in-scope unit test — Stage-2 preflight checks in-scope tests, not bare models, so the as-audited scenario would not have fail-closed without one. Gates: baseline-required-grep now accepts either scope source (--baseline-manifest OR --scope-from-pr-diff); feature-count 9->10. Both mirrored in ci.yml + lefthook.yml; job display-names frozen (#68). Closes #84 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 54 minutes and 43 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 (1)
📝 WalkthroughWalkthroughPR adds comprehensive BDD integration tests for the ChangesPR-Diff Scoping Test Suite
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
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 |
There was a problem hiding this comment.
Code Review
This pull request introduces the --scope-from-pr-diff CLI flag to cute-dbt, enabling the derivation of in-scope models and unit tests directly from a PR's file diff. It adds a new BDD feature file (pr_diff_scoping.feature), updates the lefthook pre-push hooks to enforce scope source rules, and implements the corresponding test steps and builders in Rust. The review feedback suggests replacing specific version references (e.g., v0.1.x) with generic placeholders (e.g., v0.x) in the feature file's comments to prevent documentation rot.
The pr_diff_scoping When step created the subprocess workdir via create_dir_all(workdir.join(project_root)). For --project-root ".", that builds a `…/workdir/.` path whose trailing "." component makes create_dir_all fail with NotFound on Linux (macOS tolerates it) — green locally, red in CI. Create `workdir` directly (no "." suffix) and only join the sub-dir for a non-"." project root. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Actionable comments posted: 0 |
📄 Rendered report previewAll examples regenerated cleanly.
Click Download to fetch the rendered HTML. Each artifact Alternative: GitHub CLI# gh CLI >= 2.63 extracts into ./report-preview-playground/.
gh run download 26596720491 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.htmlPosted by |
Summary
Wires
features/pr_diff_scoping.feature(14 scenarios) to step implementations for the--scope-from-pr-diffCI/PR-review path (built on #85's CLI surface). Each scenario builds a synthetic in-memoryManifest, serializes it to a temp file, runs the realcute-dbtsubprocess, and asserts against the embeddedcute-dbt-dataJSON payload — no committed fixture files, so the synthetic-only-fixture invariant is satisfied trivially (CQO option b).No production code: this PR touches only
tests/, the two CI gate files, and one doc comment.Step partition (cucumber-rs has one global step namespace)
the exit code is {0,non-zero},no file "report.html" is written,a baseline manifest "baseline.json"(existing impls).diff_scoping.rs(one.unwrap()s aNonebaseline → panic; one builds no node). Every When/Then kept verbatim (the audited behavioral contract); only the colliding Given prose changed to pr-diff-unique, self-contained phrasing that builds the manifest.Amendments (logged in pipeline observations.md)
GITHUB_EVENT_PATHcontract (production GitHub PR events do not carry the changed-file list) to the real@fileargument form.preflight_compiledchecks the targets of in-scope tests, not bare models, so the as-audited scenario would not have fail-closed.--project-rootis existence-validated by clap (renderer: surface raw unit_test YAML block (+ leading/trailing comments) in test details #69); the sub-directory scenario runs the subprocess from a temp workdir with the project-root sub-dir created (--manifest/--outare absolute).Gate updates (
ci.yml+lefthook.yml, atomically)baseline-required-grepnow accepts either scope source (--baseline-manifestOR--scope-from-pr-diff); the neither-source usage-error scenario carries@no-baseline-usage-error.feature-count9 → 10.==6etc.) per ci: 'Feature file count (==6)' display label is stale (gate is at 7) #68 branch-protection coupling.Tests
cargo test --test bdd→ 58 scenarios (44 prior + 14 new), 338 steps, all green.Local gates green:
fmt,clippy --all-targets --locked -- -D warnings,nextest(424),cargo deny,mdbook build,non-mirror-guard, fixture-manifest gate,baseline-required-grep,feature-count,lefthook run pre-push(all 10 hooks).Epic: #78
Closes #84
🤖 Generated with Claude Code
Summary by CodeRabbit
Tests
Chores