[CRCR] Add agentic triage verdict support to cross-repo CI relay - #8803
can-gaa-hou wants to merge 1 commit into
Conversation
|
@can-gaa-hou is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
f3559cf to
68198bc
Compare
| try: | ||
| parsed = json.loads(triage_verdict) | ||
| except json.JSONDecodeError as exc: | ||
| sys.exit(f"Error: TRIAGE_VERDICT is not valid JSON: {exc}") |
There was a problem hiding this comment.
Blocking: triage-verdict is documented as advisory and invalid verdicts should fall back to the plain result, but malformed JSON (or a JSON array) exits this action before it sends any callback. A broken triage step can therefore suppress the raw job result and fail the downstream workflow. Please warn and omit triage_verdict here instead; the relay can still validate well-formed objects.
| # Accept the string form too. | ||
| if isinstance(version, str) and version.strip().isdigit(): | ||
| version = int(version.strip()) | ||
| _require( |
There was a problem hiding this comment.
bool is a subclass of int in Python, so schema_version: true compares equal to SCHEMA_VERSION == 1 and is accepted. That contradicts the documented type validation. Please explicitly accept only a non-boolean integer or a numeric string, and add a regression test for this case.
| ) | ||
| workflow.pop("triage_verdict", None) | ||
| else: | ||
| workflow["triage_verdict"] = verdict |
There was a problem hiding this comment.
Blocking: replacing the raw value here only gets the verdict as far as the HUD request. HUD RelayWorkflow and extractDynamoRecord() do not retain workflow.triage_verdict, and the crcr_workflow_job schema has no corresponding fields, so this data is discarded before DynamoDB and ClickHouse. Issue #8673 requires the category, confidence, and suspected upstream data to be persisted and queryable per check run. Please include the HUD extraction and storage/schema path, with a round-trip test, before landing this wire change.
Summary
First step of #8673: lets a downstream CRCR repo attach an optional triage verdict to its
report-ci-resultcallback, explaining why its CI failed — most importantly whether the cause was the upstreampytorch/pytorchchange under test rather than the backend itself.Scope is deliberately narrow — just get the field onto the wire and make the relay trustworthy about it:
action.yml— optionaltriage-verdictinput, passed through toworkflow.triage_verdict.utils/triage_verdict.py— validates it for hostile input: any structural violation (bad type, unknown enum, badschema_version, non-httplog_url, etc.) drops the whole verdict; oversized fields are capped instead of rejected.callback_handler.py— rewrites the verdict in place with the validated result before forwarding to HUD.Advisory only: never gates a merge, never changes a conclusion.