Repository navigation
Notify submitter when checks fail or scoring run fails - #579
samwinebrake wants to merge 2 commits into
Conversation
| name: Notify PR Submitter of Test Failure | ||
| runs-on: ubuntu-latest | ||
| needs: [check_test_results] | ||
| if: needs.check_test_results.outputs.ALL_TESTS_PASS != 'True' |
There was a problem hiding this comment.
This job (check_if_pr_is_automergeable) is triggered on all check_run and status events, and ALL_TESTS_PASS is only set to true after ALL pass, so current behavior is going to result in large volumes of failure notifications -- even if the submission ultimately does in fact pass all tests.
One solution would be to either add to or modify existing methods in brainscore_vision/submission/actions_helpers.py to check if all tests have run and if any results are not passing, notify the user with a single failure summary.
| run: | | ||
| echo "The PR author email is ${{ steps.getemail.outputs.email }}" | ||
| echo "PLUGIN_INFO=$(<<<$PLUGIN_INFO tr -d "'" | jq -c '. + {author_email: "${{ steps.getemail.outputs.email }}"}')" >> $GITHUB_OUTPUT | ||
| echo "PLUGIN_INFO=$(<<<$PLUGIN_INFO jq -c '. + {email: "${{ steps.getemail.outputs.email }}"}')" >> $GITHUB_ENV |
There was a problem hiding this comment.
Have you checked that this works? IIRC (could be wrong) PLUGIN_INFO isn't proper JSON at this stage; if not, jq won't work here.
| needs: [process_submission] | ||
| if: needs.process_submission.outputs.RUN_SCORING == 'True' | ||
| env: | ||
| PLUGIN_INFO: ${{ needs.get_submitter_info.outputs.PLUGIN_INFO }} |
There was a problem hiding this comment.
| PLUGIN_INFO: ${{ needs.get_submitter_info.outputs.PLUGIN_INFO }} | |
| PLUGIN_INFO: ${{ needs.process_submission.outputs.PLUGIN_INFO }} |
| run: | | ||
| echo "The PR author email is ${{ steps.getemail.outputs.email }}" | ||
| echo "PLUGIN_INFO=$(<<<$PLUGIN_INFO tr -d "'" | jq -c '. + {author_email: "${{ steps.getemail.outputs.email }}"}')" >> $GITHUB_OUTPUT | ||
| echo "PLUGIN_INFO=$(<<<$PLUGIN_INFO jq -c '. + {email: "${{ steps.getemail.outputs.email }}"}')" >> $GITHUB_ENV |
There was a problem hiding this comment.
I think GITHUB_ENV only carries between steps but not jobs, so you may in fact need GITHUB_OUTPUT to get PLUGIN_INFO to run_scoring.
| @@ -59,42 +59,33 @@ jobs: | |||
| run: | | |||
| echo "RUN_SCORING=$(jq -r '.run_score' <<< ${{ steps.getpluginfo.outputs.PLUGIN_INFO }})" >> $GITHUB_OUTPUT | |||
There was a problem hiding this comment.
If these two jobs (changes_models_or_benchmarks and get_submitter_info) are being combined, then $GITHUB_OUTPUT should instead be $GITHUB_ENV
| if: contains(github.event.pull_request.labels.*.name, 'automerge-web') && env.RUN_SCORING == 'True' | ||
| run: | | ||
| BS_UID="$(echo '${{ github.event.pull_request.title }}' | sed -E 's/.*\(user:([^)]+)\).*/\1/')" | ||
| BS_PUBLIC="$(echo '${{ github.event.pull_request.title }}' | sed -E 's/.*\(public:([^)]+)\).*/\1/')" |
There was a problem hiding this comment.
The extraction and addition of BS_PUBLIC should either be properly documented or be moved into its own step for clarity; it doesn't relate to parsing user IDs or fetching email for web submissions
Currently, users w/ plugin web submissions are not being properly notified when their submissions fail.
This PR allows for users to be emailed based on the brain-score uid tied to the web submission, or the author email of a non web submission PR. Also, now when initial checks fail on web submissions, users will be emailed with a link to their failing PR.
Closes issue #80 in brain-score core.