pytorch/.github
Sam Estep f3367f917e Translate annotation line numbers from merge to head (#55569)
Summary:
This PR

- adds a `tools/translate_annotations.py` script that
  - parses annotations into JSON using the regexes that we were previously passing to [`pytorch/add-annotations-github-action`](https://github.com/pytorch/add-annotations-github-action) and
  - uses `git diff-index` to translate the line numbers for those annotations from the PR `merge` onto the PR `head`, since (as of https://github.com/pytorch/pytorch/issues/54967) we now run CI on the former instead of the latter;
- modifies the `flake8-py3` and `clang-tidy` jobs to use that script and thus upload JSON in their artifacts instead of raw text; and
- modifies the "Add annotations" workflow to specify `mode: json` to allow it to use those preprocessed annotations.

Depends on https://github.com/pytorch/add-annotations-github-action/pull/18.

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

Test Plan:
You can run the unit tests with this command:
```
python tools/test/test_translate_annotations.py
```
I also tested the entire system together in my personal sandbox repo.

Reviewed By: malfet

Differential Revision: D27662161

Pulled By: samestep

fbshipit-source-id: ecca51b79b9cf00c90fd89f0d41d0c7b89d69c63
2021-04-09 11:12:40 -07:00
..
ISSUE_TEMPLATE
scripts Add code to ensure workflow consistency for autocanceling (#55171) 2021-04-01 14:11:32 -07:00
workflows Translate annotation line numbers from merge to head (#55569) 2021-04-09 11:12:40 -07:00
ISSUE_TEMPLATE.md
PULL_REQUEST_TEMPLATE.md Update PULL_REQUEST_TEMPLATE.md (#41812) 2020-07-23 21:30:43 -07:00
pytorch-circleci-labels.yml .circleci: Add option to not run build workflow (#50162) 2021-01-06 15:42:17 -08:00
pytorch-probot.yml
scale-config.yml .github: Add scale-config.yml (#55315) 2021-04-05 12:49:09 -07:00