Skip to content

feat(adapter): fail loud on dbt v2/Fusion (v20) manifests#1446

Merged
kentwelcome merged 8 commits into
mainfrom
feature/drc-3699-detect-dbt-v2fusion-v20-manifest-at-load-and-fail-loud-with
Jul 3, 2026
Merged

feat(adapter): fail loud on dbt v2/Fusion (v20) manifests#1446
kentwelcome merged 8 commits into
mainfrom
feature/drc-3699-detect-dbt-v2fusion-v20-manifest-at-load-and-fail-loud-with

Conversation

@wcchang1115

@wcchang1115 wcchang1115 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

PR checklist

  • Ensure you have added or ran the appropriate tests for your PR.
  • DCO signed

What type of PR is this?

feat: a fail-loud guard for unsupported dbt artifact schemas.

What this PR does / why we need it:

dbt v2 / Fusion emits manifest schema v20; Recce's bundled dbt 1.x reads up to manifest v12 / catalog v1. Feeding a Fusion artifact to Recce today fails with dbt's internal schema error, or an unrelated ValueError on the cloud path; nothing tells the user that Fusion isn't supported.

This PR detects the unsupported schema at artifact load (both local target/ files and cloud-loaded state) and raises UnsupportedDbtSchemaError:

dbt v2 / Fusion manifests (schema v20) are not yet supported by Recce. Recce supports dbt 1.x artifacts (manifest schema up to v12, catalog v1). Re-generate the manifest with dbt 1.x.

This PR only detects and reports. It does not parse v20 artifacts or handle v12-vs-v20 cross-environment diffs.

Which issue(s) this PR fixes:

NONE

Special notes for your reviewer:

  • If dbt 1.x ever bumps its manifest schema past v12, _DBT1X_MAX_SCHEMA needs a manual bump. The rationale for the fixed ceiling is in the comment above the constant.
  • The path= branch catches and translates dbt's IncompatibleSchemaError instead of pre-checking the version, to avoid re-parsing large manifests and to leave artifacts dbt accepts untouched.
  • No separate Cloud-side change is needed: Recce Cloud precompute runs OSS Recce in a container.

Does this PR introduce a user-facing change?:

Yes. Feeding a dbt v2 / Fusion (v20) artifact now raises a Recce error naming Fusion and the supported versions, instead of dbt's internal schema-version error.

dbt v2/Fusion emits a v20 manifest; Recce's bundled dbt 1.x tops out at
manifest v12 / catalog v1. Previously the path= load surfaced dbt's cryptic
IncompatibleSchemaError and the data= load (upgrade_schema_version) did no
version check at all.

Add UnsupportedDbtSchemaError and a _guard_unsupported_schema helper that
raises a clear, Recce-branded error when an artifact's schema is newer than
the bundled dbt supports (found > supported), wired into both the path= and
data= branches of load_manifest and load_catalog. The threshold check stays
robust against a future legit dbt 1.x schema bump; older/incompatible
versions keep dbt's own error.

A-min only: detect + friendly message. Parsing v20 and cross-env v12-vs-v20
diff guards are tracked separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
@wcchang1115 wcchang1115 self-assigned this Jun 23, 2026
…ning dbt

The v20 guard compared the found schema against the *running* dbt's
supported version. On the tox matrix (dbt 1.6/1.7, which support manifest
schema < v12), a normal v12 manifest is 'newer than supported' there, so the
guard mislabeled it as dbt v2/Fusion and the v12-fixture regression test
couldn't load at all.

Detect Fusion against a FIXED dbt-1.x ceiling (manifest v12, catalog v1)
instead — an absolute boundary, since 'is this Fusion?' doesn't depend on
which dbt is installed. An artifact merely too new for the installed dbt 1.x
(e.g. v12 under dbt 1.6) now keeps dbt's own version error. Replace the
version-fragile positive test with a version-agnostic boundary assertion.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
recce/adapter/dbt_adapter/__init__.py 79.56% <100.00%> (+0.31%) ⬆️
recce/exceptions.py 78.57% <100.00%> (+3.57%) ⬆️
tests/test_dbt.py 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gcko
gcko self-requested a review June 24, 2026 00:26
wcchang1115 and others added 4 commits July 2, 2026 09:53
The guard's non-firing side was untested: an artifact at or below the
1.x ceiling that dbt rejects as too old must surface dbt's own
IncompatibleSchemaError, not be mislabeled as Fusion. Covers the bare
re-raise in both load_manifest and load_catalog path branches.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
Fix the UnsupportedDbtSchemaError docstring — "translates dbt's
IncompatibleSchemaError" only described the path= branch; the data=
branch raises without a dbt error to translate. Drop decorative
wording and a v20/v12 rationale repeated in three places; the
_DBT1X_MAX_SCHEMA comment is now the single source.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
dbt's is_compatible_version is a set-membership check, not an ordered
"supports up to vN" ceiling, so "not the running dbt's version" framed
the invariant with the wrong model. Spell out the maintainer rule (do
not tie the ceiling to installed-dbt compatibility) with the dbt 1.6 +
v12 example. Also name UnsupportedDbtSchemaError in the guard docstring
instead of "a clear Recce error".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
@wcchang1115
wcchang1115 marked this pull request as ready for review July 2, 2026 08:52
@wcchang1115
wcchang1115 requested a review from kentwelcome July 2, 2026 08:53

@kentwelcome kentwelcome left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kentwelcome
kentwelcome merged commit 06754a4 into main Jul 3, 2026
22 checks passed
@kentwelcome
kentwelcome deleted the feature/drc-3699-detect-dbt-v2fusion-v20-manifest-at-load-and-fail-loud-with branch July 3, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants