> For the complete documentation index, see [llms.txt](https://docs.selectstar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.selectstar.com/integrations/dbt/dbt-impact-report.md).

# dbt Impact Report

Prevent breaking changes before they break your dashboards and key models with Select Star's dbt Impact Report.

## Introduction

Select Star's dbt Impact Report allows you to make model changes with confidence. The Impact Report shows downstream items for your dbt model changes right in your pull request, so you can view potential impact before making changes and prevent downstream breakages.

dbt Impact Report is available via GitHub Actions. Follow the instructions at <https://github.com/selectstar/dbt-impact-report-action> or below to set up the GitHub Action.

<figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-f14836914702bdfd55955424d5694a57c67305a9%2FScreenshot%202023-10-06%20at%2014.54.31.png?alt=media" alt=""><figcaption></figcaption></figure>

## Before You Start

1. dbt MUST be **set up as a separate data source**

<div data-full-width="true"><figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-cdc439c17723dedf85a46174b441d31adc876963%2FCleanShot%202023-11-27%20at%2016.49.08%402x.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>

1. **Select Star API Token** - this is required for the Action to use Select Star's APIs. See [API Token](/select-star-api/authentication.md).
2. **Select Star Data Source GUID** - this is the GUID of the dbt data source corresponding to the repository you're adding the Action to.
   1. You can get the GUID by going into **Admin > Data** and selecting the dbt data source. The GUID will be in the URL and look like `ds_example` .

<div data-full-width="true"><figure><img src="https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-2af998962b9777d0c367fe6e10574499bd663c0d%2FMonosnap%20dbt%20from%20GH%20%7C%20Select%20Star%202023-11-29%2014-10-11.png?alt=media" alt=""><figcaption></figcaption></figure></div>

## Configure the GitHub Action

1. If you don't already have it, create repository secrets in your repo:
   1. `SELECTSTAR_API_TOKEN` with the value of the API Token from the prerequisites.
2. Add the Select Star GitHub Action to your workflow:
   1. Create a workflow file in your repo
   2. Add the following code to the workflow file

{% code lineNumbers="true" %}

```yaml
name: Select Star dbt impact report

on:
  pull_request:
    types: [opened, edited, synchronize, reopened]

jobs:
  create-impact-report:
    name: Create the impact report for dbt projects
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write 
    steps:
      - name: Run Action
        uses: selectstar/dbt-impact-report-action@v1
        with:
          GIT_REPOSITORY_TOKEN: ${{secrets.GITHUB_TOKEN}}   # no need to change, GitHub will handle it as it is
          SELECTSTAR_API_TOKEN: ${{secrets.SELECTSTAR_API_TOKEN}}
          SELECTSTAR_API_URL: YOUR INSTANCE API URL   # (e.g.: https://api.production.selectstar.com)
          SELECTSTAR_WEB_URL: YOUR INSTANCE WEB URL   # (e.g.: https://app.selectstar.com)
          SELECTSTAR_DATASOURCE_GUID: YOUR DBT DATA SOURCE GUID  # (e.g.: ds_aRjCTzAf4dPNigiV87Uggq)
```

{% endcode %}

{% hint style="warning" %}
Make sure the Datasource's GUID you add to the Github Workflow is the one corresponding to your DBT data source. Adding other GUIDs will not yield the right results in the report.
{% endhint %}

## Test it Out

After configuring the GitHub action, test out the dbt Impact Report by creating a pull request with any change to a dbt model file in the repo. You should see the action running and a new comment generated on the pull request with the Impact report.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.selectstar.com/integrations/dbt/dbt-impact-report.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
