Add ClickHouse ingestion for autorevert advisor verdicts#7906
Merged
izaitsevfb merged 1 commit intomainfrom Mar 31, 2026
Merged
Add ClickHouse ingestion for autorevert advisor verdicts#7906izaitsevfb merged 1 commit intomainfrom
izaitsevfb merged 1 commit intomainfrom
Conversation
…erdicts - New table misc.autorevert_advisor_verdicts for storing AI advisor verdicts (verdict, confidence, summary, causal_reasoning) with signal metadata (signal_key, suspect_commit, pr_number) - Add autorevert_advisor_verdicts adapter to clickhouse-replicator-s3 Lambda for S3 → CH ingestion - S3 prefix: autorevert_advisor_verdicts/
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
3 tasks
jeanschmidt
approved these changes
Mar 31, 2026
pytorchmergebot
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Mar 31, 2026
…78810) ## Summary Adds a workflow step that uploads the AI advisor verdict to S3 (`ossci-raw-job-status/autorevert_advisor_verdicts/`) for ingestion into ClickHouse. This enables the autorevert lambda to read verdicts from CH (fast, single query) instead of downloading GitHub Actions artifacts (~1.7s each, up to 66 in a 16h window). The uploaded JSON includes the verdict fields plus signal metadata (signal_key, suspect_commit, pr_number, workflow_name) extracted from the `signal_pattern` input. ## Dependencies - [test-infra#7906](pytorch/test-infra#7906) — CH table schema + Lambda adapter - Internal: S3 bucket notification + IAM permissions for the `bedrock` environment role ## Test plan - [x] Verify the `jq` command correctly builds the enriched JSON - [x] Verify S3 upload succeeds with appropriate IAM permissions - [x] End-to-end: verdict appears in `misc.autorevert_advisor_verdicts` table ^ verified end-to-end on ciforge Pull Request resolved: #178810 Approved by: https://github.com/wdvr
AaronWang04
pushed a commit
to AaronWang04/pytorch
that referenced
this pull request
Mar 31, 2026
…torch#178810) ## Summary Adds a workflow step that uploads the AI advisor verdict to S3 (`ossci-raw-job-status/autorevert_advisor_verdicts/`) for ingestion into ClickHouse. This enables the autorevert lambda to read verdicts from CH (fast, single query) instead of downloading GitHub Actions artifacts (~1.7s each, up to 66 in a 16h window). The uploaded JSON includes the verdict fields plus signal metadata (signal_key, suspect_commit, pr_number, workflow_name) extracted from the `signal_pattern` input. ## Dependencies - [test-infra#7906](pytorch/test-infra#7906) — CH table schema + Lambda adapter - Internal: S3 bucket notification + IAM permissions for the `bedrock` environment role ## Test plan - [x] Verify the `jq` command correctly builds the enriched JSON - [x] Verify S3 upload succeeds with appropriate IAM permissions - [x] End-to-end: verdict appears in `misc.autorevert_advisor_verdicts` table ^ verified end-to-end on ciforge Pull Request resolved: pytorch#178810 Approved by: https://github.com/wdvr
3 tasks
pytorch-bot bot
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Apr 2, 2026
…78810) ## Summary Adds a workflow step that uploads the AI advisor verdict to S3 (`ossci-raw-job-status/autorevert_advisor_verdicts/`) for ingestion into ClickHouse. This enables the autorevert lambda to read verdicts from CH (fast, single query) instead of downloading GitHub Actions artifacts (~1.7s each, up to 66 in a 16h window). The uploaded JSON includes the verdict fields plus signal metadata (signal_key, suspect_commit, pr_number, workflow_name) extracted from the `signal_pattern` input. ## Dependencies - [test-infra#7906](pytorch/test-infra#7906) — CH table schema + Lambda adapter - Internal: S3 bucket notification + IAM permissions for the `bedrock` environment role ## Test plan - [x] Verify the `jq` command correctly builds the enriched JSON - [x] Verify S3 upload succeeds with appropriate IAM permissions - [x] End-to-end: verdict appears in `misc.autorevert_advisor_verdicts` table ^ verified end-to-end on ciforge Pull Request resolved: #178810 Approved by: https://github.com/wdvr
izaitsevfb
added a commit
that referenced
this pull request
Apr 2, 2026
## Summary Closes the loop on the AI advisor: autorevert now reads verdict results from `misc.autorevert_advisor_verdicts` (populated via S3 ingestion from the advisor workflow) and uses them to make faster decisions. ## Verdict Handling | Advisor Verdict | Autorevert Action | |----------------|-------------------| | `revert` | Produce `AutorevertPattern` immediately — skip restarts | | `not_related` | Early exit as `Ineligible(ADVISOR_NOT_RELATED)` | | `garbage` | Suppress signal for 2h since verdict timestamp | | `unsure` | Continue normal restart-to-confirm flow | ## Changes - **`signal.py`**: `AdvisorVerdict` enum, `AIAdvisorResult` dataclass, `SignalCommit.advisor_result` field, `_check_advisor_verdict()` method, restructured `process_valid_autorevert_pattern()` (flakiness check moved after advisor) - **`signal_extraction_datasource.py`**: `fetch_advisor_verdicts()` — CH query for verdicts by commit SHAs - **`signal_extraction.py`**: `_attach_advisor_verdicts()` — post-processing step that wires CH data to SignalCommit objects - **`tests/test_signal.py`**: 8 new tests covering all verdict types, 2h expiry, signal key matching, flaky signal handling ## Dependencies - [#7839](#7839) (merged) — advisor dispatch from lambda - [#7906](#7906) (merged) — CH table + S3 ingestion - [pytorch/pytorch#178810](pytorch/pytorch#178810) (pending) — workflow S3 upload step ## Test plan - [x] 60 tests passing (8 new) - [x] End-to-end verified: ciforge advisor run → S3 → CH → row queryable - [ ] Deploy and verify verdicts are read during live autorevert runs tested locally: ``` python -m pytorch_auto_revert --dry-run autorevert-checker trunk --hours 18 --as-of "2026-03-31 18:12" --hud-html python -m pytorch_auto_revert --dry-run autorevert-checker trunk --hours 18 --hud-html ``` example of the result: [2026-04-01T00-11-54.124373-00-00.html](https://github.com/user-attachments/files/26392664/2026-04-01T00-11-54.124373-00-00.html) [2026-04-01T01-22-24.845831-00-00.html](https://github.com/user-attachments/files/26393283/2026-04-01T01-22-24.845831-00-00.html)
IvanKobzarev
pushed a commit
to IvanKobzarev/pytorch
that referenced
this pull request
Apr 3, 2026
…torch#178810) ## Summary Adds a workflow step that uploads the AI advisor verdict to S3 (`ossci-raw-job-status/autorevert_advisor_verdicts/`) for ingestion into ClickHouse. This enables the autorevert lambda to read verdicts from CH (fast, single query) instead of downloading GitHub Actions artifacts (~1.7s each, up to 66 in a 16h window). The uploaded JSON includes the verdict fields plus signal metadata (signal_key, suspect_commit, pr_number, workflow_name) extracted from the `signal_pattern` input. ## Dependencies - [test-infra#7906](pytorch/test-infra#7906) — CH table schema + Lambda adapter - Internal: S3 bucket notification + IAM permissions for the `bedrock` environment role ## Test plan - [x] Verify the `jq` command correctly builds the enriched JSON - [x] Verify S3 upload succeeds with appropriate IAM permissions - [x] End-to-end: verdict appears in `misc.autorevert_advisor_verdicts` table ^ verified end-to-end on ciforge Pull Request resolved: pytorch#178810 Approved by: https://github.com/wdvr
nklshy-aws
pushed a commit
to nklshy-aws/pytorch
that referenced
this pull request
Apr 7, 2026
…torch#178810) ## Summary Adds a workflow step that uploads the AI advisor verdict to S3 (`ossci-raw-job-status/autorevert_advisor_verdicts/`) for ingestion into ClickHouse. This enables the autorevert lambda to read verdicts from CH (fast, single query) instead of downloading GitHub Actions artifacts (~1.7s each, up to 66 in a 16h window). The uploaded JSON includes the verdict fields plus signal metadata (signal_key, suspect_commit, pr_number, workflow_name) extracted from the `signal_pattern` input. ## Dependencies - [test-infra#7906](pytorch/test-infra#7906) — CH table schema + Lambda adapter - Internal: S3 bucket notification + IAM permissions for the `bedrock` environment role ## Test plan - [x] Verify the `jq` command correctly builds the enriched JSON - [x] Verify S3 upload succeeds with appropriate IAM permissions - [x] End-to-end: verdict appears in `misc.autorevert_advisor_verdicts` table ^ verified end-to-end on ciforge Pull Request resolved: pytorch#178810 Approved by: https://github.com/wdvr
bobrenjc93
pushed a commit
to bobrenjc93/pytorch
that referenced
this pull request
Apr 9, 2026
…torch#178810) ## Summary Adds a workflow step that uploads the AI advisor verdict to S3 (`ossci-raw-job-status/autorevert_advisor_verdicts/`) for ingestion into ClickHouse. This enables the autorevert lambda to read verdicts from CH (fast, single query) instead of downloading GitHub Actions artifacts (~1.7s each, up to 66 in a 16h window). The uploaded JSON includes the verdict fields plus signal metadata (signal_key, suspect_commit, pr_number, workflow_name) extracted from the `signal_pattern` input. ## Dependencies - [test-infra#7906](pytorch/test-infra#7906) — CH table schema + Lambda adapter - Internal: S3 bucket notification + IAM permissions for the `bedrock` environment role ## Test plan - [x] Verify the `jq` command correctly builds the enriched JSON - [x] Verify S3 upload succeeds with appropriate IAM permissions - [x] End-to-end: verdict appears in `misc.autorevert_advisor_verdicts` table ^ verified end-to-end on ciforge Pull Request resolved: pytorch#178810 Approved by: https://github.com/wdvr
bobrenjc93
pushed a commit
to bobrenjc93/pytorch
that referenced
this pull request
Apr 10, 2026
…torch#178810) ## Summary Adds a workflow step that uploads the AI advisor verdict to S3 (`ossci-raw-job-status/autorevert_advisor_verdicts/`) for ingestion into ClickHouse. This enables the autorevert lambda to read verdicts from CH (fast, single query) instead of downloading GitHub Actions artifacts (~1.7s each, up to 66 in a 16h window). The uploaded JSON includes the verdict fields plus signal metadata (signal_key, suspect_commit, pr_number, workflow_name) extracted from the `signal_pattern` input. ## Dependencies - [test-infra#7906](pytorch/test-infra#7906) — CH table schema + Lambda adapter - Internal: S3 bucket notification + IAM permissions for the `bedrock` environment role ## Test plan - [x] Verify the `jq` command correctly builds the enriched JSON - [x] Verify S3 upload succeeds with appropriate IAM permissions - [x] End-to-end: verdict appears in `misc.autorevert_advisor_verdicts` table ^ verified end-to-end on ciforge Pull Request resolved: pytorch#178810 Approved by: https://github.com/wdvr
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
Sets up the S3 → ClickHouse ingestion pipeline for autorevert AI advisor verdicts, following the same pattern as
claude_code_usage.Changes
clickhouse_db_schema/misc.autorevert_advisor_verdicts/schema.sql— new table storing verdict, confidence, summary, causal_reasoning, plus signal metadata (signal_key, suspect_commit, pr_number, workflow_name)aws/lambda/clickhouse-replicator-s3/lambda_function.py— addautorevert_advisor_verdictstoSUPPORTED_PATHS+ adapter functionS3 path
s3://ossci-raw-job-status/autorevert_advisor_verdicts/<repo>/<run_id>_<run_attempt>.jsonDependencies
autorevert_advisor_verdicts/prefix →clickhouse-replicator-s3Lambda (internal infra change)Test plan