Skip to content

[CRCR] Add agentic triage verdict support to cross-repo CI relay - #8803

Open
can-gaa-hou wants to merge 1 commit into
pytorch:mainfrom
can-gaa-hou:crcr_agent
Open

can-gaa-hou wants to merge 1 commit into
pytorch:mainfrom
can-gaa-hou:crcr_agent

Conversation

@can-gaa-hou

@can-gaa-hou can-gaa-hou commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

First step of #8673: lets a downstream CRCR repo attach an optional triage verdict to its report-ci-result callback, explaining why its CI failed — most importantly whether the cause was the upstream pytorch/pytorch change 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 — optional triage-verdict input, passed through to workflow.triage_verdict.
  • utils/triage_verdict.py — validates it for hostile input: any structural violation (bad type, unknown enum, bad schema_version, non-http log_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.

@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

@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.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 15, 2026
try:
parsed = json.loads(triage_verdict)
except json.JSONDecodeError as exc:
sys.exit(f"Error: TRIAGE_VERDICT is not valid JSON: {exc}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants