Skip to content

Conversation

@samestep
Copy link
Contributor

@samestep samestep commented Mar 26, 2021

We've been using pytorch/add-annotations-github-action to add annotations to PRs when they fail Flake8 or clang-tidy. Up until now, though, that functionality has only worked on PRs in pytorch/pytorch itself, not on PRs from forks. This PR fixes that using a technique from this GitHub blog post (also linked in a comment in this diff).

Test plan:

@janeyx99 and I tested this in the same GitHub repo used to test #54685 and #54693, including with PRs from forks.

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Mar 26, 2021

💊 CI failures summary and remediations

As of commit 1c310e0 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

@samestep samestep marked this pull request as ready for review March 26, 2021 17:07
@facebook-github-bot
Copy link
Contributor

@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@samestep samestep requested a review from a team March 26, 2021 17:07
@facebook-github-bot
Copy link
Contributor

@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@walterddr walterddr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

- name: Add annotations
uses: pytorch/add-annotations-github-action@master
flake8 | tee ${GITHUB_WORKSPACE}/flake8-output/warnings.txt
- name: Upload artifact
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering did we measure the impact of these artifacts upload in terms of performance/overall CI time? clang-tidy can get huge

Copy link
Contributor Author

@samestep samestep Mar 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good question; the clang-tidy artifacts uploaded on the workflows for this PR have been only 1.29 KB, but idk what happens when there are actual warnings

@codecov
Copy link

codecov bot commented Mar 27, 2021

Codecov Report

Merging #54779 (ef30b9a) into master (d490e01) will increase coverage by 0.01%.
The diff coverage is n/a.

❗ Current head ef30b9a differs from pull request most recent head 1c310e0. Consider uploading reports for the commit 1c310e0 to get more accurate results

@@            Coverage Diff             @@
##           master   #54779      +/-   ##
==========================================
+ Coverage   77.43%   77.45%   +0.01%     
==========================================
  Files        1893     1894       +1     
  Lines      186424   186403      -21     
==========================================
+ Hits       144353   144374      +21     
+ Misses      42071    42029      -42     

@facebook-github-bot
Copy link
Contributor

@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@samestep merged this pull request in 56f12e6.

@samestep samestep deleted the add-annotations-on-forked-pulls branch March 29, 2021 18:48
@samestep
Copy link
Contributor Author

Reverting because apparently this is running on master, which is not supposed to do.

@samestep samestep restored the add-annotations-on-forked-pulls branch March 29, 2021 18:52
@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by ec1bbe1.

@facebook-github-bot
Copy link
Contributor

@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@samestep samestep changed the title Add annotations to PRs from forks [reland] Add annotations to PRs from forks Mar 31, 2021
@samestep samestep deleted the add-annotations-on-forked-pulls branch March 31, 2021 18:07
facebook-github-bot pushed a commit that referenced this pull request Apr 2, 2021
Summary:
#54779 split out the logic from our "Lint" workflow into a separate workflow that allows us to annotate PRs from forks. However, as of #54689, it is possible for the "Lint" workflow to be canceled, in which case it may not upload the "flake8-py3" and "clang-tidy" artifacts that the "Add annotations" workflow expects. This often results in GitHub pointlessly sending notification emails due to the failure in the "Add annotations" workflow. This PR fixes the issue by gracefully handling the case where the expected artifact is absent.

Pull Request resolved: #55242

Test Plan: I tested this in the same external sandbox repo used to test #54779.

Reviewed By: malfet

Differential Revision: D27540120

Pulled By: samestep

fbshipit-source-id: 47cc02950edbbc6381033bda2fe4570cb3e331cb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants