Add CRCR downstream health metrics and critical tests with HUD metrics (L1/L2)#9
Merged
Merged
Conversation
Introduce payload validators, JSON fixtures, and unit tests that run on push/PR to this repo. Enhance the dispatch-receiver and L2 workflows to assert payload shape, PyTorch checkout SHA, and deterministic relay callbacks instead of random pass/fail simulation. Test Plan: ``` python3 -m unittest discover -s tests -p 'test_*.py' -v ``` Authored with an AI assistant. Co-authored-by: Cursor <cursoragent@cursor.com>
jewelkm89
marked this pull request as draft
June 30, 2026 13:31
Remove any scheduled-monitor direction from docs and strengthen L1/L2 workflows to record actual step outcomes, emit health-report.json artifacts per dispatch run, and assert closed-event cancel behavior. Test Plan: ``` python3 -m unittest discover -s tests -p 'test_*.py' -v ``` Authored with an AI assistant. Co-authored-by: Cursor <cursoragent@cursor.com>
Test Plan: ``` ./scripts/run-local-tests.sh ``` Authored with an AI assistant. Co-authored-by: Cursor <cursoragent@cursor.com>
Map each integration check to workflow.test_results (passed/failed/total) and post through the existing cross-repo-ci-relay-callback action. L1 now reports in_progress/completed callbacks as well as L2. Test Plan: ``` python3 -m unittest discover -s tests -p 'test_*.py' -v ``` Authored with an AI assistant. Co-authored-by: Cursor <cursoragent@cursor.com>
jewelkm89
marked this pull request as ready for review
July 6, 2026 08:26
Collaborator
Author
|
Hi @atalman, can you please review the tests added for critical test check |
Default to the current gh repo with fallback to pytorch/crcr-test instead of a hardcoded personal fork. CRCR_TEST_REPO still overrides explicitly. Test plan: ``` ./scripts/trigger-test-dispatch.sh --help # N/A; script has no --help git diff scripts/trigger-test-dispatch.sh ``` Authored with an AI assistant. Co-authored-by: Cursor <cursoragent@cursor.com>
L1 runs a light probe (payload + checkout, no callbacks) on synchronize and push. L2 runs only on opened/reopened. Full L1+L2 HUD probes remain on low-volume PR events. Document tiered coverage in README. Test plan: ``` ./scripts/run-local-tests.sh ``` Authored with an AI assistant. Co-authored-by: Cursor <cursoragent@cursor.com>
atalman
reviewed
Jul 7, 2026
atalman
reviewed
Jul 7, 2026
Factor probe check lists into scripts/health_checks.sh so L1/L2 workflows share one definition per probe mode. HUD metrics still use the pre-callback check set; the artifact adds completed_callback afterward (documented in workflow comments). Add positive-path checkout SHA test, rename L2 workflow to CRCR, drop redundant closed guard, and fix a stray f-string. Test Plan: ``` python3 -m unittest discover -s tests -p 'test_*.py' -v ``` Authored with an AI assistant. Co-authored-by: Cursor <cursoragent@cursor.com>
Align the L2 workflow filename with CRCR naming used in the workflow title and L1's crcr-dispatch-receiver.yml. Update README and helper scripts to reference the new path. Test Plan: ``` python3 -m unittest discover -s tests -p 'test_*.py' -v ``` Authored with an AI assistant. Co-authored-by: Cursor <cursoragent@cursor.com>
Authored with an AI assistant. Co-authored-by: Cursor <cursoragent@cursor.com>
atalman
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Turns
pytorch/crcr-testinto a downstream CRCR test repo. This repo contains test workflows and validators that run on liverepository_dispatchevents from the relay.On upstream PyTorch PR
opened/reopened, workflows validate dispatch delivery, PyTorch checkout fidelity, and (for L2) relay callbacks. Health check outcomes are sent to HUD via the existingcompletedcallbacktest_resultsfield (each integration check maps to passed/failed/total).On
synchronizeandpush, L1 runs a light probe (payload + checkout only, no callbacks). L2 is skipped. This tiered model reduces relay HTTP 429 rate-limit hits (#8) while keeping dispatch coverage on high-volume events.flowchart TB PT[pytorch/pytorch PR or push] --> APP[CRCR GitHub App] APP --> RD[repository_dispatch to crcr-test] RD --> L1C{PR closed?} RD --> L2C{PR closed?} L1C -->|yes| L1X[L1 cancel-workflow] L1C -->|no| L1A{opened or reopened?} L1A -->|yes| L1F[L1 full probe + HUD] L1A -->|no| L1L[L1 light probe no callbacks] L2C -->|yes| L2X[L2 cancel-workflow] L2C -->|no| L2A{opened or reopened?} L2A -->|yes| L2[L2 full probe + HUD] L2A -->|no| L2S[L2 skipped] L1F --> RELAY[Callback lambda] L2 --> RELAY RELAY --> HUD[HUD crcr-test dashboard] OFF[Layer 0 offline unit tests] -.-> L1F OFF -.-> L2Test layers overview
crcr-unit-tests.ymlcrcr-dispatch-receiver.ymloot-l2-ci.ymlcrcr-testrepository_dispatch(pull_request+push)repository_dispatch(pull_request,opened/reopenedonly)opened/reopenedonlyopened/reopenedonlyopened/reopenedonlyEvent filtering (relay rate limits)
The callback Lambda enforces a per-repo sliding-window limit (~20/min in prod today; 60/min after test-infra#8203 deploy). A full L1+L2 probe costs 4 callbacks.
synchronizeis high volume and was tripping 429s when every event sent full callbacks.opened,reopenedsynchronizeclosedpushLight probe still validates dispatch payload, checks out PyTorch, verifies SHA, and uploads
health-report.json. Callback coverage remains on low-volumeopened/reopenedwhere the callback code path is identical.Tests and checks by layer
L0 — Offline (
crcr-unit-tests.yml)openedsynchronizeclosedpushdelivery_idpytorch/pytorchin_progressshapecompletedshapeconclusionconclusionvalidate_pytorch_checkout.pylogictest_resultsmappinghealthy,conclusionfieldsL1 — Live dispatch probe (
crcr-dispatch-receiver.yml)opened/reopened)synchronize/push)validate_dispatch_payloadin_progresscallbackvalidate_pytorch_checkoutdelivery_idcompletedcallback + HUD metricscancel-workflow(PR closed)L2 — Live callback probe (
oot-l2-ci.yml)Runs only on
opened/reopened.validate_dispatch_payloadin_progresscallbackvalidate_pytorch_checkoutwrite_health_report+completedcallbacktest_results+conclusionto HUDcompleted_callbackin final reportcancel-workflow(PR closed)closedOne upstream event — what runs?
opened/reopenedl1-criticalfulll2-criticalsynchronizel1-lightclosedcancel-workflowcancel-workflowl1-lightcrcr-unit-testsShared components by layer
validate_dispatch_payload.pyvalidate_pytorch_checkout.pyvalidate_callback_payload.pywrite_health_report.pycross-repo-ci-relay-callbackKey changes
tests/— payload validators, JSON fixtures,write_health_report.py, and 16 unit testswrite_health_report.py— shared health reporter used by both L1 and L2 probes; aggregates step outcomes intochecks, maps them to HUDtest_results, and feeds thecompletedcallback (separate report and HUD row per probe)crcr-dispatch-receiver.yml— L1 probe: full onopened/reopened, light onsynchronize/pushoot-l2-ci.yml— L2 probe:opened/reopenedonly; deterministic checks + callbackscrcr-unit-tests.yml— offline contract tests on push/PR to this reposcripts/—run-local-tests.shandtrigger-test-dispatch.shfor local/fork testingCRCR health is measured when the relay dispatches; offline unit tests guard validator/fixture drift on merge.
HUD health metrics
L1 and L2 full probes build a health report from step outcomes, then send it on the
completedcallback:test_resultssuccesspassed_testsfailure/cancelledfailed_testsskippedskipped_testsconclusionissuccessonly when all checks pass. Per-check names are in thehealth-report.jsonworkflow artifact. Verify rows at https://hud.pytorch.org/crcr/pytorch/crcr-testTest plan
Pre-merge (offline):
Pre-merge (CI):
crcr-unit-testsworkflow passes on this PRPost-merge (live CRCR):
openedtriggersL1 Health(full) andL2 Healthworkflowssynchronizetriggers L1 light only (no L2, no callbacks)completedcallback succeeds onopened/reopened(HTTP 2xx from relay)passed_tests/failed_tests/total_testsmatching probe checkshealth-report.jsonartifact uploaded per runAuthored with an AI assistant.