You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Summary
Adds workflow restart capability to the PyTorch auto-revert tool,
enabling automatic re-running of workflows for commits that match
autorevert patterns but haven't been reverted yet.
### Changes
- Added restart methods to WorkflowRestartChecker:
- restart_workflow(): Restarts a workflow for a specific commit with
duplicate prevention
- Checks ClickHouse for existing restarts before attempting
- Enhanced autorevert-checker command:
- Added --do-restart flag to enable automatic workflow restarts
- Added --dry-run flag to preview restart actions without execution
- Restarts workflows only for non-reverted commits matching autorevert
patterns
- Fixed workflow naming consistency:
- Normalized workflow names by removing .yml extension for ClickHouse
queries
- Added .yml extension only for GitHub API calls
- Updated do-restart command:
- Now requires commit SHA (removed unused restart_latest_workflow)
- Leverages same restart logic with duplicate prevention
### Usage
```
# Check patterns and restart workflows
python -m pytorch_auto_revert autorevert-checker pull trunk --do-restart
# Dry run to preview restarts
python -m pytorch_auto_revert autorevert-checker pull trunk --do-restart --dry-run
# Manual restart
python -m pytorch_auto_revert do-restart trunk abc123def
```
### Testing
```
python -m pytorch_auto_revert autorevert-checker inductor --hours 12 --do-restart --dry-run
Fetching workflow data for 1 workflows since 2025-07-30T22:47:17.357776...
Found 19 commits with job data for workflow 'inductor'
✓ 1 AUTOREVERT PATTERN DETECTED
Pattern #1:
Failure rule: 'GHA error'
Recent commits with failure: f89c28cc 5b2ad927
Older commit without failure: 7a4167a1
✗ NOT REVERTED: 5b2ad9279cb2e440d45253d28f2101a75fd42344 was not reverted
⟳ ALREADY RESTARTED: inductor for 5b2ad927
==================================================
SUMMARY STATISTICS
==================================================
Workflow(s): inductor
Timeframe: 12 hours
Commits checked: 19
Auto revert patterns detected: 1
Actual reverts inside auto revert patterns detected (precision): 0 (0.0%)
Total revert commits in period: 0
Total reverts excluding ghfirst: 0
No non-ghfirst reverts found in the period
Per workflow precision:
inductor: 0 reverts out of 1 patterns (0.0%) [excluding ghfirst: 0 (0.0%)]
```
0 commit comments