recce-cloud 1.33.1__tar.gz → 1.34.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/.gitignore +9 -0
  2. recce_cloud-1.34.1/PKG-INFO +370 -0
  3. recce_cloud-1.34.1/recce_cloud/VERSION +1 -0
  4. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/api/base.py +9 -9
  5. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/api/client.py +257 -5
  6. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/api/github.py +19 -19
  7. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/api/gitlab.py +19 -19
  8. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/ci_providers/base.py +8 -8
  9. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/ci_providers/detector.py +17 -17
  10. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/ci_providers/github_actions.py +8 -8
  11. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/ci_providers/gitlab_ci.py +8 -8
  12. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/cli.py +244 -86
  13. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/commands/diagnostics.py +3 -3
  14. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/config/project_config.py +10 -10
  15. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/config/resolver.py +47 -19
  16. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/delete.py +6 -6
  17. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/download.py +5 -5
  18. recce_cloud-1.34.1/recce_cloud/review.py +541 -0
  19. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/services/diagnostic_service.py +7 -7
  20. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/upload.py +5 -5
  21. recce_cloud-1.33.1/PKG-INFO +0 -914
  22. recce_cloud-1.33.1/recce_cloud/VERSION +0 -1
  23. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/hatch_build.py +0 -0
  24. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/pyproject.toml +0 -0
  25. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/__init__.py +0 -0
  26. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/api/__init__.py +0 -0
  27. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/api/exceptions.py +0 -0
  28. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/api/factory.py +0 -0
  29. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/artifact.py +0 -0
  30. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/auth/__init__.py +0 -0
  31. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/auth/callback_server.py +0 -0
  32. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/auth/login.py +0 -0
  33. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/auth/profile.py +0 -0
  34. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/auth/templates/error.html +0 -0
  35. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/auth/templates/success.html +0 -0
  36. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/ci_providers/__init__.py +0 -0
  37. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/commands/__init__.py +0 -0
  38. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/config/__init__.py +0 -0
  39. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/report.py +0 -0
  40. {recce_cloud-1.33.1 → recce_cloud-1.34.1}/recce_cloud/services/__init__.py +0 -0
@@ -17,6 +17,7 @@ build
17
17
  .DS_Store
18
18
 
19
19
  recce.yml
20
+ STATUS.md
20
21
 
21
22
  # Ignore build artifacts from frontend
22
23
  recce/data
@@ -24,6 +25,14 @@ recce/data
24
25
  # ignore Claude logs and plans at any nesting
25
26
  **/docs/plans/**/*.md
26
27
  **/docs/plans/**/*.json
28
+ **/docs/tasks/**/*.md
29
+ **/docs/tasks/**/*.json
30
+ **/docs/summaries/**/*.md
31
+ **/docs/summaries/**/*.json
27
32
 
28
33
  # Git worktrees for isolated development
29
34
  .worktrees/
35
+
36
+ # Claude output files
37
+ output/*
38
+ !output/.gitkeep
@@ -0,0 +1,370 @@
1
+ Metadata-Version: 2.4
2
+ Name: recce-cloud
3
+ Version: 1.34.1
4
+ Summary: Lightweight CLI for Recce Cloud operations
5
+ Project-URL: Bug Tracker, https://github.com/InfuseAI/recce/issues
6
+ Author-email: InfuseAI Dev Team <dev@infuseai.io>
7
+ License: Apache-2.0
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Python: >=3.9
17
+ Requires-Dist: click>=7.1
18
+ Requires-Dist: cryptography>=3.4
19
+ Requires-Dist: pyyaml>=6.0
20
+ Requires-Dist: requests>=2.28.1
21
+ Requires-Dist: rich>=12.0.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: flake8>=7.2.0; extra == 'dev'
24
+ Requires-Dist: pytest>=4.6; extra == 'dev'
25
+ Description-Content-Type: text/markdown
26
+
27
+ # Recce Cloud CLI
28
+
29
+ Lightweight command-line tool for managing dbt artifacts with Recce Cloud in
30
+ CI/CD environments.
31
+
32
+ ## Overview
33
+
34
+ The Recce Cloud CLI (`recce-cloud`) is a standalone tool designed for CI/CD
35
+ pipelines that need to upload and download dbt artifacts (manifest.json and
36
+ catalog.json) to/from Recce Cloud without the full `recce` package dependencies.
37
+
38
+ **Key Features:**
39
+
40
+ - Lightweight - minimal dependencies for fast CI/CD execution
41
+ - Auto-detection - automatically detects CI platform, repository, and PR/MR
42
+ context
43
+ - Upload/Download - push and pull dbt artifacts to/from Recce Cloud sessions
44
+ - Flexible authentication - browser-based login, token-based auth, or CI tokens
45
+ - Platform-specific - optimized for GitHub Actions and GitLab CI
46
+
47
+ ## Installation
48
+
49
+ ```bash
50
+ pip install recce-cloud
51
+ ```
52
+
53
+ ## Quick Start
54
+
55
+ ### Local Development
56
+
57
+ ```bash
58
+ # Login to Recce Cloud (opens browser for authentication)
59
+ recce-cloud login
60
+
61
+ # Initialize project binding (interactive)
62
+ recce-cloud init
63
+
64
+ # Check current status
65
+ recce-cloud init --status
66
+
67
+ # Logout
68
+ recce-cloud logout
69
+ ```
70
+
71
+ ### GitHub Actions
72
+
73
+ ```yaml
74
+ - name: Upload to Recce Cloud
75
+ run: recce-cloud upload
76
+ env:
77
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78
+
79
+ - name: Download from Recce Cloud
80
+ run: recce-cloud download --prod --target-path target-base
81
+ env:
82
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83
+ ```
84
+
85
+ ### GitLab CI
86
+
87
+ ```yaml
88
+ recce-upload:
89
+ script:
90
+ - recce-cloud upload
91
+
92
+ recce-download:
93
+ script:
94
+ - recce-cloud download --prod --target-path target-base
95
+ ```
96
+
97
+ ## CI/CD Workflows
98
+
99
+ ### Upload Workflow
100
+
101
+ The `recce-cloud upload` command automatically creates sessions in supported CI
102
+ environments.
103
+
104
+ ```bash
105
+ # Basic upload (auto-detects CI context)
106
+ recce-cloud upload
107
+
108
+ # Custom target path
109
+ recce-cloud upload --target-path custom-target
110
+
111
+ # Override PR number or session type
112
+ recce-cloud upload --pr 123 --type pr
113
+
114
+ # Generic workflow with session name (for other CI platforms)
115
+ recce-cloud upload --session-name "PR-123" --yes
116
+ ```
117
+
118
+ **Options:**
119
+
120
+ | Option | Description |
121
+ | ---------------- | ------------------------------------------------ |
122
+ | `--target-path` | Path to dbt target directory (default: `target`) |
123
+ | `--session-id` | Session ID for generic workflow |
124
+ | `--session-name` | Session name for human-readable workflow |
125
+ | `--pr` | Override PR/MR number |
126
+ | `--type` | Override session type: `pr`, `prod`, `dev` |
127
+ | `--yes` | Auto-confirm session creation |
128
+ | `--dry-run` | Preview without uploading |
129
+
130
+ ### Download Workflow
131
+
132
+ The `recce-cloud download` command retrieves artifacts from Recce Cloud
133
+ sessions.
134
+
135
+ ```bash
136
+ # Download current PR/MR session
137
+ recce-cloud download
138
+
139
+ # Download production/base session
140
+ recce-cloud download --prod
141
+
142
+ # Download to custom path
143
+ recce-cloud download --prod --target-path target-base
144
+
145
+ # Force overwrite existing files
146
+ recce-cloud download --force
147
+
148
+ # Generic workflow with session ID
149
+ recce-cloud download --session-id abc123
150
+ ```
151
+
152
+ **Options:**
153
+
154
+ | Option | Description |
155
+ | --------------- | ---------------------------------------- |
156
+ | `--target-path` | Download destination (default: `target`) |
157
+ | `--session-id` | Session ID for generic workflow |
158
+ | `--prod` | Download production/base session |
159
+ | `--force`, `-f` | Overwrite existing files |
160
+ | `--dry-run` | Preview without downloading |
161
+
162
+ ## Authentication
163
+
164
+ The CLI supports multiple authentication methods (in priority order):
165
+
166
+ 1. **RECCE_API_TOKEN** - Environment variable (recommended for CI)
167
+ 2. **GITHUB_TOKEN** - GitHub Actions (must be explicitly set)
168
+ 3. **CI_JOB_TOKEN** - GitLab CI (auto-detected)
169
+ 4. **Stored credentials** - From `recce-cloud login`
170
+
171
+ ### Getting API Tokens
172
+
173
+ **Recce Cloud API Token:**
174
+
175
+ 1. Log in to [Recce Cloud](https://cloud.datarecce.io)
176
+ 2. Go to Settings → API Tokens
177
+
178
+ ## CI/CD Integration Examples
179
+
180
+ ### GitHub Actions - Complete Workflow
181
+
182
+ ```yaml
183
+ name: Recce CI
184
+
185
+ on:
186
+ pull_request:
187
+ branches: [main]
188
+
189
+ jobs:
190
+ recce:
191
+ runs-on: ubuntu-latest
192
+ steps:
193
+ - uses: actions/checkout@v4
194
+
195
+ - name: Setup Python
196
+ uses: actions/setup-python@v4
197
+ with:
198
+ python-version: "3.11"
199
+
200
+ - name: Install dependencies
201
+ run: pip install dbt-core dbt-snowflake recce-cloud
202
+
203
+ # Download production artifacts for comparison
204
+ - name: Download base artifacts
205
+ run: recce-cloud download --prod --target-path target-base
206
+ env:
207
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
208
+
209
+ # Build current PR
210
+ - name: Build dbt project
211
+ run: |
212
+ dbt deps
213
+ dbt build
214
+ dbt docs generate
215
+
216
+ # Upload current PR artifacts
217
+ - name: Upload to Recce Cloud
218
+ run: recce-cloud upload
219
+ env:
220
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
221
+ ```
222
+
223
+ ### GitLab CI - Complete Workflow
224
+
225
+ ```yaml
226
+ stages:
227
+ - download
228
+ - build
229
+ - upload
230
+
231
+ recce-download-base:
232
+ stage: download
233
+ image: python:3.11-slim
234
+ script:
235
+ - pip install recce-cloud
236
+ - recce-cloud download --prod --target-path target-base
237
+ artifacts:
238
+ paths:
239
+ - target-base/
240
+ only:
241
+ - merge_requests
242
+
243
+ dbt-build:
244
+ stage: build
245
+ image: python:3.11-slim
246
+ script:
247
+ - pip install dbt-core dbt-snowflake
248
+ - dbt deps
249
+ - dbt build
250
+ - dbt docs generate
251
+ artifacts:
252
+ paths:
253
+ - target/
254
+ only:
255
+ - merge_requests
256
+
257
+ recce-upload:
258
+ stage: upload
259
+ image: python:3.11-slim
260
+ script:
261
+ - pip install recce-cloud
262
+ - recce-cloud upload
263
+ dependencies:
264
+ - dbt-build
265
+ only:
266
+ - merge_requests
267
+ ```
268
+
269
+ ### Generic CI Platform
270
+
271
+ For other CI platforms, use session name workflow with your PR/MR number:
272
+
273
+ ```bash
274
+ export RECCE_API_TOKEN=your_token_here
275
+
276
+ # Upload PR artifacts (creates session if not exists)
277
+ recce-cloud upload --session-name "PR-${PR_NUMBER}" --yes
278
+
279
+ # Upload production artifacts (in CD pipeline after merge)
280
+ recce-cloud upload --type prod --yes
281
+ ```
282
+
283
+ The `--session-name` option creates a human-readable session that's easy to
284
+ track. Use `--yes` to auto-confirm session creation in CI environments.
285
+
286
+ ## Environment Variables
287
+
288
+ | Variable | Description |
289
+ | ------------------ | ---------------------------------------- |
290
+ | `RECCE_API_TOKEN` | Recce Cloud API token |
291
+ | `RECCE_SESSION_ID` | Default session ID for generic workflows |
292
+ | `GITHUB_TOKEN` | GitHub authentication (Actions) |
293
+ | `CI_JOB_TOKEN` | GitLab CI job token (auto-detected) |
294
+
295
+ ## Additional Commands
296
+
297
+ Beyond upload and download, the CLI provides:
298
+
299
+ ```bash
300
+ # List sessions in your project
301
+ recce-cloud list
302
+
303
+ # Delete a session
304
+ recce-cloud delete --session-id abc123
305
+
306
+ # Generate AI review for a session
307
+ recce-cloud review --session-id abc123
308
+
309
+ # Generate PR metrics report
310
+ recce-cloud report --since 30d
311
+
312
+ # Diagnose setup issues
313
+ recce-cloud doctor
314
+
315
+ # Show version
316
+ recce-cloud version
317
+ ```
318
+
319
+ Run `recce-cloud <command> --help` for detailed options.
320
+
321
+ ## Troubleshooting
322
+
323
+ ### Quick Diagnosis
324
+
325
+ ```bash
326
+ recce-cloud doctor
327
+ ```
328
+
329
+ This validates login status, project binding, and session availability.
330
+
331
+ ### Common Issues
332
+
333
+ **Missing dbt artifacts:**
334
+
335
+ ```bash
336
+ dbt build
337
+ dbt docs generate # Required before upload
338
+ recce-cloud upload
339
+ ```
340
+
341
+ **Authentication failed:**
342
+
343
+ - For GitHub Actions: Set `GITHUB_TOKEN` in env
344
+ - For GitLab CI: `CI_JOB_TOKEN` is auto-detected
345
+ - For generic CI: Set `RECCE_API_TOKEN`
346
+
347
+ **Platform not supported:**
348
+
349
+ ```bash
350
+ # Use session name workflow for unsupported CI platforms
351
+ recce-cloud upload --session-name "PR-${PR_NUMBER}" --yes
352
+ ```
353
+
354
+ ### Debug Mode
355
+
356
+ ```bash
357
+ export RECCE_LOG_LEVEL=DEBUG
358
+ recce-cloud upload
359
+ ```
360
+
361
+ ## Support
362
+
363
+ - **Documentation:** [docs.reccehq.com](https://docs.reccehq.com)
364
+ - **Issues:** [GitHub Issues](https://github.com/DataRecce/recce/issues)
365
+ - **Community:** [Recce Slack](https://getdbt.slack.com/archives/C05C28V7CPP)
366
+ - **Email:** <support@reccehq.com>
367
+
368
+ ## License
369
+
370
+ Apache License 2.0 - See [LICENSE](../LICENSE) file for details.
@@ -0,0 +1 @@
1
+ 1.34.1
@@ -74,7 +74,7 @@ class BaseRecceCloudClient(ABC):
74
74
  self,
75
75
  branch: str,
76
76
  adapter_type: str,
77
- cr_number: Optional[int] = None,
77
+ pr_number: Optional[int] = None,
78
78
  commit_sha: Optional[str] = None,
79
79
  session_type: Optional[str] = None,
80
80
  ) -> Dict:
@@ -84,9 +84,9 @@ class BaseRecceCloudClient(ABC):
84
84
  Args:
85
85
  branch: Branch name
86
86
  adapter_type: DBT adapter type (e.g., 'postgres', 'snowflake', 'bigquery')
87
- cr_number: Change request number (PR/MR number) for CR sessions
87
+ pr_number: Pull/Merge request number (PR/MR number) for PR sessions
88
88
  commit_sha: Commit SHA (GitLab requires this)
89
- session_type: Session type ("cr", "prod", "dev") - determines if cr_number is used
89
+ session_type: Session type ("pr", "prod", "dev") - determines if pr_number is used
90
90
 
91
91
  Returns:
92
92
  Dictionary containing:
@@ -113,15 +113,15 @@ class BaseRecceCloudClient(ABC):
113
113
  @abstractmethod
114
114
  def get_session_download_urls(
115
115
  self,
116
- cr_number: Optional[int] = None,
116
+ pr_number: Optional[int] = None,
117
117
  session_type: Optional[str] = None,
118
118
  ) -> Dict:
119
119
  """
120
120
  Get download URLs for artifacts from a session.
121
121
 
122
122
  Args:
123
- cr_number: Change request number (PR/MR number) for CR sessions
124
- session_type: Session type ("cr", "prod", "dev")
123
+ pr_number: Pull/Merge request number (PR/MR number) for PR sessions
124
+ session_type: Session type ("pr", "prod", "dev")
125
125
 
126
126
  Returns:
127
127
  Dictionary containing:
@@ -134,15 +134,15 @@ class BaseRecceCloudClient(ABC):
134
134
  @abstractmethod
135
135
  def delete_session(
136
136
  self,
137
- cr_number: Optional[int] = None,
137
+ pr_number: Optional[int] = None,
138
138
  session_type: Optional[str] = None,
139
139
  ) -> Dict:
140
140
  """
141
141
  Delete a session.
142
142
 
143
143
  Args:
144
- cr_number: Change request number (PR/MR number) for CR sessions
145
- session_type: Session type ("cr", "prod") - "prod" deletes base session
144
+ pr_number: Pull/Merge request number (PR/MR number) for PR sessions
145
+ session_type: Session type ("pr", "prod") - "prod" deletes base session
146
146
 
147
147
  Returns:
148
148
  Dictionary containing: