Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ If metadata already exists and tests pass, adds the `submission_prepared` label.

**6. Post-Merge Kickoff** — Triggered by `pull_request_target` (merged). For plugin PRs: extracts submitter email (encrypted/decrypted with `EMAIL_ENCRYPTION_KEY`), builds plugin info JSON, and calls `call_jenkins_language()` to trigger the `core/job/score_plugins` Jenkins job. For metadata-only PRs: triggers `update_existing_metadata` Jenkins job.

**7. Notify on Failure** — Sends an email to the submitter when any job fails or tests don't pass. Extracts email using the same web/non-web logic as post-merge. Falls back to `mferg@mit.edu` if email lookup fails.
**7. Notify on Failure** — Sends an email to the submitter when any job fails or tests don't pass. Extracts email using the same web/non-web logic as post-merge. Falls back to `kpradeep@mit.edu` if email lookup fails.

## Workflow Flows

Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/plugin_submission_orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,17 @@ jobs:
echo "is_web_submission=true" >> $GITHUB_OUTPUT
USER_ID=$(echo "$PR_TITLE" | sed -E 's/.*\(user:([^)]+)\).*/\1/')
echo "user_id=${USER_ID}" >> $GITHUB_OUTPUT
echo "Extracted user_id from PR title (masked)"
# Extract size from PR title (default: small)
SIZE="small"
if echo "$PR_TITLE" | grep -qE '\(size:[^)]+\)'; then
SIZE=$(echo "$PR_TITLE" | sed -E 's/.*\(size:([^)]+)\).*/\1/')
fi
echo "size=${SIZE}" >> $GITHUB_OUTPUT
echo "Extracted user_id and size from PR title (masked)"
else
echo "is_web_submission=false" >> $GITHUB_OUTPUT
echo "user_id=2" >> $GITHUB_OUTPUT
echo "user_id=121" >> $GITHUB_OUTPUT
echo "size=small" >> $GITHUB_OUTPUT
fi

- name: Find PR author email for non-web submissions
Expand All @@ -852,7 +859,7 @@ jobs:
run: |
EMAIL="${{ steps.getemail.outputs.email }}"
if [ -z "$EMAIL" ] || [ "$EMAIL" = "null" ] || [ "$EMAIL" = "None" ]; then
EMAIL="mferg@mit.edu"
EMAIL="kpradeep@mit.edu"
echo "Could not find email for user ${{ github.event.pull_request.user.login }}, using default email" >&2
fi
echo "::add-mask::$EMAIL"
Expand Down Expand Up @@ -885,7 +892,7 @@ jobs:
BS_UID=$(echo "$PR_TITLE" | sed -E 's/.*\(user:([^)]+)\).*/\1/')
EMAIL=$(python -c "from brainscore_core.submission.database import email_from_uid; from brainscore_core.submission.endpoints import UserManager; import os; user_manager=UserManager(db_secret=os.environ['BSC_DATABASESECRET']); print(email_from_uid(int('$BS_UID')))" 2>/dev/null)
if [ -z "$EMAIL" ] || [ "$EMAIL" = "None" ]; then
EMAIL="mferg@mit.edu"
EMAIL="kpradeep@mit.edu"
echo "Could not find email in database for user $BS_UID, using default email" >&2
echo "::add-mask::$EMAIL"
fi
Expand Down Expand Up @@ -914,12 +921,14 @@ jobs:
PLUGIN_INFO_DECODED=$(echo "$PLUGIN_INFO_B64" | base64 -d)

USER_ID="${{ steps.check_web_submission.outputs.user_id }}"
SIZE="${{ steps.check_web_submission.outputs.size }}"
PLUGIN_INFO=$(echo "$PLUGIN_INFO_DECODED" | jq -c \
--arg domain "language" \
--arg email "${{ steps.extract_email.outputs.email }}" \
--arg plugin_dirs "${{ needs.detect_changes.outputs.plugin_dirs }}" \
--arg plugin_type "${{ needs.detect_changes.outputs.plugin_type }}" \
--arg user_id "$USER_ID" \
--arg size "$SIZE" \
--arg bsc_db_secret "${{ secrets.BSC_DATABASESECRET }}" \
'. + {
domain: $domain,
Expand All @@ -929,7 +938,8 @@ jobs:
competition: "None",
model_type: "artificialsubject",
public: true,
user_id: (if $user_id != "" then $user_id else "2" end),
user_id: (if $user_id != "" then $user_id else "121" end),
size: (if $size != "" then $size else "small" end),
BSC_DATABASESECRET: $bsc_db_secret
}')
# Store PLUGIN_INFO in GITHUB_ENV for next step (contains email - will be masked by GitHub Actions)
Expand Down Expand Up @@ -1144,7 +1154,7 @@ jobs:
run: |
EMAIL="${{ steps.getemail.outputs.email }}"
if [ -z "$EMAIL" ]; then
EMAIL="mferg@mit.edu"
EMAIL="kpradeep@mit.edu"
echo "Could not find email for user ${{ github.event.pull_request.user.login }}, using default email" >&2
echo "::add-mask::$EMAIL"
fi
Expand Down Expand Up @@ -1175,7 +1185,7 @@ jobs:
BS_UID=$(echo "$PR_TITLE" | sed -E 's/.*\(user:([^)]+)\).*/\1/')
EMAIL=$(python -c "from brainscore_core.submission.database import email_from_uid; from brainscore_core.submission.endpoints import UserManager; import os; user_manager=UserManager(db_secret=os.environ['BSC_DATABASESECRET']); print(email_from_uid(int('$BS_UID')))" 2>/dev/null)
if [ -z "$EMAIL" ] || [ "$EMAIL" = "None" ]; then
EMAIL="mferg@mit.edu"
EMAIL="kpradeep@mit.edu"
echo "Could not find email in database for user $BS_UID, using default email" >&2
echo "::add-mask::$EMAIL"
fi
Expand Down
2 changes: 1 addition & 1 deletion brainscore_language/submission/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ python actions_helpers.py trigger_update_existing_metadata \
Triggers Jenkins layer mapping job. Only used for non-language domains (language always has `needs_mapping=false`).

#### `extract_email`
Resolves submitter email. For web submissions, looks up email from Brain-Score user ID via database. For non-web submissions, tries GitHub API, then public events. Falls back to `mferg@mit.edu`.
Resolves submitter email. For web submissions, looks up email from Brain-Score user ID via database. For non-web submissions, tries GitHub API, then public events. Falls back to `kpradeep@mit.edu`.

#### `send_failure_email`
Sends a failure notification email via Gmail SMTP.
Expand Down
4 changes: 2 additions & 2 deletions brainscore_language/submission/actions_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def main():
email = email_from_uid(int(bs_uid))
if not email:
# Fallback to default email if database lookup returns no email
email = "mferg@mit.edu"
email = "kpradeep@mit.edu"
print(f"Could not find email in database for user {bs_uid}, using default: {email}", file=sys.stderr)
else:
print("Could not extract user ID from PR title", file=sys.stderr)
Expand All @@ -376,7 +376,7 @@ def main():
break
if not email:
# Fallback to default email if real email not found
email = "mferg@mit.edu"
email = "kpradeep@mit.edu"
print(f"Could not find email for user, using default Brain-Score submission (mferg): {email}", file=sys.stderr)

print(email)
Expand Down
Loading