Commit b34209c
fix(v3-ref-seller): rebase + restore mock_ad_server instrumentation + typed responses (PR #408 fix-pack)
Rebase onto main (53d8b8c) restored MockAdServer wiring on the 5
existing sales methods that PR #405 added. Apply _record(...) calls on
the 6 new methods this PR introduces (media_buys.list,
performance.feedback, creatives.formats, creatives.list,
accounts.sync, accounts.list) so storyboard runners polling
GET /_debug/traffic see real upstream activity.
Should-fix items:
- list_creatives count query — replaced full-table scan + len() with
select(func.count()).select_from(CreativeRow). Test mock updated to
expose .scalar() instead of .scalars().
- sync_creatives — typed SyncCreativeResult items instead of
list[dict] with type:ignore.
- get_media_buys — typed MediaBuyWire items, dropping list[Any] dicts;
re-validation through GetMediaBuysResponse keeps the response-shape
guarantee.
- list_creative_formats — typed Format items.
- sync_accounts — dropped # type: ignore[union-attr] on
brand.domain. Spec requires both brand and brand.domain (no None
guard needed).
Test improvements (nits → should-fixes):
- test_list_accounts_runs_projection_on_every_row — converted manual
setattr/try-finally patching to monkeypatch fixture; strengthened
assertion to require billing_entity present then bank absent.
- Inline `from adcp.server import current_tenant` lifted to the
module top of platform.py (one source of truth for the contextvar
reader).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3169ccb commit b34209c
2 files changed
Lines changed: 43 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | | - | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
531 | 533 | | |
532 | 534 | | |
533 | 535 | | |
534 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
535 | 543 | | |
536 | 544 | | |
537 | 545 | | |
| |||
Lines changed: 32 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| 174 | + | |
172 | 175 | | |
173 | 176 | | |
174 | 177 | | |
| |||
220 | 223 | | |
221 | 224 | | |
222 | 225 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 226 | + | |
228 | 227 | | |
229 | 228 | | |
230 | 229 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
254 | 245 | | |
255 | 246 | | |
256 | 247 | | |
257 | 248 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
263 | 258 | | |
264 | 259 | | |
265 | 260 | | |
| |||
315 | 310 | | |
316 | 311 | | |
317 | 312 | | |
| 313 | + | |
| 314 | + | |
318 | 315 | | |
319 | | - | |
| 316 | + | |
320 | 317 | | |
321 | 318 | | |
322 | 319 | | |
| |||
0 commit comments