Skip to content

Notify submitter when checks fail or scoring run fails - #579

Closed
samwinebrake wants to merge 2 commits into
masterfrom
sw/add-bs-email-to-plugin-info
Closed

samwinebrake wants to merge 2 commits into
masterfrom
sw/add-bs-email-to-plugin-info

Conversation

@samwinebrake

Copy link
Copy Markdown
Collaborator

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.

@samwinebrake
samwinebrake marked this pull request as ready for review February 26, 2024 20:58
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'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@kvfairchild kvfairchild Feb 26, 2024 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/')"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants