Skip to main content

Update: Improvements to dbt Cloud continuous integration

dbt Cloud now has two distinct job types: deploy jobs for building production data assets, and CI jobs for checking code changes. These jobs perform fundamentally different tasks so dbt Labs improved the setup experience with better defaults for each.

With two types of jobs, instead of one generic type, we can better guide you through the setup flow. Best practices are built into the default settings so you can go from curious to being set up in seconds.

Example of setting up a CI jobExample of setting up a CI job

And, we now have more efficient state comparisons on CI checks: never waste a build or test on code that hasn’t been changed. We now diff between the Git PR code and what’s running in production more efficiently with the introduction of deferral to an environment versus a job. To learn more, refer to Continuous integration in dbt Cloud and Get started with continuous integration tests.

Below is a comparison table that describes how deploy jobs and CI jobs behave differently:

Deploy JobsCI Jobs
PurposeBuilds production data assets.Builds and tests new code before merging changes into production.
Trigger typesTriggered by a schedule or by API.Triggered by a commit to a PR or by API.
DestinationBuilds into a production database and schema.Builds into a staging database and ephemeral schema, lived for the lifetime of the PR.
Execution modeRuns execute sequentially, so as to not have collisions on the underlying DAG.Runs execute in parallel to promote team velocity.
Efficiency run savingsDetects over-scheduled jobs and cancels unnecessary runs to avoid queue clog.Cancels existing runs when a newer commit is pushed to avoid redundant work.
State comparisonOnly sometimes needs to detect state.Almost always needs to compare state against the production environment to build on modified code and its dependents.

What you need to update

If you previously set up a job using the Create Job API endpoint before September 11, 2023, you must re-create the job as described in Trigger a CI job with the API. This is because you must set the job_type to be ci.

0