From 82046fa03133b5d5f1bdcaf33b0ba56881a18a07 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Thu, 24 Oct 2024 10:08:35 +0200 Subject: [PATCH] sast-unicode-check: make the task work with default params Before this change, the `sast-unicode-check` was failing with the default parameters because the script was passing the whole list of arguments as a single argument: ``` + mapfile -t fuc_args + LANG=en_US.utf8 + ./find-unicode-control/find_unicode_control.py '-p bidi -v -d -t' /var/workdir/source + FUC_EXIT_CODE=2 + [[ 2 -ne 0 ]] + [[ 2 -ne 1 ]] + echo 'Failed to run find-unicode-control command' Failed to run find-unicode-control command + cat raw_sast_unicode_check_out.log usage: find_unicode_control.py [-h] [-p {all,bidi}] [-v] [-d] [-t] [-c CONFIG] path [path ...] find_unicode_control.py: error: argument -p/--nonprint: invalid choice: ' bidi -v -d -t' (choose from 'all', 'bidi') + note='Task sast-unicode-check-oci-ta failed: For details, check Tekton task log.' ++ make_result_json -r ERROR -t 'Task sast-unicode-check-oci-ta failed: For details, check Tekton task log.' ``` Fixes: https://github.com/konflux-ci/build-definitions/pull/1401 Related: https://github.com/konflux-ci/build-definitions/pull/1524 --- task/sast-unicode-check/0.1/sast-unicode-check.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/task/sast-unicode-check/0.1/sast-unicode-check.yaml b/task/sast-unicode-check/0.1/sast-unicode-check.yaml index 0d8a179efe..0eb4323a03 100644 --- a/task/sast-unicode-check/0.1/sast-unicode-check.yaml +++ b/task/sast-unicode-check/0.1/sast-unicode-check.yaml @@ -128,8 +128,7 @@ spec: # Find unicode control FUC_EXIT_CODE=0 - mapfile -t fuc_args <<< "${FIND_UNICODE_CONTROL_ARGS}" - LANG=en_US.utf8 ./find-unicode-control/find_unicode_control.py "${fuc_args[@]}" "${SOURCE_CODE_DIR}/source" \ + LANG=en_US.utf8 ./find-unicode-control/find_unicode_control.py ${FIND_UNICODE_CONTROL_ARGS} "${SOURCE_CODE_DIR}/source" \ >raw_sast_unicode_check_out.txt \ 2>raw_sast_unicode_check_out.log \ || FUC_EXIT_CODE=$?