pytorch
1d4dbdce - [mergebot] Fix Land Checks validation (#80907)

Commit
2 years ago
[mergebot] Fix Land Checks validation (#80907) Before, it was landing it because at the beginning there's no checks queued and it was checking the length of the object. Test Plan: Tested it with a land check commit (Both Success and Fail): ``` (base) kerryz@kerryz-mbp pytorch % /Users/kerryz/miniconda3/bin/python /Users/kerryz/pytorch/.github/scripts/testtrymerge.py (base) kerryz@kerryz-mbp pytorch % /Users/kerryz/miniconda3/bin/python /Users/kerryz/pytorch/.github/scripts/testtrymerge.py Traceback (most recent call last): File "/Users/kerryz/pytorch/.github/scripts/testtrymerge.py", line 14, in <module> validate_land_time_checks(repo, "fc636aa0c359ebee9a70527534007f8ac37ba501") File "/Users/kerryz/pytorch/.github/scripts/trymerge.py", line 1007, in validate_land_time_checks raise MandatoryChecksMissingError(f"Refusing to merge as land check(s) {checks_to_str(pending_checks)} are not yet run") trymerge.MandatoryChecksMissingError: Refusing to merge as land check(s) [macos-11-py3-x86-64 / test (default, 1, 2, macos-12)](https://github.com/pytorch/pytorch/runs/7202200731?check_suite_focus=true), [linux-bionic-cuda10.2-py3.9-gcc7 / test (slow, 1, 1, linux.4xlarge.nvidia.gpu)](https://github.com/pytorch/pytorch/runs/7201784661?check_suite_focus=true), [linux-bionic-cuda10.2-py3.9-gcc7 / test (default, 1, 2, linux.4xlarge.nvidia.gpu)](https://github.com/pytorch/pytorch/runs/7201784432?check_suite_focus=true) are not yet run ``` Tested it with a normal commit that doesn't have any checks associated with it: ``` (base) kerryz@kerryz-mbp pytorch % /Users/kerryz/miniconda3/bin/python /Users/kerryz/pytorch/.github/scripts/testtrymerge.py Traceback (most recent call last): File "/Users/kerryz/pytorch/.github/scripts/testtrymerge.py", line 14, in <module> validate_land_time_checks(repo, "d46f36a3ea227b756bd82901948d8ac203435e46") File "/Users/kerryz/pytorch/.github/scripts/trymerge.py", line 1001, in validate_land_time_checks checks = fetch_check_run_conclusions(repo, commit) File "/Users/kerryz/pytorch/.github/scripts/trymerge.py", line 994, in fetch_check_run_conclusions raise MandatoryChecksMissingError("Refusing to merge as land check(s) are not yet run") trymerge.MandatoryChecksMissingError: Refusing to merge as land check(s) are not yet run ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/80907 Approved by: https://github.com/janeyx99
Author
Committer
Parents
Loading