Skip to content

fix: restore experiment safety reviewer emails for proposal status actions - #1902

Open
mutambaraf wants to merge 2 commits into
developfrom
1747-fix-sra-emails
Open

mutambaraf wants to merge 2 commits into
developfrom
1747-fix-sra-emails

Conversation

@mutambaraf

@mutambaraf mutambaraf commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR restores the functionality to send experiment safety reviewer emails when proposal status actions occur.
Restores the EXPERIMENT_SAFETY_REVIEWERS case in the proposal status action email handler, which was dropped when the handlers were split into proposal and experiment email handler. Since then, proposal workflows set up to email "Experiment Safety" hit the default case: no email went out and nothing was written to the status action log, even with EXPERIMENT_SAFETY_REVIEW_EMAIL set.Emails now go to the EXPERIMENT_SAFETY_REVIEW_EMAIL address, either combined into one email or sent one per proposal with full proposal details, and the result is logged so status action replay works.

Motivation and Context

This change is required to ensure that the Experiment Safety team is kept informed about proposal status changes. This was previously missing, leading to a lack of communication and potential safety risks.

Changes

  1. A case for EXPERIMENT_SAFETY_REVIEWERS is added in the switch statement handling email recipients.
  2. The system fetches the experiment safety review email from settings. If not found, an error is logged and the process is terminated.
  3. Depending on whether emails are to be combined or not, the recipients are formatted and emails are sent out.
  4. If the emails are successfully sent, a success message is logged; otherwise, a failure message is logged.

How Has This Been Tested?

Fixes Jira Issue

UserOfficeProject/issue-tracker#1747

Depends On

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@mutambaraf
mutambaraf requested a review from a team as a code owner October 16, 2026 10:39
@mutambaraf
mutambaraf requested review from a team, EmmaHancock and martin-trajanovski and removed request for a team October 16, 2026 10:39

@simonfernandes simonfernandes left a comment

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 change looks fine, but I think the logic between the proposal handler and the experiment handler has diverged and I wonder if it's worth aligning

Experiment handler - Sends the email to users with the ESR role, but fails if the email setting doesn't exist (doesn't make sense)

Proposal handler - Just checks and sends to the email setting

Is it worth making both handlers prefer the setting and falling back to users with the role?

I missed the meeting the other day when I think this was discussed so sorry if it's already been covered.

@mutambaraf

mutambaraf commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

The change looks fine, but I think the logic between the proposal handler and the experiment handler has diverged and I wonder if it's worth aligning

Experiment handler - Sends the email to users with the ESR role, but fails if the email setting doesn't exist (doesn't make sense)

Proposal handler - Just checks and sends to the email setting

Is it worth making both handlers prefer the setting and falling back to users with the role?

I missed the meeting the other day when I think this was discussed so sorry if it's already been covered.

I think its okay as it is because they are different workflows one is for specifically Experiment Safe and the other is for proposal workflow. The one for proposal sent to only the set email and the other send to the set roles but for it to work there must be an attached work flow to the call. But maybe having different flags in the database.

This branch has not been deployed

No deployments
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