# Test Code Changes On Pull Requests

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.

{% hint style="success" %}

### 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
  {% endhint %}

{% hint style="info" %}

### Prerequisites

* [Scheduler Environment](/app-help/documentation/settings/connections/scheduler-environment.md) is connected to your data warehouse provider with a dedicated target named `ci`&#x20;
* [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](/app-help/documentation/bolt/ci-cd/turbo-ci.md) for other Git Provider providers.
  {% endhint %}

{% @arcade/embed flowId="evxyCfj5xybmEqyJnF4Q" url="<https://app.arcade.software/share/evxyCfj5xybmEqyJnF4Q>" %}

### Default Configuration

#### Schedule Settings

<table><thead><tr><th width="187">Setting</th><th width="196">Value</th><th>Explanation</th></tr></thead><tbody><tr><td>Schedule Type</td><td><code>Turbo CI</code></td><td>Enables automated validation of pull request changes.</td></tr><tr><td>Schedule Name</td><td><code>turbo ci run</code></td><td>A descriptive name indicating the purpose of the schedule</td></tr><tr><td>Deferred Schedule</td><td><code>hourly run</code></td><td>Specifies the production schedule to compare against for state changes.</td></tr><tr><td>Git Branch</td><td><code>main</code></td><td>Uses your default production branch to ensure correct code comparison.</td></tr></tbody></table>

#### 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)

{% hint style="info" %}
For custom Trigger configurations, see [Trigger Types](/app-help/documentation/bolt/creating-schedules/trigger-types.md) documentation.&#x20;
{% endhint %}

#### 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

{% hint style="info" %}
For custom notification configurations, see [Notification Settings](/app-help/documentation/bolt/creating-schedules/notification-settings.md) documentation.
{% endhint %}

### 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](/app-help/documentation/bolt/ci-cd/turbo-ci/github.md#configuring-bolt-turbo-ci-job) via the dbt `generate_schema_name.sql` macro to handle the temporary schema prefix.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paradime.io/app-help/documentation/bolt/creating-schedules/templates/ci-cd-templates/test-code-changes-on-pull-requests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
