suggest rebasing through @pytorchbot if PR is stale (#86898)

Summary:

Test Plan: Testing on GitHub with `stale_pr_days` set to zero.

Reviewers:

Subscribers:

Tasks:

Tags:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86898
Approved by: https://github.com/malfet
This commit is contained in:
Michael Andreas Dagitses
2022-10-13 06:14:21 -07:00
committed by PyTorch MergeBot
parent 8fffb79771
commit 77e68b16cc

View File

@ -1376,7 +1376,9 @@ def merge(pr_num: int, repo: GitRepo,
if (datetime.utcnow() - pr.last_pushed_at()).days > stale_pr_days:
if land_checks and not dry_run:
pr.delete_land_time_check_branch(repo)
raise RuntimeError("This PR is too stale; the last push date was more than 3 days ago. Please rebase and try again.")
raise RuntimeError(f"This PR is too stale; the last push date was more than {stale_pr_days} days ago. "
"Please rebase and try again. You can rebase by leaving the following comment on this PR:\n"
"`@pytorchbot rebase`")
start_time = time.time()
last_exception = ''