-
Notifications
You must be signed in to change notification settings - Fork 27
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 Projects in Subgroups #511
Comments
I remember thinking GitLab subgroups would break something, I just wasn't sure where. We don't have a GitHub Action equivalent for GitLab which would upload scores, but it should be possible for subprojects to be scanned in our weekly cron and accessible from the API. |
I'd be happy to work on a gitlab equivalent.im currently looking at embedding scorecard in ~11k gitlab repos 👍 |
Fixing the endpoints to support subprojects from our weekly cron is probably the quickest win here.
That would be a pretty large undertaking if the goal is to have the badge API endpoint show the score produced by the GitLab CI. On the GitHub action side, we make use of Sigstore provenance to check that the GitHub action which produces the score is "clean". scorecard-webapp/app/server/post_results.go Lines 183 to 184 in f28966e
GitLab seemingly supports cosign (https://docs.gitlab.com/ee/ci/yaml/signing_examples.html), but parsing the workflow would be wildly different. |
Had a few minutes to look at this today. So the API spec we use, OpenAPI v2 (and even v3) doesn't (and wont) support this sort of in-path wildcard. So our route we define is doomed for these gitlab subgroups: Lines 78 to 94 in f1b48c0
Out of curiosity, the upcoming Go 1.22 Serve Mux would handle it (example from the proposal):
Avoiding a re-write, I assume we would want to standup another route, which supports query-based parameter passing instead (which would potentially help with #432 as well). |
FYI I've just been looking at adding support for publishing results from GitLab CI for a few of my projects, and have just hit this issue with my test repo. There's some more details in my thread in the OpenSSF Slack but would be up for helping add support if possible! |
It sounds like we'd need a similar parameter-based path for both GET and POST routes.
Our API endpoints are defined here, and we follow https://swagger.io/specification/v2/ A first step would be figuring out what we want the route to be, defining it and parameters, then hooking it up to the same implementation the existing route uses. |
Hi,
Could I please ask how one would retrieve the scorecard data for projects that exist within GitLab subgroups?
Example:
For project https://gitlab.com/gitlab-org/ruby/gems/gitlab-triage I believe the API URL would be https://api.securityscorecards.dev/projects/gitlab.com/gitlab-org/ruby/gems/gitlab-triage/badge however this results in
Should this instead return the "invalid repository path" badge like it would for https://api.securityscorecards.dev/projects/gitlab.com/adam-moss/dotfiles/badge?
If I manually use shields.io directly https://img.shields.io/ossf-scorecard/gitlab.com/gitlab-org/ruby/gems/gitlab-triage?label=openssf scorecard&style=flat it seems to work?
Thanks
The text was updated successfully, but these errors were encountered: