Commit 18a1e2f
authored
fix: catch NotFoundError in artifact fetchers to restore get_job_run_error output (#742)
## Why
In v1.15, two changes combined to break `get_job_run_error`:
1. `get_job_run_artifact` was changed to raise `NotFoundError` for 404
responses instead of `ArtifactRetrievalError` (#729)
2. `JobRunFetcher._fetch_run_results_artifact` and
`_fetch_sources_artifact` only caught `ArtifactRetrievalError`
When a step's artifact returns 404 (normal for many steps), the uncaught
`NotFoundError` propagated into `asyncio.gather(...,
return_exceptions=True)`, which treated each step as a failed exception
and skipped it — resulting in `{"failed_steps": []}` even for genuinely
failed runs.
Fixes #740
## What
- Catch `(ArtifactRetrievalError, NotFoundError)` in both
`_fetch_run_results_artifact` and `_fetch_sources_artifact` so 404s fall
back to log-based error output as intended
- Add regression test that verifies `NotFoundError` from
`get_job_run_artifact` is handled gracefully
## Checklist
- [x] I have performed a self-review of my code
- [x] I have made corresponding changes to the documentation if required
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes1 parent 83e7b0a commit 18a1e2f
3 files changed
Lines changed: 52 additions & 4 deletions
File tree
- .changes/unreleased
- src/dbt_mcp/dbt_admin/run_artifacts
- tests/unit/dbt_admin/run_artifacts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
0 commit comments