Conversation
Add 4 essential dbt assessors covering core best practices for AI-assisted data engineering workflows. Assessors validate project configuration, model documentation, data tests, and project structure. Key features: - SQL language detection via .sql extension mapping - DbtProjectConfigAssessor (Tier 1, 10%) - validates dbt_project.yml - DbtModelDocumentationAssessor (Tier 1, 10%) - checks schema.yml docs - DbtDataTestsAssessor (Tier 2, 3%) - validates PK tests - DbtProjectStructureAssessor (Tier 2, 3%) - ensures staging/marts layout - 48 unit tests with 6 comprehensive test fixtures - Rich remediation with dbt-specific guidance Total impact: 26% of AgentReady score for dbt projects. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
…sors Fix DbtModelDocumentationAssessor and DbtDataTestsAssessor to detect YAML files with any naming convention, not just *schema.yml and *_models.yml. dbt supports multiple documentation patterns: - schema.yml (standard) - _models.yml (alternative) - one-file-per-model.yml (used by bookingsmaster-dbt) Changed from pattern matching to glob "*.yml" to support all conventions. Before: Only detected schema.yml and _models.yml files After: Detects all .yml/.yaml files in models/ directory Tested on bookingsmaster-dbt project: - Documentation coverage: 0% → 54% (102/189 models detected) - Test coverage: 0% → 4.8% (9/189 models detected) - 171 YAML files now properly scanned Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
Apply code style fixes from isort and ruff: - Fix import ordering (pathlib before pytest) - Remove unnecessary blank lines - Remove unnecessary f-string prefixes (ruff F541) All checks passing: - ✅ isort (import sorting) - ✅ ruff (code quality) - ✅ 48 unit tests passing Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Warning
|
| Cohort / File(s) | Summary |
|---|---|
Core dbt assessors src/agentready/assessors/dbt.py |
New module with 4 BaseAssessor implementations: DbtProjectConfigAssessor (validates dbt_project.yml structure), DbtModelDocumentationAssessor (measures model doc coverage), DbtDataTestsAssessor (validates PK test coverage), DbtProjectStructureAssessor (evaluates directory organization). Includes shared helpers for dbt project detection, YAML file discovery, and safe parsing. Each assessor generates proportional scores and remediation guidance. |
Assessor registration src/agentready/assessors/__init__.py |
Imports and registers four new dbt assessor classes into the assessors list. Updates docstring tier counts from 10 to 12 total assessors. |
Language detection src/agentready/services/language_detector.py |
Adds .sql file extension mapping to "SQL" language type for language detection. |
Well-structured dbt fixture tests/fixtures/dbt_projects/well_structured/... |
Complete dbt project with proper organization: dbt_project.yml, staging/marts models with schema.yml documentation, tests, and a sample macro. Demonstrates best practices. |
Minimal and incomplete dbt fixtures tests/fixtures/dbt_projects/minimal_valid/..., tests/fixtures/dbt_projects/missing_docs/..., tests/fixtures/dbt_projects/missing_tests/... |
Three fixture projects testing edge cases: minimal valid config, missing documentation, and missing tests. |
Flat structure dbt fixture tests/fixtures/dbt_projects/flat_structure/dbt_project.yml, tests/fixtures/dbt_projects/flat_structure/models/model_*.sql |
55 SQL model files (model_1.sql through model_55.sql) plus config, designed to test flat model directory detection logic. |
Non-dbt fixture tests/fixtures/dbt_projects/non_dbt/... |
Non-dbt project fixture with README and sample SQL to verify assessor applicability checks. |
Unit tests tests/unit/test_assessors_dbt.py |
Comprehensive test suite with 727 lines covering all four assessors: fixtures for each dbt project structure, helper function validation, applicability checks, success/failure/not-applicable scenarios, proportional scoring verification, and remediation generation assertions. |
Sequence Diagram
sequenceDiagram
participant User
participant AssessmentEngine as Assessment Engine
participant DbtAssessor as Dbt Assessor
participant FileSystem as File System
participant YAMLParser as YAML Parser
participant Evidence as Evidence Builder
User->>AssessmentEngine: assess(repository)
AssessmentEngine->>DbtAssessor: is_applicable(repository)
DbtAssessor->>FileSystem: check dbt_project.yml exists
FileSystem-->>DbtAssessor: exists/not exists
alt Is applicable
AssessmentEngine->>DbtAssessor: assess(repository)
DbtAssessor->>FileSystem: locate models/, schema.yml files
FileSystem-->>DbtAssessor: file paths
par Parallel Analysis
DbtAssessor->>YAMLParser: parse dbt_project.yml
YAMLParser-->>DbtAssessor: config dict
DbtAssessor->>FileSystem: scan model SQL files
FileSystem-->>DbtAssessor: model list
end
DbtAssessor->>DbtAssessor: analyze structure/docs/tests
DbtAssessor->>DbtAssessor: calculate proportional score
DbtAssessor->>Evidence: build remediation if needed
Evidence-->>DbtAssessor: Finding with score, evidence, remediation
DbtAssessor-->>AssessmentEngine: Finding
else Not applicable
DbtAssessor-->>AssessmentEngine: not_applicable Finding
end
AssessmentEngine-->>User: Assessment result
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~45 minutes
✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
feature/add-dbt-support
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 @coderabbitai help to get the list of available commands and usage tips.
|
🎉 This PR is included in version 2.31.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
📈 Test Coverage Report
Coverage calculated from unit tests only |
AgentReady Code Review — PR #357: Feature/add dbt supportOverall assessment: Well-structured addition with good test coverage (48 tests, 6 fixtures). The assessors follow established patterns and include rich remediation. However, there are 3 blocking issues that should be resolved before merge. Blocking Issues1.
|
| Issue | Severity | Related |
|---|---|---|
placeholder_texts includes "description" |
Blocking | #353 |
default-weights.yaml not updated |
Blocking | #354 |
Fragile yml→yaml pattern replacement |
Blocking | #356 |
data_tests: dbt v1.8+ syntax not supported |
Minor | — |
Unused tmp_path in test fixtures |
Nit | — |
attribute property re-instantiates on each access |
Nit | — |
🤖 Generated with Claude Code
Description
Add 4 essential dbt assessors covering core best practices for AI-assisted data engineering workflows.
Rebased and conflict-resolved version of #334 (by @patrickstrick).
Changes
Follow-up Issues
Closes #334
Co-Authored-By: Patrick Strick patrickstrick@users.noreply.github.com
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com
🤖 Generated with Claude Code