Fix inputs trimming for variables #4940
Merged
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.
WI
AB#2195400
Problem
Currently inputs are trimmed only before variables expansion, which does not account for the case when a variable with, for example, a leading space is defined, and then is passed as a task input:
In the example above the target path input value will not be trimmed by the agent regardless of the
DISABLE_INPUT_TRIMMING
knob value.Solution
Added trimming for variables after the expansion. This new behavior is disabled by default and can be enabled by setting the
AGENT_ENABLE_VARIABLE_INPUT_TRIMMING
knob totrue
.