Conversation
Changed mail> operator's to, cc, and bcc parameters to support
embedding array variables like ${address_list}.
Changes:
- Use parseList() instead of getList() for 'to' parameter
- Use parseListOrGetEmpty() instead of getListOrEmpty() for 'cc' and 'bcc'
The parseList methods evaluate variable expressions before falling back
to regular list parsing, enabling users to pass array variables.
Added test cases:
- sendToWithArrayVariable()
- sendCcWithArrayVariable()
- sendBccWithArrayVariable()
Fixes WM-2763
Related to WM-2579
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The previous tests used ${address_list} as literal strings, which didn't
properly demonstrate how the parseList fix works. Updated tests now use
JSON string representations like ["a@ex.com", "b@ex.com"] which correctly
simulates what happens after Digdag's template engine processes variables.
This matches the pattern used in Config.verifyParseList() test and clearly
demonstrates that parseList can handle JSON strings while getList cannot.
Added detailed comments explaining the variable substitution process.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Summary
to,cc, andbccparameters of themail>operatorto: ${address_list}whereaddress_listis an arrayProblem
When users write YAML like this:
The template engine replaces
${address_list}with its JSON representation as a string:to: '["aaa@example.com", "bbb@example.com"]'The old code using
getList()expected an already-parsed array and failed on JSON strings.Solution
Changed to use
parseList()andparseListOrGetEmpty()which:This approach is already used by the
for_each>operator for the same purpose.Changes
getList()toparseList()for thetoparametergetListOrEmpty()toparseListOrGetEmpty()forccandbccparametersTest Plan
sendToWithArrayVariable()test - verifies JSON string parsing fortoparametersendCcWithArrayVariable()test - verifies JSON string parsing forccparametersendBccWithArrayVariable()test - verifies JSON string parsing forbccparameterConfigTest.verifyParseList()Verification
The fix is verified by:
Config.verifyParseList()test demonstratesparseListhandles JSON stringsparseListcallstryParseNestedwhich parses textual JSON