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 Oct 24, 2024
1 parent e32bc97 commit 82046fa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 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,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=$?
Expand Down

0 comments on commit 82046fa

Please sign in to comment.