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

GitLab job/pipeline don't have conclusion fields #3396

Closed
spencerschrock opened this issue Aug 16, 2023 · 4 comments · Fixed by #3706
Closed

GitLab job/pipeline don't have conclusion fields #3396

spencerschrock opened this issue Aug 16, 2023 · 4 comments · Fixed by #3706
Labels
check/CI-Tests check/SAST gitlab Issue related to Scorecard's GitLab client

Comments

@spencerschrock
Copy link
Contributor

GitHub worksflows have two fields, Status and Conclusion, which is what we built into our model.

GitLab, just has a Status. I think we can parse the status field to set status and conclusion to their GitHub equivalent, or we can adjust the model going forward to be more generic. We may not have an answer immediately.

This seems to affect the CI-Tests and SAST checks.

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity.

@ashearin
Copy link
Contributor

GItlabs Status field seems to be almost a combination of the Conclusion and Status fields in Github. Would it make sense to only pull completed pipelines in listCheckRunsForRef (potentially only for Gitlab) and just set the status to completed? I see that both the sast and ci tests check that the status is 'completed' before further processing.

Not sure if this issue requires more high level discussion, but I'm happy to take a whack at it

@spencerschrock
Copy link
Contributor Author

I see that both the sast and ci tests check that the status is 'completed' before further processing.

SAST also checks the conclusion:

var allowedConclusions = map[string]bool{"success": true, "neutral": true}

if !allowedConclusions[cr.Conclusion] {
continue
}

Would it make sense to only pull completed pipelines in listCheckRunsForRef (potentially only for Gitlab) and just set the status to completed?

We generally like to put all data in the raw results, and let the evaluation code handle the judging. Is there a reason to not do this for GitLab?

@ashearin
Copy link
Contributor

We generally like to put all data in the raw results, and let the evaluation code handle the judging. Is there a reason to not do this for GitLab?

No reason, really. My thought was to use calls we're already making to get more info about the pipelines to help decide what goes in the conclusion and status fields for gitlab pipelines. Let me try to explain what I meant a bit better:

  • Pull in only completed pipelines when running checks on a gitlab repo,
    • set the status to completed,
    • Set Conclusion to the pulled pipeline status, since we should have the success/fail/skipped in there (DIdn't mention this part initially, obviously want the conclusion field populated)

I get wanting to pull everything and let the code filter through it as needed (we may look at non-completed pipelines at some point). Just wanted to gauge preferences on this before proposing changes. Parsing the GItlab Status and inferring the conclusion and Status fields would also work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
check/CI-Tests check/SAST gitlab Issue related to Scorecard's GitLab client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants