Skip to content

Commit bd21782

Browse files
committed
sast-coverity-check: use the latest release of coverity
Related: https://issues.redhat.com/browse/OSH-750 Related: https://issues.redhat.com/browse/OSH-796 Closes: #1653
1 parent 7a5cd15 commit bd21782

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

task/sast-coverity-check-oci-ta/0.2/sast-coverity-check-oci-ta.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ spec:
268268
- $(params.SOURCE_ARTIFACT)=/var/workdir/source
269269
- $(params.CACHI2_ARTIFACT)=/var/workdir/cachi2
270270
- name: prepare
271-
image: quay.io/redhat-services-prod/sast/coverity:202409.1
271+
image: quay.io/redhat-services-prod/sast/coverity:202412.1
272272
workingDir: /var/workdir
273273
volumeMounts:
274274
- mountPath: /etc/secrets/cov
@@ -323,6 +323,11 @@ spec:
323323
# if current directory is "/", fallback to an empty temp directory
324324
[ / = "\$proj_dir" ] && proj_dir=\$(mktemp -d)
325325
326+
# /usr/bin/file needs to be available for cov-build to work in Coverity 2024.12
327+
if ! [ -x /usr/bin/file ] && [ -w /usr/bin/ ] && [ -x /opt/cov-sa-2024.12/bin/file ]; then
328+
install -vm0755 /opt/cov-sa-2024.12/bin/file /usr/bin/file
329+
fi
330+
326331
# wrap the RUN command with "coverity capture" and record exit code of the wrapped command
327332
/opt/coverity/bin/coverity --ticker-mode=no-spin capture --dir=/tmp/idir --project-dir="\$proj_dir" \
328333
-- /bin/bash -c 'PS4="@\\\${SECONDS}s: \\\${BASH_COMMAND} --> "; set -x; "\$@"; echo \$? >/tmp/idir/build-cmd-ec.txt' \
@@ -359,7 +364,7 @@ spec:
359364
# instrument all RUN lines in Dockerfile to be executed through cmd-wrap.sh
360365
cstrans-df-run --verbose /shared/cmd-wrap.sh <"$dockerfile_path" >/shared/Containerfile
361366
- name: build
362-
image: quay.io/redhat-services-prod/sast/coverity:202409.1
367+
image: quay.io/redhat-services-prod/sast/coverity:202412.1
363368
args:
364369
- --build-args
365370
- $(params.BUILD_ARGS[*])
@@ -688,7 +693,7 @@ spec:
688693
add:
689694
- SETFCAP
690695
- name: postprocess
691-
image: quay.io/redhat-services-prod/sast/coverity:202409.1
696+
image: quay.io/redhat-services-prod/sast/coverity:202412.1
692697
workingDir: /var/workdir
693698
volumeMounts:
694699
- mountPath: /mnt/trusted-ca

task/sast-coverity-check/0.2/patch.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
- op: replace
6767
path: /spec/steps/0/image
6868
# New image shoould be based on quay.io/konflux-ci/buildah-task:latest or have all the tooling that the original image has.
69-
value: quay.io/redhat-services-prod/sast/coverity:202409.1
69+
value: quay.io/redhat-services-prod/sast/coverity:202412.1
7070

7171
# Change build step resources
7272
- op: replace
@@ -153,7 +153,7 @@
153153
path: /spec/steps/0
154154
value:
155155
name: prepare
156-
image: quay.io/redhat-services-prod/sast/coverity:202409.1
156+
image: quay.io/redhat-services-prod/sast/coverity:202412.1
157157
workingDir: $(workspaces.source.path)
158158
env:
159159
- name: COV_ANALYZE_ARGS
@@ -208,6 +208,11 @@
208208
# if current directory is "/", fallback to an empty temp directory
209209
[ / = "\$proj_dir" ] && proj_dir=\$(mktemp -d)
210210
211+
# /usr/bin/file needs to be available for cov-build to work in Coverity 2024.12
212+
if ! [ -x /usr/bin/file ] && [ -w /usr/bin/ ] && [ -x /opt/cov-sa-2024.12/bin/file ]; then
213+
install -vm0755 /opt/cov-sa-2024.12/bin/file /usr/bin/file
214+
fi
215+
211216
# wrap the RUN command with "coverity capture" and record exit code of the wrapped command
212217
/opt/coverity/bin/coverity --ticker-mode=no-spin capture --dir=/tmp/idir --project-dir="\$proj_dir" \
213218
-- /bin/bash -c 'PS4="@\\\${SECONDS}s: \\\${BASH_COMMAND} --> "; set -x; "\$@"; echo \$? >/tmp/idir/build-cmd-ec.txt' \
@@ -260,7 +265,7 @@
260265
path: /spec/steps/2
261266
value:
262267
name: postprocess
263-
image: quay.io/redhat-services-prod/sast/coverity:202409.1
268+
image: quay.io/redhat-services-prod/sast/coverity:202412.1
264269
computeResources:
265270
limits:
266271
memory: 4Gi

task/sast-coverity-check/0.2/sast-coverity-check.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ spec:
221221
value: $(params.COV_ANALYZE_ARGS)
222222
- name: DOCKERFILE
223223
value: $(params.DOCKERFILE)
224-
image: quay.io/redhat-services-prod/sast/coverity:202409.1
224+
image: quay.io/redhat-services-prod/sast/coverity:202412.1
225225
name: prepare
226226
script: |
227227
#!/bin/bash
@@ -267,6 +267,11 @@ spec:
267267
# if current directory is "/", fallback to an empty temp directory
268268
[ / = "\$proj_dir" ] && proj_dir=\$(mktemp -d)
269269
270+
# /usr/bin/file needs to be available for cov-build to work in Coverity 2024.12
271+
if ! [ -x /usr/bin/file ] && [ -w /usr/bin/ ] && [ -x /opt/cov-sa-2024.12/bin/file ]; then
272+
install -vm0755 /opt/cov-sa-2024.12/bin/file /usr/bin/file
273+
fi
274+
270275
# wrap the RUN command with "coverity capture" and record exit code of the wrapped command
271276
/opt/coverity/bin/coverity --ticker-mode=no-spin capture --dir=/tmp/idir --project-dir="\$proj_dir" \
272277
-- /bin/bash -c 'PS4="@\\\${SECONDS}s: \\\${BASH_COMMAND} --> "; set -x; "\$@"; echo \$? >/tmp/idir/build-cmd-ec.txt' \
@@ -330,7 +335,7 @@ spec:
330335
/shared:/shared
331336
/shared/license.dat:/opt/coverity/bin/license.dat
332337
/usr/libexec/csgrep-static:/usr/libexec/csgrep-static
333-
image: quay.io/redhat-services-prod/sast/coverity:202409.1
338+
image: quay.io/redhat-services-prod/sast/coverity:202412.1
334339
name: build
335340
script: |
336341
#!/bin/bash
@@ -654,7 +659,7 @@ spec:
654659
valueFrom:
655660
fieldRef:
656661
fieldPath: metadata.labels['appstudio.openshift.io/component']
657-
image: quay.io/redhat-services-prod/sast/coverity:202409.1
662+
image: quay.io/redhat-services-prod/sast/coverity:202412.1
658663
name: postprocess
659664
script: |
660665
#!/bin/bash -e

0 commit comments

Comments
 (0)