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: initial task for Coverity Buildless #1411

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jperezdealgaba
Copy link
Contributor

@jperezdealgaba jperezdealgaba commented Sep 13, 2024

Initial version of the Coverity Buildless task. The code will be scanned using coverity buildless mode, then the results are processuing using csgrep and the results are later filtered using csfilter-kfp.

This is a draft request and this can not be merged in this repository. It will be merged in a newly created repository.
Things pending to do:

  • Move this MR to a new and private repo - Not needed anymore
  • Remove installation of csdiff package once the container image is updated
  • Speak on how to store license in a secure place
  • Show results on UI
  • Enhanced Readme with private information - Not needed anymore

Apart from that, the MR can be reviewed as the funcionality will remain the same

@jperezdealgaba jperezdealgaba force-pushed the coverity-buildless branch 2 times, most recently from 48b9d8c to 06b8305 Compare September 15, 2024 15:30
@jperezdealgaba
Copy link
Contributor Author

jperezdealgaba commented Sep 15, 2024

@jperezdealgaba jperezdealgaba force-pushed the coverity-buildless branch 5 times, most recently from 7d6c4fb to e833b16 Compare September 17, 2024 17:56
@jperezdealgaba
Copy link
Contributor Author

Thanks for the thorough review @kdudka !

Copy link

@kdudka kdudka left a comment

Choose a reason for hiding this comment

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

@jperezdealgaba Please close the review threads that have been resolved. I do not have sufficient permission to do it myself.

@jperezdealgaba
Copy link
Contributor Author

Solved all comments and added new changes. I will also apply the changes (the record excluded and update the upload task) to the snyk code task

task/sast-coverity-check/0.1/README.md Outdated Show resolved Hide resolved
task/sast-coverity-check/0.1/README.md Outdated Show resolved Hide resolved
@jperezdealgaba jperezdealgaba force-pushed the coverity-buildless branch 3 times, most recently from f65c313 to ffff308 Compare September 20, 2024 09:28
task/sast-coverity-check/0.1/README.md Outdated Show resolved Hide resolved
@jperezdealgaba
Copy link
Contributor Author

jperezdealgaba commented Sep 25, 2024

Hey! @kdudka I just did a new MR with all the discussed changes:

The relationship between the two tasks are defined in the following file: pipelines/template-build/template-build.yaml
This is a big MR so I guess we should have Konflux eyes here

@jperezdealgaba jperezdealgaba force-pushed the coverity-buildless branch 4 times, most recently from 4ff058b to 67b248e Compare November 4, 2024 10:07
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

@kdudka
Copy link

kdudka commented Nov 6, 2024

/ok-to-test

@kdudka
Copy link

kdudka commented Nov 6, 2024

@hongweiliu17 @14rcole Could you please check what failed at https://github.com/konflux-ci/build-definitions/pull/1411/checks?check_run_id=32513757072? I do not have permissions to access the logs myself.

@hongweiliu17
Copy link
Contributor

hongweiliu17 commented Nov 6, 2024

@hongweiliu17 @14rcole Could you please check what failed at https://github.com/konflux-ci/build-definitions/pull/1411/checks?check_run_id=32513757072? I do not have permissions to access the logs myself.

I can see error message on https://console.redhat.com/application-pipeline/ns/konflux-ci/pipelinerun/build-definitions-pull-request-hvsz9/logs/ec-task-checks, it looks I need permission too.

Unable to load pipeline run build-definitions-pull-request-hvsz9
Invalid token. Are you working with Prod SSO token?

But I can see error from plr log from cluster and paste them to https://privatebin.corp.redhat.com/?19308e48ca84a494#7wxyCvDRWnqSiuU9BUdhiqCmsie4KKCb6vT3Dzhzc74o

@kdudka
Copy link

kdudka commented Nov 6, 2024

/ok-to-test

@jperezdealgaba
Copy link
Contributor Author

@kdudka I just rebased the branch. Would you mind retesting?

@tnevrlka
Copy link
Contributor

/ok-to-test

@kdudka
Copy link

kdudka commented Nov 11, 2024

It seems that ec-task-checks failed again with:

  • result: RPMS_DATA
    task: rpms-signature-scan
    success: false

I am not able to access the task log myself: https://console.redhat.com/application-pipeline/ns/konflux-ci/pipelinerun/build-definitions-pull-request-6xts4/logs/ec-task-checks

@jperezdealgaba
Copy link
Contributor Author

@tnevrlka Thanks for the resteting. This PR should be failing by something out of our control as we are not allow to see those tasks/logs. Would you mind adding some guidance so we can fix this?

@jperezdealgaba jperezdealgaba force-pushed the coverity-buildless branch 10 times, most recently from 7017796 to 0a521f1 Compare November 13, 2024 18:45
@14rcole
Copy link
Contributor

14rcole commented Nov 14, 2024

/ok-to-test

@jperezdealgaba jperezdealgaba force-pushed the coverity-buildless branch 2 times, most recently from 73fc566 to 50ebc74 Compare November 15, 2024 19:34
Solves: https://issues.redhat.com/browse/OSH-740

Initial version of the Coverity Buildless task. In introduces two different tasks: A task checking the availability of Coverity license and authentication token, and a task for scanning the code. The code will be scanned using coverity buildless mode, then the results are processing using csgrep and the results are later filtered using csfilter-kfp.
@jperezdealgaba
Copy link
Contributor Author

@14rcole @ralphbean The MR has been updated and it already contains needed changes. With the two tasks coverity-availability-check and sast-coverity-check users should be able to scan the code using the documentation that I already created.
The previous code was already approved but I added changes to the template-build.yaml file that should be reviewed as that would affect all future automatically generated pipelines.
Regarding the failed MR, after applying the script, no file is generated/updated so not really sure how to act there:

/usr/bin/python3 /Users/jperezde/Documents/Red_Hat/Dev/Repos/mine/build-definitions/hack/generate-pipelines-readme.py 
Subprocess: oc kustomize --output /var/folders/5j/42ytb9_91f3350drn6_blcfw0000gn/T/tmp_hk7cz7h ./pipelines/
oc failed:
STDOUT:

STDERR:
error: accumulating resources: accumulation err='accumulating resources from 'docker-build-oci-ta': '/Users/jperezde/Documents/Red_Hat/Dev/Repos/mine/build-definitions/pipelines/docker-build-oci-ta' must resolve to a file': recursed accumulation of path '/Users/jperezde/Documents/Red_Hat/Dev/Repos/mine/build-definitions/pipelines/docker-build-oci-ta': remove operation does not apply: doc is missing path: "/spec/tasks/12/workspaces/0": missing value

Apart from that, no other work from our side is needed

cc/ @kdudka

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