Huy Do
893983e59f
Use GitHub REST API to get the merge base commit SHA ( #105098 )
...
Fixes https://github.com/pytorch/pytorch/issues/104713
### Testing
Manual testing locally using #104121 and confirm that the correct merge base commit is returned [803c14490b ](1cb87771c1 ) instead of the wrong value provided by `baseRefOid` (de7b6e55eb ). Here is the JSON output of the GraphQL query for PR info https://paste.sh/TJ-QQWz4#fvE3Y6qoJ8vDkRBZ3vowkZ3m
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105098
Approved by: https://github.com/malfet
2023-07-14 04:25:45 +00:00
Nikita Shulga
3e9eaa1a12
[GHF] Fix regression
...
Introduced by https://github.com/pytorch/pytorch/pull/103679
That was not covered by tests :(
Discovered while looking at https://github.com/pytorch/pytorch/actions/runs/5281833681/jobs/9555936751#step:5:24
Locally tested by running `python -c "from trymerge import gh_get_pr_info;print(gh_get_pr_info('pytorch', 'pytorch', 103685)['author'])"`
2023-06-15 10:48:58 -07:00
Nikita Shulga
7b5f8988a2
[GHF] Auth when trying to fetch labels ( #103679 )
...
There were few merge bot failures reported recently due to HTTP/403 error:
- https://github.com/pytorch/pytorch/actions/runs/5269083146/jobs/9526693976#step:6:80
- https://github.com/pytorch/pytorch/actions/runs/5272750075/jobs/9535376256#step:6:93
Which likely stems from the fact that `_fetch_url` method did not try to pass the auth token even when it was available and as result was rate-limited to 60 requests per hour, according to [Resources in the REST API](https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limit-headers )
Refactor `gh_fetch_url` into `gh_fetch_url_and_headers` and use it from `request_for_labels` to utilize auth token, if available, which bumps rate limit to 1000 per hour as well as print more actionable message when rate limit is exceeded.
<!--
copilot:poem
-->
### <samp>🤖 Generated by Copilot at 499b805</samp>
> _`gh_fetch_url` splits_
> _returns headers and body_
> _wrapper function_
Pull Request resolved: https://github.com/pytorch/pytorch/pull/103679
Approved by: https://github.com/jeanschmidt , https://github.com/kit1980
2023-06-15 17:03:55 +00:00
Catherine Lee
331ed5bee7
Add comment link to revert message ( #100276 )
...
* add comment url/link to revert message for easier tracking
* update gql mocks accordingly, not sure why databaseid in checkruns got updated as well
Pull Request resolved: https://github.com/pytorch/pytorch/pull/100276
Approved by: https://github.com/huydhn
2023-04-28 22:41:29 +00:00
PaliC
d06662fb57
Add ephemeral merging label ( #98543 )
...
Addresses https://github.com/pytorch/test-infra/issues/3950
Test Plan: Ran a dry run on this pr. The label showed up while trying to merge
<img width="354" alt="Screenshot 2023-04-06 at 4 57 48 PM" src="https://user-images.githubusercontent.com/13758638/230514276-1ac70b58-d2d1-4e4b-892b-a957bf156063.png ">
And then disappeared after failing
<img width="373" alt="Screenshot 2023-04-06 at 5 00 11 PM" src="https://user-images.githubusercontent.com/13758638/230514470-38b15ec7-cfd9-4efe-b6e8-0f9af5577c62.png ">
There's also the trail of adding and removing the "merging" label at the bottom
Notes: This is slightly buggy sometimes. For example when the merge failed when I was editing this textbox, the label did not disappear.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/98543
Approved by: https://github.com/malfet
2023-04-07 08:24:54 +00:00
Huy Do
4c0dce50fd
[BE] Apply ufmt to run_test and GitHub Python util scripts ( #97588 )
...
This has been bugging me for a while as I'm working on these Python scripts and they are not tracked by ufmt linter. So I add these script into that linter.
```
[[linter]]
code = 'UFMT'
include_patterns = [
'.github/**/*.py',
'test/run_test.py',
```
This change should just work and not break anything as ufmt (black + usort) linter is very safe to use for standalone util scripts.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97588
Approved by: https://github.com/kit1980
2023-03-26 04:52:55 +00:00
Ning Xu
5ba4dafccd
Retry Merge: extract utils from check labels ptr ( #94899 )
...
Fixes #88098
This is the rebased and retry merging branch of the reverted PR: https://github.com/pytorch/pytorch/pull/94597
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94899
Approved by: https://github.com/kit1980
2023-03-01 20:40:30 +00:00
PyTorch MergeBot
7c3fc2c7f0
Revert "Issue-88098: extract utils from check labels ( #94597 )"
...
This reverts commit 2c76838d7f .
Reverted https://github.com/pytorch/pytorch/pull/94597 on behalf of https://github.com/jeanschmidt due to reverting due internal breakages https://fburl.com/sandcastle/3ukij9xp
2023-02-13 20:19:50 +00:00
Ning Xu
2c76838d7f
Issue-88098: extract utils from check labels ( #94597 )
...
Fixes #88098
This is a mirror of the same PR (https://github.com/Goldspear/pytorch/pull/2 ) that has been reviewed in my fork (due to it's a stacked PR).
======================
## Context
This is the 2nd of the 3 PRs to address issue-88098.
## What Changed
1. Extract comment related utils from trymerge.py to github_utils.py
2. Extract label related utils from trymerge.py and check_labels.py to label_utils.py
## Tests
* pytorch-dummy repo [trymerge run ](https://github.com/Goldspear/pytorch-dummy/actions/runs/4118944174 )merged the test PR [OK](https://github.com/Goldspear/pytorch-dummy/pull/2 ).
## Note to Reviewers
Due to higher degree of complexity involved to extract GitHubPR class, it's worth having a separate issue to handle that part of refactoring. This issue only focusing on refactoring where necessary to ship the functional diff.
* 1st PR: https://github.com/pytorch/pytorch/pull/94179
* 2nd PR: this one
* 3rd PR: https://github.com/Goldspear/pytorch/pull/3
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94597
Approved by: https://github.com/ZainRizvi
2023-02-12 12:18:53 +00:00