Member-only story
From Guidelines to Guardrails: Enforcing dbt Best Practices with CI/CD
A beginner-friendly guide to automating dbt code reviews with dbt-project-evaluator
As a data engineer, I navigate a sea of commits and merge requests in our dbt repository every day. We strive to keep it as clean and structured as possible, backed by detailed documentation and clear guidelines. But let’s be honest — documentation often gets overlooked or skipped. This article was born out of one of those moments when I realized we needed a more efficient way to enforce best practices. I wanted to speed up the feedback cycle on MRs, ensure implementation rules — like naming conventions — aren’t missed, and enhance compliance and consistency across the repository. Most importantly, I wanted to create a system where contributors naturally follow the same standards, even if maintainers change and documentation fades into the background.
In this article, we will step-by-step create a CI/CD pipeline that ensures the developer cannot merge an MR of a dbt model without also adding a test to it. I will use the dbt project evaluator package for this purpose which has many tests for implementing the dbt best practices. So let’s start with the dbt-project-evaluator
package and take a deeper look at it first.