Skip to content

[autorevert] properly resolve github workflow names #7010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 14, 2025

Conversation

izaitsevfb
Copy link
Contributor

@izaitsevfb izaitsevfb commented Aug 13, 2025

Introduces WorkflowRestartChecker that resolves githb workflows name <-> display name. Uses it in the codebase instead of relying on naming convention (that apparently is not reliable, see lint.yml).

Testing

python -m unittest -v pytorch_auto_revert/tests/test_workflow_resolver.py

python -m unittest -v pytorch_auto_revert/tests/test_workflow_resolver.py
test_resolve_pull_workflow (pytorch_auto_revert.tests.test_workflow_resolver.TestWorkflowResolverRealRepo.test_resolve_pull_workflow) ... ok
test_resolve_trunk_workflow (pytorch_auto_revert.tests.test_workflow_resolver.TestWorkflowResolverRealRepo.test_resolve_trunk_workflow) ... ok

----------------------------------------------------------------------
Ran 2 tests in 3.369s

OK
python -m pytorch_auto_revert
Fetching commits for workflow(s) 'Lint, trunk, pull, inductor' (last 48h)...

Commit data by workflow:
Fetching workflow data for 4 workflows since 2025-08-11T13:40:22.263487...
Found 115 commits with job data for workflow 'Lint'
Found 113 commits with job data for workflow 'inductor'
Found 117 commits with job data for workflow 'pull'
Found 112 commits with job data for workflow 'trunk'
  Lint: 115 commits
  trunk: 112 commits
  pull: 117 commits
  inductor: 113 commits
✓ 2 AUTOREVERT PATTERNS DETECTED

Pattern #1:
Failure rule: 'Lintrunner failure'
Recent commits with failure: a3df3aa8 d3329604
Older commit without failure: 01bcf9a4
✗ NOT REVERTED: d3329604e2f2c5523c68003a1093ba31e4937d42 was not reverted
INFO:root:Successfully dispatched workflow Lint for commit d3329604e2f2c5523c68003a1093ba31e4937d42
  View at: https://github.com/pytorch/pytorch/actions/workflows/lint.yml?query=branch%3Atrunk%2Fd3329604e2f2c5523c68003a1093ba31e4937d42
  ✓ RESTARTED: Lint for d3329604
INFO:root:Successfully dispatched workflow Lint for commit 01bcf9a40dea937637d2cdd530bed2652510943d
  View at: https://github.com/pytorch/pytorch/actions/workflows/lint.yml?query=branch%3Atrunk%2F01bcf9a40dea937637d2cdd530bed2652510943d
  ✓ RESTARTED: Lint for 01bcf9a4
Failed jobs (1):
  - lintrunner-noclang / linux-job

Pattern #2:
Failure rule: 'pytest failure'
Recent commits with failure: 9708fcf9 a288b15e
Older commit without failure: d2d29707
✗ NOT REVERTED: a288b15ea9f87ddd665f249d492e0fb0861f5a69 was not reverted
  ⟳ ALREADY RESTARTED: pull for a288b15e
INFO:root:Successfully dispatched workflow pull for commit d2d2970734e0c3d241002f386bb8ca208e2594bb
  View at: https://github.com/pytorch/pytorch/actions/workflows/pull.yml?query=branch%3Atrunk%2Fd2d2970734e0c3d241002f386bb8ca208e2594bb
  ✓ RESTARTED: pull for d2d29707
Failed jobs (8):
  - linux-jammy-py3.9-gcc11 / test (distributed, 2, 2, linux.2xlarge)
  - linux-jammy-py3.9-clang12 / test (default, 1, 5, linux.4xlarge)
  - linux-jammy-py3.10-clang18-asan / test (default, 2, 6, linux.4xlarge)
  - linux-jammy-py3.10-clang18-asan / test (default, 3, 6, linux.4xlarge)
  - linux-jammy-py3.13-clang12 / test (crossref, 1, 2, linux.2xlarge)
  ... and 3 more

@pytorch-bot pytorch-bot bot added the ci-no-td label Aug 13, 2025
Copy link

vercel bot commented Aug 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Project Deployment Preview Updated (UTC)
torchci ⬜️ Ignored Preview Aug 14, 2025 1:46pm

@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 Aug 13, 2025
@izaitsevfb izaitsevfb force-pushed the autorevert-workflow-name-resolver branch from 8d3ccf8 to 00aae87 Compare August 13, 2025 20:43
@jeanschmidt jeanschmidt merged commit 6e6d9c8 into main Aug 14, 2025
2 of 4 checks passed
@jeanschmidt jeanschmidt deleted the autorevert-workflow-name-resolver branch August 14, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-no-td 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.

2 participants