Skip to content

Upload autorevert advisor verdicts to S3 for ClickHouse ingestion#178810

Closed
izaitsevfb wants to merge 1 commit intomainfrom
autorevert-advisor-s3-upload
Closed

Upload autorevert advisor verdicts to S3 for ClickHouse ingestion#178810
izaitsevfb wants to merge 1 commit intomainfrom
autorevert-advisor-s3-upload

Conversation

@izaitsevfb
Copy link
Copy Markdown
Contributor

@izaitsevfb izaitsevfb commented Mar 30, 2026

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 — CH table schema + Lambda adapter
  • Internal: S3 bucket notification + IAM permissions for the bedrock environment role

Test plan

  • Verify the jq command correctly builds the enriched JSON
  • Verify S3 upload succeeds with appropriate IAM permissions
  • End-to-end: verdict appears in misc.autorevert_advisor_verdicts table

^ verified end-to-end on ciforge

@izaitsevfb izaitsevfb requested a review from a team as a code owner March 30, 2026 21:16
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Mar 30, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/178810

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 5064032 with merge base d0371b3 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added ci-no-td Do not run TD on this PR topic: not user facing topic category labels Mar 30, 2026
Adds a step to the advisor workflow that uploads the verdict JSON
(enriched with signal metadata) to S3 for ingestion into
misc.autorevert_advisor_verdicts via the clickhouse-replicator-s3
Lambda. This enables the autorevert lambda to read verdicts from CH
instead of downloading GitHub Actions artifacts.
@izaitsevfb izaitsevfb force-pushed the autorevert-advisor-s3-upload branch from f71e45c to 5064032 Compare March 30, 2026 23:39
@izaitsevfb
Copy link
Copy Markdown
Contributor Author

@pytorchbot merge -f 'lint passed'

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

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
pytorch-bot bot pushed a commit 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 to pytorch/test-infra 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants