Validate dbt Changes Before Merging

Have you ever hit “merge” on a dbt pull request and just hope it doesn’t break everything downstream? Yeah, us too. That slight internal panic—“please don’t wreck any dashboards”—is all too familiar. Now there’s a much better way to avoid dashboard chaos: Preview Projects from GitHub Branches.

This capability fundamentally changes how you can develop and test your dbt projects in conjunction with your BI tool.

What’s the Deal?

Lightdash now allows you to create temporary, isolated “Preview Projects” directly from any branch in your dbt project’s GitHub repository.Instead of only having your production Lightdash project reflecting your main dbt branch, you can now instantly spin up parallel Lightdash environments that mirror the state of your feature branches. Push a change to a branch in GitHub, and you can immediately view and interact with it in a dedicated Lightdash preview.

Why This Is a Game-Changer

One of the most significant advantages of this feature is content validation. Before merging your dbt changes, you need to know: will this break any existing charts or dashboards in Lightdash?

Lightdash Previews make answering this question incredibly easy:

  1. Make your dbt changes (e.g., rename a column, refactor a model, add a new metric) in a dedicated GitHub branch.
  2. Push the branch to GitHub.
  3. Create or refresh a Lightdash Preview Project pointing to that specific branch.
  4. Navigate within the Preview Project: Open the dashboards and charts that rely on the data you changed. Lightdash will attempt to render them using the dbt code from your branch.
  5. Instantly See Impacts: If your changes broke something (e.g., a chart depended on a now-renamed column), Lightdash’s validation process within the preview will often highlight the error immediately. You’ll see broken chart messages or data failing to load in the preview environment, not in production.

This allows your team to proactively identify and fix issues caused by upstream dbt modifications before they ever impact end-users or require frantic post-merge fixes. It builds confidence and maintains trust in your data products.

Bonus Perks

While pre-merge validation is huge, Preview Projects offer other key advantages:

  • Test New Metrics & Dimensions Rapidly: Define a new metric in your dbt branch, push it, and immediately start building charts with it in the Lightdash preview to ensure it calculates correctly and makes sense visually.
  • Isolate Model Changes: Testing a major dbt model refactor? Point your Preview Project to a development or staging database schema. This lets you safely test complex changes using realistic (but non-production) data without impacting your main project.
  • Streamline Collaboration: Share the URL of your Preview Project with teammates. They can see exactly how your proposed dbt changes manifest in the BI layer, allowing for targeted feedback directly within the Lightdash interface before the PR is approved.

Seamless Workflow (Especially with dbt Cloud)

This feature integrates smoothly into your existing workflow. For teams using the dbt Cloud IDE, the process is particularly fluid, often requiring no interaction with a local CLI:

  • Make changes in the dbt Cloud IDE.
  • Commit and push your branch.
  • Hop over to Lightdash and hit ‘refresh’ or ‘create’ on your Preview Project.

The cycle from code change to BI preview is dramatically shortened.

Use Cases in Action

  • Refactoring a Core dbt Model: Create a branch, refactor the model, point a Lightdash Preview to it and your dev schema. Systematically check key dashboards in the preview to ensure they still load and display correct figures. Fix any issues before merging.
  • Renaming a Frequently Used Dimension: Push the renaming change to a branch. In the Lightdash Preview, use the content validation features to quickly identify exactly which saved charts will be affected by the name change. Update them in the branch before merging.
  • Developing a New Business Area: Build out new dbt models and metrics in a feature branch. Use the Lightdash Preview to build the corresponding dashboards and charts, get feedback from stakeholders by sharing the preview link, and merge everything together once approved.

TL;DR

Lightdash Preview Projects offer a robust way to develop, test, and validate your dbt changes with unprecedented visibility into the downstream BI impact. Catch errors early, collaborate more effectively, and merge your dbt code with greater confidence.

Ready to try it out? We’ve got you covered! At Driftwave, we make managing your Lightdash painless by removing hosting headaches:

  • No Per-User Fees: Share insights across departments without worrying about growing costs.
  • Exportable Instances: Prefer to self-host down the line? Your data and setup are always yours to keep.
  • Scalable and Secure: Our hosting solutions ensure your Lightdash environment is always fast, secure, and reliable.

We are also offering three months of free hosting for Lightdash for teams currently using dbt!