Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Empty variable is defaulted to empty string #2499

Merged
merged 1 commit into from
Oct 5, 2021
Merged

Conversation

aravindanr
Copy link
Collaborator

Errors during variable replacement can fail the decide process and leave the workflow in a RUNNING state indefinitely

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Changes in this PR

ParametersUtils defaults ${} or ${ } to empty string.

…eplacement can fail the decide process and leave the workflow in a RUNNING state indefinitely
@aravindanr aravindanr added the type: bug bugs/ bug fixes label Oct 1, 2021
@aravindanr aravindanr requested a review from jxu-nflx October 1, 2021 19:48
@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2021

Unit Test Results

   154 files  ±0     154 suites  ±0   8m 9s ⏱️ ±0s
1 130 tests ±0  1 130 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 49f8882. ± Comparison against base commit 49f8882.

♻️ This comment has been updated with latest results.

@@ -203,12 +204,18 @@ private Object replaceList(List<?> values, String taskId, DocumentContext io) {
}

private Object replaceVariables(String paramString, DocumentContext documentContext, String taskId) {
String[] values = paramString.split("(?=(?<!\\$)\\$\\{)|(?<=\\})");
String[] values = paramString.split("(?=(?<!\\$)\\$\\{)|(?<=})");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a comment here for the regex?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would have been helpful. The original author did not include a comment, i merely removed the redundant escape character.

@aravindanr aravindanr merged commit 49f8882 into main Oct 5, 2021
@aravindanr aravindanr deleted the ignore_empty_variables branch October 5, 2021 00:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug bugs/ bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants