Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sast-unicode-check: add support for Trusted Artifacts #1524

Merged
merged 4 commits into from
Dec 2, 2024

Conversation

kdudka
Copy link
Contributor

@kdudka kdudka commented Oct 21, 2024

Create the -oci-ta variant of the sast-unicode-check task.

Related: #1401
Resolves: https://issues.redhat.com/browse/OSH-764

@kdudka
Copy link
Contributor Author

kdudka commented Oct 21, 2024

/ok-to-test

@rhyw
Copy link
Contributor

rhyw commented Oct 22, 2024

@kdudka The script doesn't take care of the OWNERS files though. Still need to add manually.

@kdudka kdudka force-pushed the sast-unicode-check-oci-ta branch from 9e60dab to 838778b Compare October 23, 2024 08:09
@kdudka
Copy link
Contributor Author

kdudka commented Oct 23, 2024

@rhyw Added. Thanks for the notice!

kdudka added a commit to kdudka/build-definitions that referenced this pull request Oct 24, 2024
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
kdudka added a commit to kdudka/build-definitions that referenced this pull request Oct 24, 2024
Create the `-oci-ta` variant of the `sast-unicode-check` task.

Related: konflux-ci#1401
Resolves: https://issues.redhat.com/browse/OSH-764
Closes: konflux-ci#1524
@kdudka kdudka force-pushed the sast-unicode-check-oci-ta branch from 838778b to 31de817 Compare October 24, 2024 08:16
@kdudka
Copy link
Contributor Author

kdudka commented Oct 24, 2024

@kdudka kdudka marked this pull request as ready for review October 24, 2024 08:18
kdudka added a commit to kdudka/build-definitions that referenced this pull request Oct 24, 2024
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
@kdudka kdudka force-pushed the sast-unicode-check-oci-ta branch from 31de817 to 00a6289 Compare October 24, 2024 08:40
kdudka added a commit to kdudka/build-definitions that referenced this pull request Oct 24, 2024
Create the `-oci-ta` variant of the `sast-unicode-check` task.

Related: konflux-ci#1401
Resolves: https://issues.redhat.com/browse/OSH-764
Closes: konflux-ci#1524
@kdudka kdudka force-pushed the sast-unicode-check-oci-ta branch from 00a6289 to 4a91952 Compare November 6, 2024 09:13
kdudka added a commit to kdudka/build-definitions that referenced this pull request Nov 6, 2024
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
kdudka added a commit to kdudka/build-definitions that referenced this pull request Nov 6, 2024
Create the `-oci-ta` variant of the `sast-unicode-check` task.

Related: konflux-ci#1401
Resolves: https://issues.redhat.com/browse/OSH-764
Closes: konflux-ci#1524
kdudka added a commit to kdudka/build-definitions that referenced this pull request Nov 6, 2024
Create the `-oci-ta` variant of the `sast-unicode-check` task.

Related: konflux-ci#1401
Resolves: https://issues.redhat.com/browse/OSH-764
Closes: konflux-ci#1524
@kdudka kdudka force-pushed the sast-unicode-check-oci-ta branch from 4a91952 to d2836e2 Compare November 6, 2024 09:34
@kdudka
Copy link
Contributor Author

kdudka commented Nov 7, 2024

@hongweiliu17 @tkdchen This CI job has been running for more than 24 hours. Could you please check what happened?

@hongweiliu17
Copy link
Contributor

@hongweiliu17 @tkdchen This CI job has been running for more than 24 hours. Could you please check what happened?

Don't know why the PLR has been deleted but not written back to git provider. Maybe it is caused by the outage. Let's retest it.

BTW: You may request permission to the workspace konflux-ci to check the result.

@hongweiliu17
Copy link
Contributor

/retest

@kdudka
Copy link
Contributor Author

kdudka commented Nov 8, 2024

BTW: You may request permission to the workspace konflux-ci to check the result.

When I click any link in the CI results, I can only see this:
image

There is no link to request access. I found an Access Request form at https://console.redhat.com/internal but I do not know Account number and Organization ID that should be put into this form. Using my own numbers resulted in the following failure:

image

kdudka added a commit to kdudka/build-definitions that referenced this pull request Nov 11, 2024
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
kdudka added a commit to kdudka/build-definitions that referenced this pull request Nov 11, 2024
Create the `-oci-ta` variant of the `sast-unicode-check` task.

Related: konflux-ci#1401
Resolves: https://issues.redhat.com/browse/OSH-764
Closes: konflux-ci#1524
@kdudka kdudka force-pushed the sast-unicode-check-oci-ta branch from d2836e2 to 7b71a19 Compare November 11, 2024 09:29
kdudka added a commit to kdudka/build-definitions that referenced this pull request Nov 13, 2024
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
kdudka added a commit to kdudka/build-definitions that referenced this pull request Nov 13, 2024
Create the `-oci-ta` variant of the `sast-unicode-check` task.

Related: konflux-ci#1401
Resolves: https://issues.redhat.com/browse/OSH-764
Closes: konflux-ci#1524
@kdudka kdudka force-pushed the sast-unicode-check-oci-ta branch from 7b71a19 to 424fdf9 Compare November 13, 2024 09:29
@kdudka kdudka force-pushed the sast-unicode-check-oci-ta branch from f97c593 to dd54e7c Compare November 20, 2024 13:42
kdudka added a commit to kdudka/build-definitions that referenced this pull request Nov 20, 2024
Create the `-oci-ta` variant of the `sast-unicode-check` task.

Related: konflux-ci#1401
Resolves: https://issues.redhat.com/browse/OSH-764
Closes: konflux-ci#1524
kdudka added a commit to kdudka/build-definitions that referenced this pull request Nov 20, 2024
Create the `-oci-ta` variant of the `sast-unicode-check` task.

Related: konflux-ci#1401
Resolves: https://issues.redhat.com/browse/OSH-764
Closes: konflux-ci#1524
@kdudka kdudka force-pushed the sast-unicode-check-oci-ta branch from dd54e7c to 8e31162 Compare November 20, 2024 15:06
@hongweiliu17
Copy link
Contributor

/retest

@kdudka
Copy link
Contributor Author

kdudka commented Nov 21, 2024

@hongweiliu17 There was a successful CI run yesterday: https://github.com/konflux-ci/build-definitions/runs/33305152289

How come it is now red again?

Copy link
Contributor

@tkdchen tkdchen left a comment

Choose a reason for hiding this comment

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

LGTM generally. It's hard for me to review the logic of the script implementation since I'm not in the specific field.

@kdudka
Copy link
Contributor Author

kdudka commented Nov 22, 2024

sast-unicode-check-oci-ta is generated from sast-unicode-check using the hack/generate-ta-tasks.sh script.

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
... instead of PROJECT_NVR to make the interface compatible with the
sast-shell-check task.

Related: konflux-ci#1524
Create the `-oci-ta` variant of the `sast-unicode-check` task.

Related: konflux-ci#1401
Resolves: https://issues.redhat.com/browse/OSH-764
Closes: konflux-ci#1524
@kdudka kdudka force-pushed the sast-unicode-check-oci-ta branch from 0b645f6 to 97f438b Compare November 25, 2024 12:54
@kdudka kdudka requested review from 14rcole and tkdchen November 25, 2024 12:56
@hongweiliu17
Copy link
Contributor

hongweiliu17 commented Nov 26, 2024

Comment for exit 1 according to https://github.com/konflux-ci/architecture/blob/main/ADR/0014-let-pipelines-proceed.md#decision. Others look good to me. ---- Igore this, trap can catch it.
It is better to test the task before merging in case any issues.

@hongweiliu17 hongweiliu17 self-requested a review November 26, 2024 10:42
Copy link
Contributor

@hongweiliu17 hongweiliu17 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@dirgim dirgim left a comment

Choose a reason for hiding this comment

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

LGTM code-wise

@kdudka
Copy link
Contributor Author

kdudka commented Dec 2, 2024

I can see this is approved and CI checks are all green. @14rcole Could we please proceed with merging this?

@dirgim dirgim added this pull request to the merge queue Dec 2, 2024
github-merge-queue bot pushed a commit that referenced this pull request Dec 2, 2024
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: #1401
Related: #1524
github-merge-queue bot pushed a commit that referenced this pull request Dec 2, 2024
... instead of PROJECT_NVR to make the interface compatible with the
sast-shell-check task.

Related: #1524
Merged via the queue into konflux-ci:main with commit c9d0d5c Dec 2, 2024
15 checks passed
@kdudka kdudka deleted the sast-unicode-check-oci-ta branch December 2, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants