You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "mindlesscloud (via GitHub)" <gi...@apache.org> on 2023/07/25 03:21:42 UTC
[GitHub] [incubator-devlake] mindlesscloud commented on a diff in pull request #5664: feat: filter out the GitLab repos that users only have the Guest perm…
mindlesscloud commented on code in PR #5664:
URL: https://github.com/apache/incubator-devlake/pull/5664#discussion_r1272955671
##########
backend/plugins/gitlab/api/remote.go:
##########
@@ -81,11 +81,16 @@ func RemoteScopes(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, er
}
query := initialQuery(queryData)
var res *http.Response
+ var resBody []models.GitlabApiProject
if gid == "" {
res, err = apiClient.Get(fmt.Sprintf("users/%d/projects", apiClient.GetData("UserId")), query, nil)
if err != nil {
return nil, err
}
+ err = api.UnmarshalResponse(res, &resBody)
+ if err != nil {
+ return nil, err
+ }
} else {
query.Set("with_shared", "false")
if gid[:6] == "group:" {
Review Comment:
Using `strings.HasPrefix` may be a better solution
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org