Commit Graph

15 Commits

Author SHA1 Message Date
Nikita Shulga
af13797c8f [GHF] Exclude 5f37e5c2a39c3acb776756a17730b865f0953432 from sync
Corresponding trunk commit generate different patch-id, as history
diverged between `master` and `fbsync`

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76048
Approved by: https://github.com/seemethere
2022-04-19 16:35:57 +00:00
Nikita Shulga
b582472ac3 [GHF] Fix sync-branches
Manually skip 8e09e20c1dafcdbdb45c2d1574da68a32e54a3a5 which introduces
unstable patch-ids

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75971
Approved by: https://github.com/janeyx99
2022-04-18 16:09:36 +00:00
Jon Janzen
6cdc6dd8e5 [pytorch][require export] Create smartplatform configuration for trymerge (#75542)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/75542

Reviewed By: malfet

Differential Revision: D35513051

fbshipit-source-id: adf59359fcf2410fa8a61746533c896ec22d5ed3
(cherry picked from commit ab65394c6f88f17bdc317dbcfb931cc16e527eef)
2022-04-11 16:10:33 +00:00
Nikita Shulga
3b1c085613 Fix duplicate commit logic in syncbranches (#75384)
Summary:
Regression introduced by caa403083b

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75384

Reviewed By: osalpekar

Differential Revision: D35451233

Pulled By: malfet

fbshipit-source-id: bbe81d2138a14337e1702f53a609c03c1fef3e91
(cherry picked from commit 7129435c86722d672cf749017370d2738ac3b8f8)
2022-04-06 23:28:54 +00:00
Nikita Shulga
caa403083b [GHA] Small updates to syncbranches.yml
Make it accept origin environment variable
Add explicit skip for 0a6a1b27a4 as its a rare case of same commit landed/reverted twice

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75209
Approved by: https://github.com/atalman, https://github.com/bigfootjon
2022-04-04 19:20:37 +00:00
Nikita Shulga
70588ccddc [GHF] Rebase and retry push if fails
This fixes a pretty frequently occurring race condition when two
workflows are running concurrently

Resolve this by fetching latest branch and rebating proposed changes on
top of it

Test plan: Simulate the behavior in https://github.com/malfet/deleteme

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/74382
Approved by: https://github.com/seemethere, https://github.com/bigfootjon
2022-03-17 20:45:49 +00:00
Nikita Shulga
0c95209fe7 [GH1] Enable cross-repo merges
GHStack based PRs still can not be cross-repo, but for regular ones
checkout `pull/{pr_no}/head`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/72750
2022-02-11 22:49:47 +00:00
Nikita Shulga
3b9f2e2cca [GHF] More verbose failures messages (#71941)
Summary:
Modify _check_output to capture `CalledProcessError` and add
stdout/stderr to the failure message
Also record github actions run id in the failure message (calculated based on `${{ github.run_id}}`)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71941

Reviewed By: seemethere

Differential Revision: D33829633

Pulled By: malfet

fbshipit-source-id: 060b2856ca6c71574075effa72b982f9e1d64e6e
(cherry picked from commit a9ad7df9b5)
2022-01-27 23:49:58 +00:00
Nikita Shulga
5bd33247ec [GHF] Add revert workflow
This adds `try_revert` repository dispatch that will revert commit
that were previously landed by merge workflow if requested by org member

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71868
2022-01-26 22:35:02 +00:00
Eli Uriegas
9adee84a3f .github: Improve syncbranch debugability (#71596)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71596

Adds a dry_run to test out push as well as adding in a debug flag to
allow you to see what git commands are running

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>

Test Plan: Imported from OSS

Reviewed By: malfet, bigfootjon

Differential Revision: D33695224

Pulled By: seemethere

fbshipit-source-id: 03bf6a3f2d9594089e134d95c3d35a6779ba7a26
(cherry picked from commit a75a402f9d)
2022-01-20 23:53:02 +00:00
Nikita Shulga
bc608b6e16 Add gitutils tests (#71580)
Summary:
Test PeekableIterator behavior

Add `.github/scripts/test_*.py` to list of tests run by test_tools
workflow and pin Python version to 3.7 in test_tools workflow

Change PeekableIterator inheritance from collections.abc.Iterator, to
typing.Iterator, which is a correct alias starting from Python-3.7

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71580

Reviewed By: bigfootjon

Differential Revision: D33690659

Pulled By: malfet

fbshipit-source-id: 71f270b15138230772e2eed0da66cdfcb34825cc
(cherry picked from commit 42abb07396)
2022-01-20 14:33:41 -08:00
Nikita Shulga
42f7afc4cd [BE] Improve gitutils
Inherit `PeekableIterator` from `collections.abc.Iterator`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71515
2022-01-20 17:07:06 +00:00
Nikita Shulga
61713acb07 Add trymerge workflow (#71488)
Summary:
This one, will react to `repo_dispatch` event sent by PyTorch Probot
when `pytorchbot merge this` command is issued

At the moment, workflow will only attempt to merge PRs which has not
been created from forked repo and that match rules defined in
`.github/merge_rules.json`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71488

Reviewed By: bigfootjon

Differential Revision: D33665142

Pulled By: malfet

fbshipit-source-id: e22daa1892523e62d7b7a941960636a6514cb7d7
(cherry picked from commit 92059bab07)
2022-01-19 23:11:48 +00:00
Nikita Shulga
ff8fb717db Fix get_git_repo_dir (#71448)
Summary:
Otherwise, rev-list will only pick-up commits in `.github` repo

Before:
```
% git -C .github rev-list 1eb6146d967b2d09af37c54af411d03f0b790209..1ff7f65cc1ad499a71457368894ca14bed069749 -- .
598b55fd18
ae089d6bdf
```
After
```
% git -C . rev-list 1eb6146d967b2d09af37c54af411d03f0b790209..1ff7f65cc1ad499a71457368894ca14bed069749 -- .
1ff7f65cc1
2ac58b0dc1
598b55fd18
55899528a2
ae089d6bdf
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71448

Reviewed By: seemethere, atalman

Differential Revision: D33644256

Pulled By: malfet

fbshipit-source-id: fa2e06f6767e7702af6ce85471aea07fa58292c0
(cherry picked from commit 594cecc0e1)
2022-01-18 22:12:41 +00:00
Nikita Shulga
5243986df6 Update syncbranches workflow (#71420)
Summary:
Use `pytorchmergebot` credentials to do the merge
Infer sync branch name from the workflow rather than hardcode it
Move common functions from `syncbranches.py` to `gitutils.py`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71420

Reviewed By: bigfootjon

Differential Revision: D33638846

Pulled By: malfet

fbshipit-source-id: a568fd9ca04f4f142a7f5f64363e9516f5f4ef1c
2022-01-18 11:31:57 -08:00