You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by wa...@apache.org on 2023/03/16 09:40:08 UTC
[incubator-devlake] branch main updated: fix: change pr collector detail input (#4687)
This is an automated email from the ASF dual-hosted git repository.
warren pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new c23ae894c fix: change pr collector detail input (#4687)
c23ae894c is described below
commit c23ae894cb2fbadc676a004470a93898d6fa0577
Author: Likyh <ya...@meri.co>
AuthorDate: Thu Mar 16 17:40:02 2023 +0800
fix: change pr collector detail input (#4687)
* fix: change pr collector detail input
* fix: for review
---
backend/plugins/github/tasks/pr_collector.go | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/backend/plugins/github/tasks/pr_collector.go b/backend/plugins/github/tasks/pr_collector.go
index 4456a9d3b..d22a47d77 100644
--- a/backend/plugins/github/tasks/pr_collector.go
+++ b/backend/plugins/github/tasks/pr_collector.go
@@ -44,7 +44,7 @@ var CollectApiPullRequestsMeta = plugin.SubTaskMeta{
}
type SimpleGithubPr struct {
- GithubId int64
+ Number int64
}
type SimpleGithubApiPr struct {
@@ -102,7 +102,7 @@ func CollectApiPullRequests(taskCtx plugin.SubTaskContext) errors.Error {
BuildInputIterator: func() (helper.Iterator, errors.Error) {
// select pull id from database
cursor, err := db.Cursor(
- dal.Select("github_id"),
+ dal.Select("number"),
dal.From(&models.GithubPullRequest{}),
dal.Where(
"repo_id = ? AND connection_id = ? AND state != 'closed'",
@@ -115,7 +115,7 @@ func CollectApiPullRequests(taskCtx plugin.SubTaskContext) errors.Error {
return helper.NewDalCursorIterator(db, cursor, reflect.TypeOf(SimpleGithubPr{}))
},
FinalizableApiCollectorCommonArgs: helper.FinalizableApiCollectorCommonArgs{
- UrlTemplate: "repos/{{ .Params.Name }}/pulls/{{ .Input.GithubId }}",
+ UrlTemplate: "repos/{{ .Params.Name }}/pulls/{{ .Input.Number }}",
ResponseParser: func(res *http.Response) ([]json.RawMessage, errors.Error) {
body, err := io.ReadAll(res.Body)
if err != nil {