> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Test Code Changes On Pull Requests

> Bolt template that runs and tests modified dbt™ models and their downstream dependencies whenever a pull request opens, powering Turbo CI checks.

export const Arcade = ({src, title}) => <div style={{
  position: 'relative',
  paddingBottom: 'calc(56.2225% + 41px)',
  height: 0,
  width: '100%'
}}>
    <iframe src={src} title={title} frameBorder="0" loading="lazy" allow="clipboard-write" allowFullScreen style={{
  position: 'absolute',
  top: 0,
  left: 0,
  width: '100%',
  height: '100%',
  colorScheme: 'light'
}} />
  </div>;

This template creates a Bolt schedule that automatically executes dbt™ model builds and tests when a new pull request is opened against your main branch. It builds and tests only the models affected by your code changes in a temporary schema, ensuring data quality before merging into production.

<Check>
  **Key Benefits**

  * Automatically validate dbt™ model changes in a pull request
  * Build and test only modified models and their downstream dependencies
  * Run validation in a temporary schema to avoid impacting production
  * Get immediate feedback on pull request status through Paradime integration
</Check>

<Info>
  **Prerequisites**

  * A dedicated CI [environment](/products/settings/connections/index#create-and-manage-environments) exists in **Settings > Environments**, with its own [warehouse connection](/products/settings/connections/scheduler-environment/index) using a target named `ci`, and the schedule's **Environment** is set to it
  * [Paradime Github app](https://docs.paradime.io/app-help/documentation/bolt/ci-cd/turbo-ci/github) is installed and authorize access to the dbt™️ repository used in Paradime. Not on GitHub? Check our [Turbo CI guide](/products/bolt/ci-cd/turbo-ci/index) for other Git Provider providers.
</Info>

<Arcade src="https://demo.arcade.software/evxyCfj5xybmEqyJnF4Q?embed&embed_mobile=tab&embed_desktop=inline&show_copy_link=true" title="Test Code Changes On Pull Requests" />

### Default Configuration

#### Schedule Settings

| Setting           | Value          | Explanation                                                             |
| ----------------- | -------------- | ----------------------------------------------------------------------- |
| Schedule Type     | `Turbo CI`     | Enables automated validation of pull request changes.                   |
| Schedule Name     | `turbo ci run` | A descriptive name indicating the purpose of the schedule               |
| Deferred Schedule | `hourly run`   | Specifies the production schedule to compare against for state changes. |
| Git Branch        | `main`         | Uses your default production branch to ensure correct code comparison.  |

#### Command Settings

The template uses a single command optimized for pull request validation:

* `dbt build --select state:modified+ --target ci`: This builds only the models that have been modified in the pull request, along with their downstream dependencies, in the "ci" target environment.

#### Trigger Type

* **Type**: Scheduled Run (Cron)
* **Cron Schedule**: `OFF` (This schedule will be triggered by a new pull request event, not a cron schedule)

<Info>
  For custom Trigger configurations, see [Trigger Types](/products/bolt/creating-schedules/trigger-types) documentation.
</Info>

#### Notification Settings

* **Email Alerts**:
  * **Success**: Confirms models built and tested successfully
  * **Failure**: Alerts when models fail to build or tests fail
  * **SLA Breach**: Alerts if the run takes longer than 120 minutes

<Info>
  For custom notification configurations, see [Notification Settings](/products/bolt/creating-schedules/notification-settings) documentation.
</Info>

### When to Customize

Tailor this template to your specific needs:

* **Adjust Deferred Schedule** to the production schedule you want Turbo CI to compare against for state changes.
  * Hourly checks for frequent data updates (`0 * * * *`)
  * Daily checks for standard reporting (`0 0 * * *`)
* **Modify command settings** with the dbt™ commands to suit your testing requirements, such as running specific model selectors or additional tests.
* Add more **notifications destinations** (Slack, MS Teams) to match your team's workflows.
* [Customize Temporary Schema Naming](/products/bolt/ci-cd/turbo-ci/index#configure-a-custom-schema-for-ci-runs) via the dbt `generate_schema_name.sql` macro to handle the temporary schema prefix.


## Related topics

- [Turbo CI for dbt™ pull requests](/products/bolt/ci-cd/turbo-ci/index.md)
- [CI/CD Templates](/guides/orchestrate-data-pipelines/templates/ci-cd-templates/index.md)
- [Set up Turbo CI](/guides/orchestrate-data-pipelines/set-up-turbo-ci.md)
- [Generate pull request descriptions](/guides/dinoai-copilot-use-cases/generating-pull-request-descriptions.md)
- [Deploy Code Changes On Merge](/guides/orchestrate-data-pipelines/templates/ci-cd-templates/deploy-code-changes-on-merge.md)
