GitHub pull requests
How the AI DBA opens fix pull requests for dbt models and query code, how to install the GitHub App, map repos, and run dbt Cloud CI. On Growth, Pro and Enterprise.
dbt models and query code live in your repo, not in BigQuery. So the AI DBA fixes them with a pull request. You review it, your CI checks it, and a person merges it. SlashPeak never merges. Fixes that change BigQuery itself, such as clustering, do not need GitHub.
Only GitHub is supported today.
Plan limits
| Growth | Pro | Enterprise | |
|---|---|---|---|
| Open at the same time | 3 | 10 | 20 |
| GitHub repos connected | 2 | 10 | 25 |
| dbt Cloud CI runs per pull request | 1 + 1 re-run | 1 + 3 re-runs | 1 + 4 re-runs |
There is no limit on pull requests opened per month. Each AI-written fix uses your AI usage. When the open limit is reached, the next pull request waits. It opens by itself when one of the open ones is merged or closed.
Before you start
- A dbt project must be synced for the connection: upload
manifest.jsonor connect dbt Cloud. See dbt. - For query code outside dbt (Airflow, scripts), the repo must hold that code. The AI DBA finds the source file from the job's dbt node, or by searching the repo.
1. Install the GitHub App
- Open Cognis → Cognis Settings → AI DBA Access → GitHub.
- In step 1 of the card, click Install on GitHub.
- On GitHub, pick the organization and the repos the app may see.
- GitHub sends you back. Step 1 shows a green check and Installed on <your org>.
What the app can do:
- Read the files it needs to fix.
- Push branches named
slashpeak/ai-dba/…. It pushes to no other branch. - Open pull requests and read their status and CI checks.
- It cannot merge.
Manage on GitHub opens the app's settings on GitHub. If you uninstall it or remove a repo there, SlashPeak marks that repo as disconnected.
2. Map a repo
- In step 2 of the card, click Pick a repo (Map another repo once one is mapped).
- Pick the repo.
- Pick the dbt project it holds.
- Enter the dbt project folder in the repo, or leave it empty. Empty means the repo root, or the folder is found by itself.
- Click Map repo.
Each mapped repo counts toward your plan's repo limit. Unmap frees the slot. Open pull requests stay on GitHub.
What SlashPeak reads from your repo
SlashPeak does not clone your repo or keep a copy of it.
- dbt fixes: SlashPeak reads the one model file, or the schema file, through GitHub's API.
- Query code fixes: to find the file that runs a query, SlashPeak downloads the repo's code files and searches them. The copy stays in memory only. It is not written to disk, and it is gone when the step ends.
- AI-written fixes: the AI sees the file it fixes, plus up to 6 read-only files that help, such as downstream models. It can change at most 3 files. See AI privacy.
- What is stored: the file path and the small edits of each fix, so you can review it and roll it back.
Every read uses a short-lived GitHub token for that one repo. Only the step that writes the branch and opens the pull request gets write access.
What a fix pull request looks like
- Title:
[SlashPeak] <fix>: <model>. - Branch:
slashpeak/ai-dba/…. - Body: the finding, the change, the expected saving, and how it was checked:
- "BigQuery dry run before and after the change: X → Y bytes" — when your operator key has the SQL validation group.
- "Pending CI" — when a dry run was not possible. Your CI checks it.
- "Test config only; no SQL was run" — for dbt test changes.
- Notes when you must do something after the merge. For example, a new
partition_byneeds onedbt run --full-refresh -s <model>. - For AI-written fixes, the body names the Claude model that wrote the change.
Rule-based and AI-written fixes
| Kind | Fixes | Who writes the change |
|---|---|---|
| Rule-based (dbt config) | set cluster_by, set partition_by, change materialization, disable model, add incremental_predicates | SlashPeak, from a fixed template |
| AI-written | add a partition filter, rewrite a MERGE predicate, replace SELECT *, materialize a CTE, limit dbt tests, fix an incremental model | Claude reads the file and writes the patch. Our checks must accept it before the pull request opens |
AI-written fixes need the AI consent. See Set up the AI DBA.
After you merge
The AI DBA watches for the change to go live:
- It waits for the first production run of the model that uses the new code, or a scan that shows the new table layout.
- Then the action moves to Verified.
- If no production run uses it within 14 days, the status is Merged, not seen running.
Every scan also checks open pull requests, so a merge is recorded even if a GitHub message was lost.
If you close it
- The status is PR closed.
- The same fix for the same finding is not suggested again for 14 days.
If the model file changed on the default branch before the pull request opened, the AI DBA plans again on the new file.
Undo a merged fix
Click Roll back on the action. The AI DBA opens a revert pull request. The roll back finishes when someone merges the revert. If the revert is closed, the fix stays.
dbt Cloud CI (optional)
If your repo has no CI on pull requests, SlashPeak can start a dbt Cloud job on the fix branch.
- Connect dbt Cloud on the Connections page first. Its service token needs the Job Admin permission, because it starts a job.
- In Cognis Settings → AI DBA Access → dbt Cloud CI job, enter the dbt Cloud job id.
- Click Save.
Now:
- Right after a fix pull request opens, the job runs against the fix branch.
- The action page shows the result: Running, Passed or Failed.
- Re-run CI starts it again while the pull request is open, up to your plan's limit.
- Each run uses your dbt Cloud job minutes.
- Turn off stops the trigger.