You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cloud/features/ci.mdx
+38-36Lines changed: 38 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,33 +19,36 @@ Elementary closes that gap by bringing live data quality context directly into t
19
19
20
20
## What you get on every PR
21
21
22
-
-**Test history:** pass/fail counts for each changed model over the last 7 days, so reviewers know if they're touching something that's already fragile
23
-
-**Active incidents:** any open data quality issues on those models right now, before the change lands on top of them
24
-
-**Downstream blast radius:** exactly which models, pipelines, and dashboards depend on what's changing, two levels deep
25
-
-**Health summary:** a plain-language signal on whether it's safe to merge, powered by Claude
22
+
-**Change analysis:** Elementary cross-references the diff against what it knows about each model's columns, types, and behavior, flagging logical concerns like NULL risks, type mismatches, or join changes that could alter row counts
23
+
-**Performance & cost:** SQL anti-pattern detection (SELECT *, cross joins, missing filters on large tables) with volume context so reviewers can assess real cost impact
24
+
-**Downstream blast radius:** exactly which models, pipelines, and dashboards depend on what's changing, including column-level impact for renamed or removed columns
25
+
-**Tests & incidents:** pass/fail history for each changed model, active data quality incidents, and coverage gaps on new columns
26
+
-**Risk summary:** a plain-language assessment of whether it's safe to merge, with prioritized recommendations
27
+
28
+
The comment is concise by default. If everything looks clean, the review is a few lines. It only expands when there are actual issues to flag.
26
29
27
30
The comment updates automatically on every new push, so the review always reflects the latest state. No noise, no duplicate comments.
28
31
29
32
## How it works
30
33
31
-
The review is powered by [Claude](https://www.anthropic.com) connected to the [Elementary MCP server](/cloud/mcp/intro). When a PR is opened or updated:
34
+
When a PR is opened or updated:
32
35
33
-
1. A CI job detects which models changed using `git diff`
34
-
2.Claude queries Elementary for live data quality context on those exact models
35
-
3. A structured Markdown summary is posted as a comment on the PR or MR
36
+
1. A CI job sends the repository name and branch to Elementary's API
37
+
2.Elementary fetches the diff, runs static SQL analysis, and queries live data quality context for the changed models
38
+
3. A structured Markdown comment is posted as a comment on the PR or MR
36
39
37
-
No custom scripts. No webhook setup. No infrastructure to manage. Two secrets and one file.
40
+
No custom scripts. No webhook setup. No infrastructure to manage. One secret and one file.
38
41
39
42
## Setup
40
43
41
44
### Prerequisites
42
45
43
-
- An Elementary Cloud account with the [MCP server enabled](/cloud/mcp/setup-guide)
44
-
- An [Anthropic API key](https://console.anthropic.com)
46
+
- An Elementary Cloud account with a [code repository connected](/cloud/integrations/code-repo/connect-code-repo)
47
+
- An [Elementary API key](/cloud/integrations/api-key)
45
48
46
49
### GitHub Actions
47
50
48
-
**Step 1 — Add the workflow file**
51
+
**Step 1 -- Add the workflow file**
49
52
50
53
Create `.github/workflows/elementary-review.yml` in your dbt repository:
Go to **Settings > Secrets and variables > Actions** and add:
82
85
83
86
| Secret | Description |
84
87
|---|---|
85
-
| `ANTHROPIC_API_KEY` | Your Anthropic API key |
86
88
| `ELEMENTARY_API_KEY` | Your Elementary Cloud API key |
87
89
88
-
That's it. The review only runs on PRs that touch model files — other PRs are ignored entirely.
90
+
That's it. The review only runs on PRs that touch model files. Other PRs are ignored entirely.
89
91
90
92
<Warning>
91
93
This works for pull requests opened from branches within the same repository. GitHub does not pass repository secrets to `pull_request` workflows triggered by forks or Dependabot.
@@ -95,38 +97,42 @@ This works for pull requests opened from branches within the same repository. Gi
95
97
96
98
| Input | Default | Description |
97
99
|---|---|---|
98
-
| `models-path` | `models/` | Path to your dbt models directory |
The environment ID is the UUID in your Elementary Cloud URL. For example, in `https://app.elementary-data.com/169e9308-9a70-4200-b810-ad486cb42f3a/report/dashboard`, the environment ID is `169e9308-9a70-4200-b810-ad486cb42f3a`.
116
+
117
+
If you don't specify an `env-id` and the repository is connected to only one environment, it will be selected automatically. If connected to multiple, the review will return an error listing the available environment IDs.
118
+
112
119
</Accordion>
113
120
114
121
### GitLab CI
115
122
116
-
**Step 1 — Add the include to your `.gitlab-ci.yml`**
123
+
**Step 1 -- Add the include to your `.gitlab-ci.yml`**
| `ANTHROPIC_API_KEY` | Yes | Your Anthropic API key |
130
136
| `ELEMENTARY_API_KEY` | Yes | Your Elementary Cloud API key |
131
137
| `GITLAB_API_TOKEN` | Yes | Optional. Project Access Token with `api` scope. Set this if you cannot enable CI/CD job token API access in project settings. |
132
138
@@ -143,20 +149,16 @@ The review only runs on MRs that touch model files. Other MRs are ignored entire
143
149
144
150
**No comment appears after the job runs**
145
151
146
-
Make sure both `contents: read` and `pull-requests: write`are set under `permissions` in the workflow. An explicit `permissions` block sets any unlisted scope to `none`, so omitting `contents: read` causes the checkout step to fail before Elementary runs.
152
+
Make sure `contents: read`, `pull-requests: write`, and `issues: write` are set under `permissions` in the workflow. An explicit `permissions` block sets any unlisted scope to `none`, so omitting a required scope causes the step to fail silently.
147
153
148
-
**`git diff` returns no changed models**
154
+
**The review says the repository is not connected**
149
155
150
-
Make sure `fetch-depth: 0` is set on the checkout step. Without full git history the runner cannot compare branches and the diff will be empty.
156
+
Make sure you have a code repository integration set up in Elementary Cloud. Go to **Settings > Environments** and verify your repository is connected.
151
157
152
-
**The comment says the MCP server is unreachable**
158
+
**The review says the repository is connected to multiple environments**
153
159
154
-
Verify `ELEMENTARY_API_KEY` is correctly set and the MCP server is enabled for your account. See the [MCP setup guide](/cloud/mcp/setup-guide).
160
+
Add `elementary-env-id` to your workflow to specify which environment to use. The error message will list the available environment IDs.
155
161
156
162
<Warning>
157
163
If a model has never been synced through Elementary, the comment will note that no history is available yet. Results populate automatically after the next Elementary sync.
158
164
</Warning>
159
-
160
-
## Using a different AI provider?
161
-
162
-
The review currently uses Claude via the Anthropic API. If your team uses a different provider and you'd like to see it supported, reach out at [support@elementary-data.com](mailto:support@elementary-data.com) or on the [Community Slack](https://elementary-data.com/community).
0 commit comments