Skip to content

Commit

Permalink
Fix: Netflix#3876 Update task utils: removeIterationFromTaskRefName
Browse files Browse the repository at this point in the history
Parsing name is not considering task ref name with double underscores

- This is not fully fixing the use of this function. There needs to be some kind of validation against the user from setting up the taskRefName with double underscore
  • Loading branch information
appunni-m committed Dec 3, 2023
1 parent 41d4334 commit eeca96a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public static String getLoopOverTaskRefNameSuffix(int iteration) {

public static String removeIterationFromTaskRefName(String referenceTaskName) {
String[] tokens = referenceTaskName.split(TaskUtils.LOOP_TASK_DELIMITER);
return tokens.length > 0 ? tokens[0] : referenceTaskName;
int length = tokens.length;
return length > 1 ? String.join(
TaskUtils.LOOP_TASK_DELIMITER,
Arrays.copyOf(tokens, length - 1)
) : referenceTaskName;
}
}

0 comments on commit eeca96a

Please sign in to comment.