[SAFE-EMAIL-TEST-REDUX-1] route testRunMetadata to action testRun handlers#1674
Open
ogp-weeloong wants to merge 1 commit into
Open
Conversation
This was referenced Jun 4, 2026
Contributor
Author
4d5fe13 to
a5d34ab
Compare
processAction already passes its `metadata` option to both actionCommand.run
and actionCommand.testRun, but test-step.ts never populated that field for
the action path — so testRun handlers always received {}. Forward
options.testRunMetadata as `metadata` so actions can read it.
Safe because metadata's two callers are mutually exclusive: for-each
iteration state is only set during non-test runs (enqueueFirstForEachStep
is gated on !testRun), so the field is free during test runs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
currently this doesn't need to be a separate PR but it's cos it had more lines last time before I simplified this |
a5d34ab to
29c6bc9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
We always send test email to the pipe owner. However, they may have valid use case to send a test email to the configured recipient (e.g. people with multiple emails). We should support this.
Approach
We will reuse FormSG's approach to pass test run metadata to the backend.
useConfiguredEmailstest step metadata to backend. This defaults tofalse.useConfiguredEmails === true, the test run handler will send test email To/Cc configured in the pipe. Otherwise it always sends to the pipe owner.This PR
testRunMetadatato actions (since it's only used for triggers now)Tests
Regression tests only for now; next PR will update postman to use this.