diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 6a786be4..40cb0160 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -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 diff --git a/.github/workflows/plugin_submission_orchestrator.yml b/.github/workflows/plugin_submission_orchestrator.yml index 85040232..bf0e7380 100644 --- a/.github/workflows/plugin_submission_orchestrator.yml +++ b/.github/workflows/plugin_submission_orchestrator.yml @@ -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 @@ -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" @@ -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 @@ -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, @@ -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) @@ -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 @@ -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 diff --git a/brainscore_language/submission/README.md b/brainscore_language/submission/README.md index 3418d206..fae62692 100644 --- a/brainscore_language/submission/README.md +++ b/brainscore_language/submission/README.md @@ -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. diff --git a/brainscore_language/submission/actions_helpers.py b/brainscore_language/submission/actions_helpers.py index 0ad3ac64..a8fb0c07 100644 --- a/brainscore_language/submission/actions_helpers.py +++ b/brainscore_language/submission/actions_helpers.py @@ -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) @@ -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)