Skip to content

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

Draft
wcchang1115 wants to merge 3 commits into
mainfrom
feature/drc-3699-detect-dbt-v2fusion-v20-manifest-at-load-and-fail-loud-with
Draft

feat(adapter): fail loud on dbt v2/Fusion (v20) manifests#1446
wcchang1115 wants to merge 3 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 a v20 manifest, while Recce's bundled dbt 1.x tops out at manifest v12 / catalog v1. Today:

  • the path= load surfaces dbt's cryptic internal IncompatibleSchemaError (no mention of Recce or Fusion), and
  • the data= load (upgrade_schema_version) did no version check at all, so a v20 dict fails opaquely.

This will start hitting users during the dbt 1.x → v2 migration window (e.g. base/prod on 1.x emitting v12, PR branch on Fusion emitting v20).

This PR adds UnsupportedDbtSchemaError and a _guard_unsupported_schema helper, wired into both the path= and data= branches of load_manifest and load_catalog. When an artifact's schema is newer than the bundled dbt supports (found > supported), Recce now raises a clear, branded message instead of the dbt-internal one:

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.

Scope is detect + friendly message only. Actually parsing v20 and guarding v12-vs-v20 cross-environment diffs are tracked separately.

Which issue(s) this PR fixes:

NONE

Special notes for your reviewer:

  • The threshold is intentionally generic — "newer than the bundled dbt supports" (found > supported) rather than hardcoding v20 — so a future legit dbt 1.x schema bump won't false-trigger, and genuinely older/incompatible artifacts still fall through to dbt's own error.
  • For the path= branch I chose to catch-and-translate dbt's IncompatibleSchemaError rather than pre-check the version myself — preserves all existing behavior and avoids re-parsing large manifests.
  • Recce Cloud precompute runs OSS Recce in a container, so this single OSS fix also covers the Cloud upload path (no separate Cloud change needed).

Does this PR introduce a user-facing change?:

Yes — users feeding a dbt v2 / Fusion (v20) artifact now see a clear Recce error explaining that v2 / Fusion is not yet supported, instead of a confusing dbt-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

❌ Patch coverage is 97.10145% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
recce/adapter/dbt_adapter/__init__.py 91.30% 2 Missing ⚠️
Files with missing lines Coverage Δ
recce/exceptions.py 78.57% <100.00%> (+3.57%) ⬆️
tests/test_dbt.py 100.00% <100.00%> (ø)
recce/adapter/dbt_adapter/__init__.py 79.42% <91.30%> (+0.17%) ⬆️

... 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
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.

2 participants