Replies: 2 comments 4 replies
-
Hey there, @vvshulga! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let me know how I can assist you! To modify the Currently, the
Here's a conceptual example of how you might implement this: ResponseParser: func(res *http.Response) ([]json.RawMessage, errors.Error) {
var responseData struct {
Files []struct {
Path string `json:"path"`
} `json:"files"`
}
err := helper.UnmarshalResponse(res, &responseData)
if err != nil {
return nil, err
}
uniquePaths := make(map[string]struct{})
for _, file := range responseData.Files {
uniquePaths[file.Path] = struct{}{}
}
var uniquePathsList []json.RawMessage
for path := range uniquePaths {
uniquePathsList = append(uniquePathsList, json.RawMessage(`"`+path+`"`))
}
return uniquePathsList, nil
}, This example assumes the response includes a |
Beta Was this translation helpful? Give feedback.
-
@dosu in version that I'm using return type is ([]interface{}, error) and I can not update my devlake GitHub graphql plugin in the nearest time. |
Beta Was this translation helpful? Give feedback.
-
What should be the correct returned object in ResponseParser in
incubator-devlake/backend/plugins/github_graphql/tasks/pr_collector.go
Line 177 in c316619
I added Files param to get information about changed paths and files, and if ResponseParser want to process this paths and save just unique paths for each PR.
Beta Was this translation helpful? Give feedback.
All reactions