Commit 0a01196
adk-telemetry: address PR #237 review comments (round 2)
Reviewer feedback and design nits from daeunJe0ng's copilot-review:
- Fix A (should-fix #1: auth-path latency): the /organization and /me
silent lookups on the interactive auth hot path now use a bounded 3s
socket timeout via plain requests.get (not the module-level _SESSION,
whose 3x 429/5xx retry with backoff_factor=1 would add ~7s per lookup
on a throttled tenant). Worst-case authenticate() overhead is now
bounded to ~6s instead of ~15-40s in the admin-consent-gap case.
tenant_class is driven by the tid claim already in the token, so a
timeout here only degrades tenant_name to blank (recoverable on the
next FlightCheck run) — never a misclassification.
- Fix B (inline nit on common_dimensions): sanitize the explicit
tenant_id kwarg too. Every tenant_id source (explicit, in-memory
identity, disk cache) now flows through _sanitize_tenant_id at the
single choke point in common_dimensions, closing the last back-door
where a caller-supplied non-GUID could leak into the customer bucket.
- Fix C (inline nit on cache_tenant_name): atomic write via
tempfile+os.replace, matching cache_tenant_id. A concurrent reader
(subprocess spawned from a SKILL.md step) can no longer see a
truncated file and fall back to a blank tenant_name for the whole
session.
- Fix D (inline nit on get_cached_tenant_id): the legacy raw-string
compatibility shim now validates against _GUID_RE (case-insensitive)
before returning, matching the docstring's guarantee. Any garbage /
torn / hand-edited pre-versioned file yields "" instead of leaking a
bad value onto real events.
- New regression tests: kwarg-sanitization in common_dimensions, legacy
raw-string rejection in get_cached_tenant_id.
- Test-side: tests/flightcheck/test_graph_client.py now patches
requests.get instead of graph_client._SESSION.get to match the
no-retry hot-path pattern.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 70ddf006-7f8d-48e7-9afa-3fbae73b38641 parent b2c1c78 commit 0a01196
5 files changed
Lines changed: 124 additions & 34 deletions
File tree
- solutions/ess-maker-skills/scripts
- flightcheck
- tests
- flightcheck
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
451 | 453 | | |
452 | 454 | | |
453 | 455 | | |
| |||
Lines changed: 29 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
| |||
197 | 207 | | |
198 | 208 | | |
199 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
200 | 217 | | |
201 | 218 | | |
202 | 219 | | |
| |||
207 | 224 | | |
208 | 225 | | |
209 | 226 | | |
210 | | - | |
| 227 | + | |
211 | 228 | | |
212 | 229 | | |
213 | 230 | | |
214 | 231 | | |
215 | 232 | | |
216 | | - | |
| 233 | + | |
217 | 234 | | |
218 | 235 | | |
219 | 236 | | |
| |||
237 | 254 | | |
238 | 255 | | |
239 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
240 | 265 | | |
241 | 266 | | |
242 | 267 | | |
243 | 268 | | |
244 | 269 | | |
245 | | - | |
| 270 | + | |
246 | 271 | | |
247 | 272 | | |
248 | 273 | | |
249 | 274 | | |
250 | 275 | | |
251 | | - | |
| 276 | + | |
252 | 277 | | |
253 | 278 | | |
254 | 279 | | |
| |||
Lines changed: 44 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
125 | 137 | | |
126 | 138 | | |
127 | 139 | | |
| |||
299 | 311 | | |
300 | 312 | | |
301 | 313 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
311 | 334 | | |
312 | 335 | | |
313 | 336 | | |
| |||
371 | 394 | | |
372 | 395 | | |
373 | 396 | | |
374 | | - | |
375 | | - | |
376 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
377 | 402 | | |
378 | 403 | | |
379 | 404 | | |
| |||
391 | 416 | | |
392 | 417 | | |
393 | 418 | | |
394 | | - | |
395 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
396 | 426 | | |
397 | 427 | | |
398 | 428 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
299 | 332 | | |
300 | 333 | | |
301 | 334 | | |
| |||
0 commit comments