treat nil variableMap as empty so no-input tasks can launch - #7722
Merged
Conversation
Signed-off-by: Carina Ursu <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the dataproxy JSON→Literal conversion behavior to support tasks with no declared inputs by treating a nil VariableMap as an empty input interface, preventing an unnecessary invalid-argument failure during launch-form conversions.
Changes:
- Update
JSONValuesToLiteralsto treatnilvariableMapas empty instead of returning an error. - Align inline documentation to reflect that unmapped fields are ignored and debug-logged (matching the current
logger.Debugfbehavior). - Update unit tests to assert the new behavior for
nil variableMap(empty payload and payload with only unmapped values).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
dataproxy/converter/literal_json_converter.go |
Treats nil input VariableMap as empty and clarifies logging semantics for unmapped fields. |
dataproxy/converter/literal_json_converter_test.go |
Updates tests to validate that nil variableMap yields no literals and no error. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ursucarina
enabled auto-merge (squash)
July 28, 2026 20:54
pingsutw
approved these changes
Jul 28, 2026
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.
Why are the changes needed?
JSONValuesToLiterals errored with variableMap cannot be nil when passed a nil variableMap. That happens legitimately for a task with no declared inputs — its interface.inputs is unset, so callers (e.g. the launch form converting form values back to literals) pass a nil map. There are no expected inputs in that case, so it should produce zero literals rather than fail.
What changes were proposed in this pull request?
In JSONValuesToLiterals, treat a nil variableMap as an empty one instead of erroring. An empty payload yields no literals, and any provided values are unmapped and ignored (debug-logged), consistent with the existing unmapped-field handling.
How was this patch tested?
go test ./dataproxy/converter/... — passing. Updated the nil-variableMap test to assert an empty result with no error (both an empty payload and a payload whose values have no matching variable).
Labels
fixed
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Stack
If you do use
git townto manage PR Stacks, the stack relevant to this PRwill show below. Otherwise, you can ignore this section.
Docs link