This is an automated email from the ASF dual-hosted git repository.
abeizn 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 6a84dbc6 fix(github): use pr id instead of pr number
6a84dbc6 is described below
commit 6a84dbc6644169d1f9add8a2f6661e1a92c1555e
Author: Yingchu Chen <[email protected]>
AuthorDate: Tue Jul 19 01:09:39 2022 +0800
fix(github): use pr id instead of pr number
closes #2532
---
.../_tool_github_pull_request_comments.csv | 32 +++++++++++-----------
.../e2e/snapshot_tables/pull_request_comments.csv | 16 +++++++++++
.../github/tasks/pr_review_comment_extractor.go | 11 ++++++--
3 files changed, 41 insertions(+), 18 deletions(-)
diff --git
a/plugins/github/e2e/snapshot_tables/_tool_github_pull_request_comments.csv
b/plugins/github/e2e/snapshot_tables/_tool_github_pull_request_comments.csv
index ba942f34..5c8aba4b 100644
--- a/plugins/github/e2e/snapshot_tables/_tool_github_pull_request_comments.csv
+++ b/plugins/github/e2e/snapshot_tables/_tool_github_pull_request_comments.csv
@@ -1,20 +1,20 @@
connection_id,github_id,pull_request_id,body,author_username,author_user_id,commit_sha,github_created_at,github_updated_at,review_id,type,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark
-1,300245643,36,"""这里我不太明白,这么写能让这个goroutine不结束?""",panjf2000,7496278,39f04c6e65b76b5f20abd3ca0606db4cd038e5c2,2019-07-04T06:32:11.000+00:00,2019-07-18T15:26:41.000+00:00,257849164,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,1,
-1,300246398,36,"""`f()`应该放到这个匿名函数里面吧?""",panjf2000,7496278,39f04c6e65b76b5f20abd3ca0606db4cd038e5c2,2019-07-04T06:35:07.000+00:00,2019-07-18T15:26:41.000+00:00,257849164,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,2,
-1,307667007,40,"""I don't think assigning this variable to a oversize value is
a good idea, threre are different scenarios which should have different
interval durations to clean up goroutines, so could you please make
`DEFAULT_CLEAN_INTERVAL_TIME ` configurable? Maybe adding a new function that
accepts this variable as its
argument.""",panjf2000,7496278,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:38:21.000+00:00,2019-07-26T14:21:07.000+00:00,267089136,DIFF,"{""ConnectionId"":
[...]
-1,307667451,40,"""I believe you should add new unit tests for your new
feature.""",panjf2000,7496278,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:39:24.000+00:00,2019-07-26T14:21:07.000+00:00,267089136,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,4,
-1,307669178,40,"""You omitted the `worker_func.go`, please update
it.""",panjf2000,7496278,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:43:56.000+00:00,2019-07-26T14:21:07.000+00:00,267089136,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,5,
-1,307671676,40,"""got
it""",Anteoy,17495446,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:50:06.000+00:00,2019-07-26T14:21:07.000+00:00,267094793,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,6,
-1,307672146,40,"""sure, I will
add.""",Anteoy,17495446,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:51:31.000+00:00,2019-07-26T14:21:07.000+00:00,267095424,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,7,
-1,307672417,40,"""I will think about
it""",Anteoy,17495446,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:52:20.000+00:00,2019-07-26T14:21:07.000+00:00,267095785,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,8,
-1,307675200,40,""" When the pool size is too large , Performance will drop by
the lock . Locking at high concurrency is like an atomic bomb. So I think it
should be changed. Because it's the default pool value. Many user will use
self-defined pool by NewPool. Of course, it is ok to not
change.\r\n""",Anteoy,17495446,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:59:42.000+00:00,2019-07-26T14:21:07.000+00:00,267099413,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""a
[...]
-1,307686223,40,"""I think we can modify the New method and periodicallyPurge,
it can be used as the next enhancement. I restored it for this pr. May it can
be another pr for
this.""",Anteoy,17495446,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T10:33:56.000+00:00,2019-07-26T14:21:07.000+00:00,267113847,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,10,
-1,315493235,41,"""SA2002: the goroutine calls T.Fatalf, which must be called
in the same goroutine as the test (from
`staticcheck`)""",golangcibot,42910462,58466b12b03a603d9f0331bbcc64a7557b27865d,2019-08-20T03:25:26.000+00:00,2019-08-20T10:31:55.000+00:00,276914383,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,11,
-1,315497949,41,"""Are these two fields of `MaxBlockingSubmit` and
`blockingNum` really necessary? From where I stand, the throttle of your
business traffics should be the capacity of pool, if you've set up
`nonblocking` as `true`, it returns nil once the amount of all running workers
reaches the pool capacity, otherwise, it is blocked until there is worker
available.\r\n\r\nWhy did you add these two fields? is there any specific
scenario?""",panjf2000,7496278,58466b12b03a603d9f0331bbcc64 [...]
-1,315498393,41,"""This section could be refined as:\r\n```go\r\nif w :=
p.retrieveWorker(); w == nil {\r\n return ErrPoolBlocked\r\n} else {\r\n
w.task <-
task\r\n}\r\n```""",panjf2000,7496278,58466b12b03a603d9f0331bbcc64a7557b27865d,2019-08-20T04:02:19.000+00:00,2019-08-20T10:31:55.000+00:00,276920486,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,13,
-1,315498823,41,"""The name of `ErrPoolBlocked` is blurry and unable to tell
why it is being blocked, I would suggest `ErrPoolOverload` or
`ErrPoolOverflow`.""",panjf2000,7496278,58466b12b03a603d9f0331bbcc64a7557b27865d,2019-08-20T04:05:11.000+00:00,2019-08-20T10:31:55.000+00:00,276920486,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,14,
-1,315499067,41,"""If this field is necessary, rename it to
`MaxBlockingTasks`.""",panjf2000,7496278,58466b12b03a603d9f0331bbcc64a7557b27865d,2019-08-20T04:06:45.000+00:00,2019-08-20T10:31:55.000+00:00,276920486,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,15,
-1,315499281,41,"""I think `Nonblocking` is
enough.""",panjf2000,7496278,58466b12b03a603d9f0331bbcc64a7557b27865d,2019-08-20T04:08:21.000+00:00,2019-08-20T10:31:55.000+00:00,276920486,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,16,
+1,300245643,292246524,"""这里我不太明白,这么写能让这个goroutine不结束?""",panjf2000,7496278,39f04c6e65b76b5f20abd3ca0606db4cd038e5c2,2019-07-04T06:32:11.000+00:00,2019-07-18T15:26:41.000+00:00,257849164,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,1,
+1,300246398,292246524,"""`f()`应该放到这个匿名函数里面吧?""",panjf2000,7496278,39f04c6e65b76b5f20abd3ca0606db4cd038e5c2,2019-07-04T06:35:07.000+00:00,2019-07-18T15:26:41.000+00:00,257849164,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,2,
+1,307667007,301421607,"""I don't think assigning this variable to a oversize
value is a good idea, threre are different scenarios which should have
different interval durations to clean up goroutines, so could you please make
`DEFAULT_CLEAN_INTERVAL_TIME ` configurable? Maybe adding a new function that
accepts this variable as its
argument.""",panjf2000,7496278,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:38:21.000+00:00,2019-07-26T14:21:07.000+00:00,267089136,DIFF,"{""Connecti
[...]
+1,307667451,301421607,"""I believe you should add new unit tests for your new
feature.""",panjf2000,7496278,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:39:24.000+00:00,2019-07-26T14:21:07.000+00:00,267089136,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,4,
+1,307669178,301421607,"""You omitted the `worker_func.go`, please update
it.""",panjf2000,7496278,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:43:56.000+00:00,2019-07-26T14:21:07.000+00:00,267089136,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,5,
+1,307671676,301421607,"""got
it""",Anteoy,17495446,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:50:06.000+00:00,2019-07-26T14:21:07.000+00:00,267094793,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,6,
+1,307672146,301421607,"""sure, I will
add.""",Anteoy,17495446,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:51:31.000+00:00,2019-07-26T14:21:07.000+00:00,267095424,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,7,
+1,307672417,301421607,"""I will think about
it""",Anteoy,17495446,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:52:20.000+00:00,2019-07-26T14:21:07.000+00:00,267095785,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,8,
+1,307675200,301421607,""" When the pool size is too large , Performance will
drop by the lock . Locking at high concurrency is like an atomic bomb. So I
think it should be changed. Because it's the default pool value. Many user will
use self-defined pool by NewPool. Of course, it is ok to not
change.\r\n""",Anteoy,17495446,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T09:59:42.000+00:00,2019-07-26T14:21:07.000+00:00,267099413,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Rep
[...]
+1,307686223,301421607,"""I think we can modify the New method and
periodicallyPurge, it can be used as the next enhancement. I restored it for
this pr. May it can be another pr for
this.""",Anteoy,17495446,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,2019-07-26T10:33:56.000+00:00,2019-07-26T14:21:07.000+00:00,267113847,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,10,
+1,315493235,308859272,"""SA2002: the goroutine calls T.Fatalf, which must be
called in the same goroutine as the test (from
`staticcheck`)""",golangcibot,42910462,58466b12b03a603d9f0331bbcc64a7557b27865d,2019-08-20T03:25:26.000+00:00,2019-08-20T10:31:55.000+00:00,276914383,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,11,
+1,315497949,308859272,"""Are these two fields of `MaxBlockingSubmit` and
`blockingNum` really necessary? From where I stand, the throttle of your
business traffics should be the capacity of pool, if you've set up
`nonblocking` as `true`, it returns nil once the amount of all running workers
reaches the pool capacity, otherwise, it is blocked until there is worker
available.\r\n\r\nWhy did you add these two fields? is there any specific
scenario?""",panjf2000,7496278,58466b12b03a603d9f033 [...]
+1,315498393,308859272,"""This section could be refined as:\r\n```go\r\nif w :=
p.retrieveWorker(); w == nil {\r\n return ErrPoolBlocked\r\n} else {\r\n
w.task <-
task\r\n}\r\n```""",panjf2000,7496278,58466b12b03a603d9f0331bbcc64a7557b27865d,2019-08-20T04:02:19.000+00:00,2019-08-20T10:31:55.000+00:00,276920486,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,13,
+1,315498823,308859272,"""The name of `ErrPoolBlocked` is blurry and unable to
tell why it is being blocked, I would suggest `ErrPoolOverload` or
`ErrPoolOverflow`.""",panjf2000,7496278,58466b12b03a603d9f0331bbcc64a7557b27865d,2019-08-20T04:05:11.000+00:00,2019-08-20T10:31:55.000+00:00,276920486,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,14,
+1,315499067,308859272,"""If this field is necessary, rename it to
`MaxBlockingTasks`.""",panjf2000,7496278,58466b12b03a603d9f0331bbcc64a7557b27865d,2019-08-20T04:06:45.000+00:00,2019-08-20T10:31:55.000+00:00,276920486,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,15,
+1,315499281,308859272,"""I think `Nonblocking` is
enough.""",panjf2000,7496278,58466b12b03a603d9f0331bbcc64a7557b27865d,2019-08-20T04:08:21.000+00:00,2019-08-20T10:31:55.000+00:00,276920486,DIFF,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,16,
1,407675431,203756736,"""#
[Codecov](https://codecov.io/gh/panjf2000/ants/pull/4?src=pr&el=h1) Report\n>
Merging [#4](https://codecov.io/gh/panjf2000/ants/pull/4?src=pr&el=desc) into
[master](https://codecov.io/gh/panjf2000/ants/commit/f5b37d0798a8e4c6780a1e08270fa50e979aa1d7?src=pr&el=desc)
will **not change** coverage.\n> The diff coverage is `100%`.\n\n[
[...]
1,407714136,203756736,"""@barryz
改的不错,不过有一点需要商榷,那个预分配的大小,之前benchmark我记得1000w也只需要用到7w多,这样的话预分配5w对于大部分场景其实有点浪费,你有没有用修改后的代码benchmark一下,每次allocs/op应该是变大了吧""",panjf2000,7496278,,2018-07-25T10:49:44.000+00:00,2018-07-25T10:49:44.000+00:00,0,NORMAL,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_comments,3163,
1,407755528,203756736,"""@panjf2000 因为从压测结果来看, 1000W的场景下goroutine池的作用很明显,
尤其是在节省内存开销方面,所以在选择默认worker数量时,取了一个相对较大的值。 下面是benchmark
对比\r\n\r\nmaster:\r\n\r\n```\r\ngoos: linux\r\ngoarch:
amd64\r\nBenchmarkGoroutineWithFunc-4 1 15079030287 ns/op
723120296 B/op 10176159 allocs/op\r\nPASS\r\nok command-line-arguments
15.106s\r\n```\r\n\r\nPR:\r\n```\r\ngoos: linux\r\ngoarch:
amd64\r\nBenchmarkGoroutineWithFunc-4 1 15443376244 ns/op
72096288 [...]
diff --git a/plugins/github/e2e/snapshot_tables/pull_request_comments.csv
b/plugins/github/e2e/snapshot_tables/pull_request_comments.csv
index a3a3a226..a0b392b8 100644
--- a/plugins/github/e2e/snapshot_tables/pull_request_comments.csv
+++ b/plugins/github/e2e/snapshot_tables/pull_request_comments.csv
@@ -1,4 +1,20 @@
id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,pull_request_id,body,user_id,created_date,commit_sha,position,type,review_id,status
+github:GithubPrComment:1:300245643,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,1,,github:GithubPullRequest:1:292246524,"""这里我不太明白,这么写能让这个goroutine不结束?""",github:GithubAccount:1:7496278,2019-07-04T06:32:11.000+00:00,39f04c6e65b76b5f20abd3ca0606db4cd038e5c2,0,DIFF,github:GithubPrReview:1:257849164,
+github:GithubPrComment:1:300246398,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,2,,github:GithubPullRequest:1:292246524,"""`f()`应该放到这个匿名函数里面吧?""",github:GithubAccount:1:7496278,2019-07-04T06:35:07.000+00:00,39f04c6e65b76b5f20abd3ca0606db4cd038e5c2,0,DIFF,github:GithubPrReview:1:257849164,
+github:GithubPrComment:1:307667007,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,3,,github:GithubPullRequest:1:301421607,"""I
don't think assigning this variable to a oversize value is a good idea, threre
are different scenarios which should have different interval durations to clean
up goroutines, so could you please make `DEFAULT_CLEAN_INTERVAL_TIME `
configurable? Maybe adding a new function that accepts this variable as [...]
+github:GithubPrComment:1:307667451,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,4,,github:GithubPullRequest:1:301421607,"""I
believe you should add new unit tests for your new
feature.""",github:GithubAccount:1:7496278,2019-07-26T09:39:24.000+00:00,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,0,DIFF,github:GithubPrReview:1:267089136,
+github:GithubPrComment:1:307669178,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,5,,github:GithubPullRequest:1:301421607,"""You
omitted the `worker_func.go`, please update
it.""",github:GithubAccount:1:7496278,2019-07-26T09:43:56.000+00:00,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,0,DIFF,github:GithubPrReview:1:267089136,
+github:GithubPrComment:1:307671676,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,6,,github:GithubPullRequest:1:301421607,"""got
it""",github:GithubAccount:1:17495446,2019-07-26T09:50:06.000+00:00,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,0,DIFF,github:GithubPrReview:1:267094793,
+github:GithubPrComment:1:307672146,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,7,,github:GithubPullRequest:1:301421607,"""sure,
I will
add.""",github:GithubAccount:1:17495446,2019-07-26T09:51:31.000+00:00,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,0,DIFF,github:GithubPrReview:1:267095424,
+github:GithubPrComment:1:307672417,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,8,,github:GithubPullRequest:1:301421607,"""I
will think about
it""",github:GithubAccount:1:17495446,2019-07-26T09:52:20.000+00:00,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,0,DIFF,github:GithubPrReview:1:267095785,
+github:GithubPrComment:1:307675200,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,9,,github:GithubPullRequest:1:301421607,"""
When the pool size is too large , Performance will drop by the lock . Locking
at high concurrency is like an atomic bomb. So I think it should be changed.
Because it's the default pool value. Many user will use self-defined pool by
NewPool. Of course, it is ok to not change.\r\n""",github:GithubAccoun [...]
+github:GithubPrComment:1:307686223,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,10,,github:GithubPullRequest:1:301421607,"""I
think we can modify the New method and periodicallyPurge, it can be used as
the next enhancement. I restored it for this pr. May it can be another pr for
this.""",github:GithubAccount:1:17495446,2019-07-26T10:33:56.000+00:00,5dc8b9a71737eb57dc03fbbe3eb9010ff6c3fbb6,0,DIFF,github:GithubPrReview:1:267113847,
+github:GithubPrComment:1:315493235,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,11,,github:GithubPullRequest:1:308859272,"""SA2002:
the goroutine calls T.Fatalf, which must be called in the same goroutine as
the test (from
`staticcheck`)""",github:GithubAccount:1:42910462,2019-08-20T03:25:26.000+00:00,58466b12b03a603d9f0331bbcc64a7557b27865d,0,DIFF,github:GithubPrReview:1:276914383,
+github:GithubPrComment:1:315497949,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,12,,github:GithubPullRequest:1:308859272,"""Are
these two fields of `MaxBlockingSubmit` and `blockingNum` really necessary?
From where I stand, the throttle of your business traffics should be the
capacity of pool, if you've set up `nonblocking` as `true`, it returns nil once
the amount of all running workers reaches the pool capacity, otherwise [...]
+github:GithubPrComment:1:315498393,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,13,,github:GithubPullRequest:1:308859272,"""This
section could be refined as:\r\n```go\r\nif w := p.retrieveWorker(); w == nil
{\r\n return ErrPoolBlocked\r\n} else {\r\n w.task <-
task\r\n}\r\n```""",github:GithubAccount:1:7496278,2019-08-20T04:02:19.000+00:00,58466b12b03a603d9f0331bbcc64a7557b27865d,0,DIFF,github:GithubPrReview:1:276920486,
+github:GithubPrComment:1:315498823,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,14,,github:GithubPullRequest:1:308859272,"""The
name of `ErrPoolBlocked` is blurry and unable to tell why it is being blocked,
I would suggest `ErrPoolOverload` or
`ErrPoolOverflow`.""",github:GithubAccount:1:7496278,2019-08-20T04:05:11.000+00:00,58466b12b03a603d9f0331bbcc64a7557b27865d,0,DIFF,github:GithubPrReview:1:276920486,
+github:GithubPrComment:1:315499067,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,15,,github:GithubPullRequest:1:308859272,"""If
this field is necessary, rename it to
`MaxBlockingTasks`.""",github:GithubAccount:1:7496278,2019-08-20T04:06:45.000+00:00,58466b12b03a603d9f0331bbcc64a7557b27865d,0,DIFF,github:GithubPrReview:1:276920486,
+github:GithubPrComment:1:315499281,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_pull_request_review_comments,16,,github:GithubPullRequest:1:308859272,"""I
think `Nonblocking` is
enough.""",github:GithubAccount:1:7496278,2019-08-20T04:08:21.000+00:00,58466b12b03a603d9f0331bbcc64a7557b27865d,0,DIFF,github:GithubPrReview:1:276920486,
github:GithubPrComment:1:407675431,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_comments,3162,,github:GithubPullRequest:1:203756736,"""#
[Codecov](https://codecov.io/gh/panjf2000/ants/pull/4?src=pr&el=h1) Report\n>
Merging [#4](https://codecov.io/gh/panjf2000/ants/pull/4?src=pr&el=desc) into
[master](https://codecov.io/gh/panjf2000/ants/commit/f5b37d0798a8e4c6780a1e08270fa50e979aa1d7?src=pr&el=desc)
will **not change** coverage.\n> The diff coverage is [...]
github:GithubPrComment:1:407714136,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_comments,3163,,github:GithubPullRequest:1:203756736,"""@barryz
改的不错,不过有一点需要商榷,那个预分配的大小,之前benchmark我记得1000w也只需要用到7w多,这样的话预分配5w对于大部分场景其实有点浪费,你有没有用修改后的代码benchmark一下,每次allocs/op应该是变大了吧""",github:GithubAccount:1:7496278,2018-07-25T10:49:44.000+00:00,,0,NORMAL,github:GithubPrReview:1:0,
github:GithubPrComment:1:407755528,"{""ConnectionId"":1,""Owner"":""panjf2000"",""Repo"":""ants""}",_raw_github_api_comments,3164,,github:GithubPullRequest:1:203756736,"""@panjf2000
因为从压测结果来看, 1000W的场景下goroutine池的作用很明显,
尤其是在节省内存开销方面,所以在选择默认worker数量时,取了一个相对较大的值。 下面是benchmark
对比\r\n\r\nmaster:\r\n\r\n```\r\ngoos: linux\r\ngoarch:
amd64\r\nBenchmarkGoroutineWithFunc-4 1 15079030287 ns/op
723120296 B/op 10176159 allocs/op\r\nPASS\r\nok command-line-arguments
15 [...]
diff --git a/plugins/github/tasks/pr_review_comment_extractor.go
b/plugins/github/tasks/pr_review_comment_extractor.go
index e15ccf6f..be99ebc3 100644
--- a/plugins/github/tasks/pr_review_comment_extractor.go
+++ b/plugins/github/tasks/pr_review_comment_extractor.go
@@ -20,6 +20,8 @@ package tasks
import (
"encoding/json"
"fmt"
+ "github.com/apache/incubator-devlake/plugins/core/dal"
+ "gorm.io/gorm"
"regexp"
"runtime/debug"
"strconv"
@@ -89,11 +91,16 @@ func ExtractApiPrReviewComments(taskCtx
core.SubTaskContext) error {
if prUrlRegex != nil {
groups :=
prUrlRegex.FindStringSubmatch(prReviewComment.PrUrl)
if len(groups) > 0 {
- prId, err := strconv.Atoi(groups[1])
+ prNumber, err := strconv.Atoi(groups[1])
if err != nil {
return nil, fmt.Errorf("parse
prId failed:[%s] stack:[%s]", err.Error(), debug.Stack())
}
- githubPrComment.PullRequestId = prId
+ pr := &models.GithubPullRequest{}
+ err = taskCtx.GetDal().First(pr,
dal.Where("connection_id = ? and number = ? and repo_id = ?",
data.Options.ConnectionId, prNumber, data.Repo.GithubId))
+ if err != nil && err !=
gorm.ErrRecordNotFound {
+ return nil, err
+ }
+ githubPrComment.PullRequestId =
pr.GithubId
}
}
results = append(results, githubPrComment)