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 |
|
@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. |
Uh oh!
There was an error while loading. Please reload this page.
What should be the correct returned object in ResponseParser in https://github.com/apache/incubator-devlake/blob/c316619630320aa7eb581769306da45784bf9328/backend/plugins/github_graphql/tasks/pr_collector.go#L177 if I want to change some data in response?
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.
All reactions