-
Notifications
You must be signed in to change notification settings - Fork 499
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
✨ Add commit depth support for GitLab #3672
Conversation
…epth value provided Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3672 +/- ##
==========================================
- Coverage 76.09% 70.54% -5.56%
==========================================
Files 205 205
Lines 14027 14042 +15
==========================================
- Hits 10674 9906 -768
- Misses 2722 3563 +841
+ Partials 631 573 -58 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Thanks for the small + tested PR.
I left one comment about an easy test I'd like to see before merge.
There's also a harder test for pagination, but I'm fine merging without it. Our existing suffixStubTripper
isn't good enough, since some of the values go-gitlab
cares about are in the header, not the response.
curl -vvv --header "PRIVATE-TOKEN: $GITLAB_AUTH_TOKEN" "https://gitlab.com/api/v4/projects/10858056/repository/commits?page=1&per_page=101"
...
< x-next-page: 2
< x-page: 1
< x-per-page: 100
< x-prev-page:
...
But testing it manually seemed to work for something like:
go run main.go --repo https://gitlab.com/baserow/baserow --checks Maintained --commit-depth 101 --format json --show-details | jq
{
"date": "2023-11-14T16:01:37-08:00",
"repo": {
"name": "gitlab.com/baserow/baserow",
"commit": "f12615ea0419d0840626ce152f25f6981e93c081"
},
"scorecard": {
"version": "",
"commit": "unknown"
},
"score": 10,
"checks": [
{
"details": null,
"score": 10,
"reason": "101 commit(s) out of 101 and 20 issue activity out of 20 found in the last 90 days -- score normalized to 10",
"name": "Maintained",
"documentation": {
"url": "https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained",
"short": "Determines if the project is \"actively maintained\"."
}
}
],
"metadata": null
}
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
What kind of change does this PR introduce?
Bug fix for #2828, reopening of #2829
What is the current behavior?
The new gitlab functionality is not using the parameter --commit-depth in querying the gitlab repo for commits. In addition the defaulted value of 30 was not being used either, for the same reason.
What is the new behavior (if this is a feature change)?**
Which issue(s) this PR fixes
Fixes #2828
Special notes for your reviewer
Does this PR introduce a user-facing change?
For user-facing changes, please add a concise, human-readable release note to
the
release-note
(In particular, describe what changes users might need to make in their
application as a result of this pull request.)