Setup CI - Auto-Validate PRs/MRs
Automatically validate your data changes in every pull request or merge request using Recce Cloud. Catch data issues before they reach production, with validation results right in your PR/MR.
What This Does
Automated PR/MR Validation prevents data regressions before merge:
- Triggers: PR/MR opened or updated against main
- Action: Auto-update Recce session for validation
- Benefit: Automated data validation and comparison visible in your PR/MR
Prerequisites
Before setting up CI, ensure you have:
- ✅ Recce Cloud account - Start free trial
- ✅ Repository connected to Recce Cloud - Git integration guide
- ✅ dbt artifacts - Know how to generate
manifest.jsonandcatalog.jsonfrom your dbt project - ✅ CD configured - Setup CD to establish baseline for comparisons
Setup
GitHub Actions
Create .github/workflows/ci-workflow.yml:
Key points:
GITHUB_TOKENis passed explicitly for Recce Cloud authenticationrecce-cloud upload(without--type) auto-detects this is a PR sessiondbt docs generatecreates the requiredmanifest.jsonandcatalog.json
GitLab CI/CD
Add to your .gitlab-ci.yml:
Key points:
- Authentication is automatic via
CI_JOB_TOKEN recce-cloud upload(without--type) auto-detects this is an MR sessiondbt docs generatecreates the requiredmanifest.jsonandcatalog.json
Platform Comparison
| Aspect | GitHub Actions | GitLab CI/CD |
|---|---|---|
| Config file | .github/workflows/ci-workflow.yml |
.gitlab-ci.yml |
| Trigger | on: pull_request: |
if: $CI_PIPELINE_SOURCE == "merge_request_event" |
| Authentication | Explicit (GITHUB_TOKEN) |
Automatic (CI_JOB_TOKEN) |
| Session type | Auto-detected from PR context | Auto-detected from MR context |
| Artifact passing | Not needed (single job) | Use artifacts: + dependencies: |
Verification
Test with a PR/MR
GitHub:
- Create a test PR with small data changes
- Check Actions tab for CI workflow execution
- Verify validation runs successfully
GitLab:
- Create a test MR with small data changes
- Check CI/CD → Pipelines for workflow execution
- Verify validation runs successfully
Verify Success
Look for these indicators:
- ✅ Workflow/Pipeline completes without errors
- ✅ PR/MR session created in Recce Cloud
- ✅ Session URL appears in workflow/pipeline output
GitHub:
GitLab:
Expected Output
When the upload succeeds, you'll see output like this in your workflow logs:
GitHub:
─────────────────────────── CI Environment Detection ───────────────────────────
Platform: github-actions
PR Number: 42
PR URL: https://github.com/your-org/your-repo/pull/42
Session Type: cr
Commit SHA: abc123de...
Base Branch: main
Source Branch: feature/your-feature
Repository: your-org/your-repo
Info: Using GITHUB_TOKEN for platform-specific authentication
────────────────────────── Creating/touching session ───────────────────────────
Session ID: f8b0f7ca-ea59-411d-abd8-88b80b9f87ad
Uploading manifest from path "target/manifest.json"
Uploading catalog from path "target/catalog.json"
Notifying upload completion...
──────────────────────────── Uploaded Successfully ─────────────────────────────
Uploaded dbt artifacts to Recce Cloud for session ID "f8b0f7ca-ea59-411d-abd8-88b80b9f87ad"
Artifacts from: "/home/runner/work/your-repo/your-repo/target"
Change request: https://github.com/your-org/your-repo/pull/42
GitLab:
─────────────────────────── CI Environment Detection ───────────────────────────
Platform: gitlab-ci
MR Number: 4
MR URL: https://gitlab.com/your-org/your-project/-/merge_requests/4
Session Type: cr
Commit SHA: c928e3d5...
Base Branch: main
Source Branch: feature/your-feature
Repository: your-org/your-project
Info: Using CI_JOB_TOKEN for platform-specific authentication
────────────────────────── Creating/touching session ───────────────────────────
Session ID: f8b0f7ca-ea59-411d-abd8-88b80b9f87ad
Uploading manifest from path "target/manifest.json"
Uploading catalog from path "target/catalog.json"
Notifying upload completion...
──────────────────────────── Uploaded Successfully ─────────────────────────────
Uploaded dbt artifacts to Recce Cloud for session ID "f8b0f7ca-ea59-411d-abd8-88b80b9f87ad"
Artifacts from: "/builds/your-org/your-project/target"
Change request: https://gitlab.com/your-org/your-project/-/merge_requests/4
Review PR/MR Session
To analyze the changes in detail:
- Go to your Recce Cloud
- Find the PR/MR session that was created
- Launch Recce instance to explore data differences
Advanced Options
Custom Artifact Path
If your dbt artifacts are in a non-standard location:
Dry Run Testing
Test your configuration without actually uploading:
Troubleshooting
If CI is not working, the issue is likely in your CD setup. Most problems are shared between CI and CD:
Common issues:
- Missing dbt artifacts
- Authentication failures
- Upload errors
- Sessions not appearing
→ See the Setup CD Troubleshooting section for detailed solutions.
CI-specific tip: If CD works but CI doesn't, verify:
- PR/MR trigger conditions in your workflow configuration
- The PR/MR is targeting the correct base branch (usually
main) - You're looking at PR/MR sessions in Recce Cloud (not production sessions)
Next Steps
After setting up CI, explore these workflow guides:
- PR/MR review workflow - Collaborate with teammates using Recce
- Preset checks - Configure automatic validation checks
- Best practices - Environment preparation tips

