Skip to content

Commit

Permalink
sast-unicode-check: make the task work with default params
Browse files Browse the repository at this point in the history
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: konflux-ci#1401
Related: konflux-ci#1524
  • Loading branch information
kdudka committed Nov 13, 2024
1 parent 1fa9e98 commit c75ac32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions task/sast-unicode-check/0.1/sast-unicode-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ 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" \
# shellcheck disable=SC2086
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=$?
Expand Down

0 comments on commit c75ac32

Please sign in to comment.