🌱 GitLab: Add log message (#3319)

* log msg

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

* address pr comments

* log once
* todo

Signed-off-by: Raghav Kaul <raghavkaul@google.com>

---------

Signed-off-by: Raghav Kaul <raghavkaul@google.com>
This commit is contained in:
Raghav Kaul 2023-07-28 13:40:52 -04:00 committed by GitHub
parent b992be36e0
commit e9495bbaa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -189,6 +189,8 @@ func (client *Client) ListCommits() ([]clients.Commit, error) {
// GitLab REST API doesn't provide a way to link Merge Requests and Commits that
// are within them without making a REST call for each commit (~30 by default)
// Making 1 GraphQL query to combine the results of 2 REST calls, we avoid this
// TODO(#3193): Fix the way graphql retrieves merge details to more closely
// line up with commits from listRawCommits
mrDetails, err := client.graphql.getMergeRequestsDetail(before)
if err != nil {
return []clients.Commit{}, err

View File

@ -16,6 +16,7 @@ package gitlabrepo
import (
"fmt"
"os"
"strconv"
"strings"
"sync"
@ -52,6 +53,12 @@ func (handler *commitsHandler) setup() error {
return
}
handler.commitsRaw = commits
if handler.repourl.commitSHA != clients.HeadSHA {
//nolint:lll
// TODO(#3193): Fix the way graphql retrieves merge details to more closely
// line up with commits from listRawCommits
fmt.Fprintln(os.Stderr, "Scorecard may be missing merge requests when running on non-HEAD of a GitLab repo. Code-Review scores may be lower.")
}
})
return handler.errSetup