Commit e9cc5bd
authored
[CRCR] Add nightly/periodic callback handler (Phase 1) (#8302)
## Summary
Phase 1 of the CRCR nightly/periodic self-report implementation ([RFC
98](pytorch/rfcs#98)).
Adds a new code path in the callback Lambda for `nightly` and `periodic`
event types. Unlike PR/push callbacks which require a `DISPATCHED`
record in Redis and follow a two-step state machine (`in_progress` →
`completed`), nightly/periodic callbacks use a **single-callback
model**:
- Downstream repo self-triggers via cron
- Runs CI against a `pytorch/pytorch` SHA (from `nightly` branch or
`main`)
- Reports the final result in **one callback** — no `in_progress` step
**What's different from PR/push:**
- No Redis writes, no state machine, no zombie tracking
- Status must be `completed` (rejects `in_progress`)
- No upstream check runs (nightly results are informational only)
- Timing metrics (queue_time, execution_time) are `null` — no dispatch
record to measure against
**Changes:**
| File | Change |
|------|--------|
| `callback/callback_handler.py` | New `_handle_nightly_callback()` +
routing in `handle()` |
| `tests/test_callback_handler.py` | 8 new tests covering the nightly
path |
**Remaining phases:**
- Phase 2: Update callback action YAML with `delivery-id` / `event-type`
inputs
- Phase 3: Downstream cron workflow in `TorchedHat/pytorch-redhat-ci`
- Phase 4: ClickHouse query for nightly results
- Phase 5-6: HUD display
## Test plan
- [x] 8 unit tests: forward to HUD, skip Redis, no timing metrics,
periodic variant, reject `in_progress`, allowlist gating, rate limiting,
missing `delivery_id`
- [ ] CI passes on this PR1 parent 58cd1a9 commit e9cc5bd
2 files changed
Lines changed: 191 additions & 14 deletions
Lines changed: 69 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
25 | 42 | | |
26 | 43 | | |
27 | 44 | | |
| |||
234 | 251 | | |
235 | 252 | | |
236 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
237 | 290 | | |
238 | 291 | | |
239 | 292 | | |
| |||
245 | 298 | | |
246 | 299 | | |
247 | 300 | | |
248 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
249 | 306 | | |
250 | 307 | | |
251 | 308 | | |
| |||
256 | 313 | | |
257 | 314 | | |
258 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
259 | 325 | | |
260 | 326 | | |
261 | 327 | | |
| |||
278 | 344 | | |
279 | 345 | | |
280 | 346 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
| 347 | + | |
289 | 348 | | |
290 | 349 | | |
291 | 350 | | |
| |||
360 | 419 | | |
361 | 420 | | |
362 | 421 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
| 422 | + | |
368 | 423 | | |
369 | 424 | | |
370 | 425 | | |
| |||
Lines changed: 122 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
462 | 584 | | |
463 | 585 | | |
0 commit comments