Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ jobs:
# - 26 after review_scope_variants (cute-dbt#302)
# - 27 after review_pr_anchor (cute-dbt#303)
# - 28 after agent_skill (cute-dbt#304)
# - 29 after macro_perspective (cute-dbt#265)
# The README is not a feature. The job name deliberately carries no
# number (cute-dbt#68 — the old `==6` display label went stale across
# several bumps): the enforced count lives ONLY in the `expected=`
Expand All @@ -358,7 +359,7 @@ jobs:
- name: features/*.feature count matches expected
run: |
set -euo pipefail
expected=28
expected=29
count=$(find features -maxdepth 1 -name '*.feature' | wc -l | tr -d ' ')
echo "feature-count: expected ${expected}, found ${count}"
if [ "$count" != "$expected" ]; then
Expand Down
30 changes: 29 additions & 1 deletion examples/diff-showcase-report.html

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions features/macro_perspective.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Maps: cute-dbt#265 (epic #265 — the macro perspective lens). A macro
# edit is invisible to cute-dbt's model-and-unit-test scope selection: a
# macros/*.sql file matches no model `original_file_path` and macros are
# not unit-test targets, so a macro change slips through entirely. Slice B
# gives the report a "macro changed" section — the changed macro's body
# diff, the count of root-project models it reaches (the reverse
# `macro_blast_radius`), and those models as a collapsible directory tree.
#
# cute-dbt#265 Slice B (epic #288 default-OFF posture): the whole macro
# lens is gated behind the `macro-lens` experiment. Every scenario
# asserting the section opts in via the experimental-switch Given
# (CUTE_DBT_EXPERIMENTAL on the subprocess); the switch-off scenario at
# the bottom pins the default posture (no section even with a macro edit,
# byte-stable non-macro goldens). The section copy says "macro changed",
# NEVER a `state:modified.macros` selector name (critique S2): the
# macro-body-changed scope is a synthesized class, not a dbt state
# selector.
Feature: A changed macro is called out, never silently invisible
As a PR reviewer
I want a macros/*.sql edit surfaced with the models it reaches
So that a macro change is part of the review, not an invisible side door

Scenario: A macro edit in pr-diff mode renders the section with a body diff and the impacted-model tree
Given a current manifest with a root-project macro called by two models
And the working tree carries that macro's source file
And the PR diff edits the macro's body
And the experimental switch enables macro-lens
When I run cute-dbt report in pr-diff mode against the macro patch
Then the exit code is 0
And the report carries the macro-lens section
And the macro-lens section names the changed macro
And the macro-lens section carries the macro body diff
And the macro-lens section reports the impacted-model count as 2
And the macro-lens section lists both impacted models in the directory tree
And the macro-lens fidelity chip reads "heuristic"
And the macro-lens section never names a "state:modified.macros" selector

Scenario: No macro edit leaves the section absent and the report byte-stable
Given a current manifest with a root-project macro called by two models
And the working tree carries that macro's source file
And the PR diff edits only a model's SQL, not the macro
And the experimental switch enables macro-lens
When I run cute-dbt report in pr-diff mode against the macro patch
Then the exit code is 0
And the report carries no macro-lens section

Scenario: With the macro-lens switch off a macro edit renders no section
Given a current manifest with a root-project macro called by two models
And the working tree carries that macro's source file
And the PR diff edits the macro's body
When I run cute-dbt report in pr-diff mode against the macro patch
Then the exit code is 0
And the report carries no macro-lens section

Scenario: A vendor-package macro edit is filtered out of the lens
Given a current manifest with a vendor-package macro called by a root-project model
And the working tree carries that macro's source file
And the PR diff edits the macro's body
And the experimental switch enables macro-lens
When I run cute-dbt report in pr-diff mode against the macro patch
Then the exit code is 0
And the report carries no macro-lens section
6 changes: 4 additions & 2 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ pre-push:
feature-count:
# Asserts the .feature-count invariant; the enforced count lives ONLY
# in the `expected=` line below (cute-dbt#68 — numbers in labels and
# comments go stale). History: bumped to 28 in cute-dbt#304 when
# comments go stale). History: bumped to 29 in cute-dbt#265 when
# macro_perspective.feature joined the contract; previously
# bumped to 28 in cute-dbt#304 when
# agent_skill.feature joined the contract; previously
# bumped in cute-dbt#303 when review_pr_anchor.feature joined; previously
# bumped in cute-dbt#302 when review_scope_variants.feature joined; previously
Expand All @@ -111,7 +113,7 @@ pre-push:
# Mirrors the `feature-count` CI job; the README is not a feature.
run: |
set -euo pipefail
expected=28
expected=29
count=$(find features -maxdepth 1 -name '*.feature' | wc -l | tr -d ' ')
if [ "$count" != "$expected" ]; then
echo "feature-count: expected ${expected} .feature files, found ${count}"
Expand Down
Loading
Loading