You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2023/01/05 11:44:36 UTC

[incubator-devlake] branch main updated: docs(github): add comment for collector using since (#4083)

This is an automated email from the ASF dual-hosted git repository.

klesh 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 2144700ff docs(github): add comment for collector using since (#4083)
2144700ff is described below

commit 2144700ff6eb24cca68c1abc11ab63f227b253bf
Author: Warren Chen <yi...@merico.dev>
AuthorDate: Thu Jan 5 19:44:32 2023 +0800

    docs(github): add comment for collector using since (#4083)
    
    * docs(github): add comment for collector using since
    
    * fix(github): delete unused comment
---
 plugins/github/tasks/comment_collector.go           | 3 +++
 plugins/github/tasks/pr_review_comment_collector.go | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/plugins/github/tasks/comment_collector.go b/plugins/github/tasks/comment_collector.go
index 5d949747b..0090e03fc 100644
--- a/plugins/github/tasks/comment_collector.go
+++ b/plugins/github/tasks/comment_collector.go
@@ -56,6 +56,9 @@ func CollectApiComments(taskCtx core.SubTaskContext) errors.Error {
 			query.Set("state", "all")
 			// if data.CreatedDateAfter != nil, we set since once
 			if data.CreatedDateAfter != nil {
+				// Note that `since` is for filtering records by the `updated` time
+				// which is not ideal for semantic reasons and would result in slightly more records than expected.
+				// But we have no choice since it is the only available field we could exploit from the API.
 				query.Set("since", data.CreatedDateAfter.String())
 			}
 			// if incremental == true, we overwrite it
diff --git a/plugins/github/tasks/pr_review_comment_collector.go b/plugins/github/tasks/pr_review_comment_collector.go
index 2f4829102..1fd89bc77 100644
--- a/plugins/github/tasks/pr_review_comment_collector.go
+++ b/plugins/github/tasks/pr_review_comment_collector.go
@@ -58,6 +58,9 @@ func CollectPrReviewComments(taskCtx core.SubTaskContext) errors.Error {
 			query := url.Values{}
 			// if data.CreatedDateAfter != nil, we set since once
 			if data.CreatedDateAfter != nil {
+				// Note that `since` is for filtering records by the `updated` time
+				// which is not ideal for semantic reasons and would result in slightly more records than expected.
+				// But we have no choice since it is the only available field we could exploit from the API.
 				query.Set("since", data.CreatedDateAfter.String())
 			}
 			// if incremental == true, we overwrite it
@@ -88,7 +91,7 @@ func CollectPrReviewComments(taskCtx core.SubTaskContext) errors.Error {
 }
 
 var CollectApiPrReviewCommentsMeta = core.SubTaskMeta{
-	Name:             "CollectApiPrReviewCommentsMeta",
+	Name:             "collectApiPrReviewCommentsMeta",
 	EntryPoint:       CollectPrReviewComments,
 	EnabledByDefault: true,
 	Description:      "Collect pr review comments data from Github api",