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

yumeng 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 36194e2fd chore: update github testconn msgs (#5457)
36194e2fd is described below

commit 36194e2fd1aee6ac4236ad0df3777132e3640310
Author: Klesh Wong <[email protected]>
AuthorDate: Tue Jun 13 14:29:35 2023 +0800

    chore: update github testconn msgs (#5457)
    
    Co-authored-by: Yumeng Wang <[email protected]>
---
 backend/plugins/github/api/connection.go | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/backend/plugins/github/api/connection.go 
b/backend/plugins/github/api/connection.go
index 55d97af60..f2e240267 100644
--- a/backend/plugins/github/api/connection.go
+++ b/backend/plugins/github/api/connection.go
@@ -172,7 +172,7 @@ func TestConnection(input *plugin.ApiResourceInput) 
(*plugin.ApiResourceOutput,
                        success = len(missingPubPerms) == 0
                        if !success {
                                messages = append(messages, fmt.Sprintf(
-                                       "%s is/are required to collect data 
from Public Repos",
+                                       "Please check the field(s) %s",
                                        strings.Join(missingPubPerms, ", "),
                                ))
                        }
@@ -180,8 +180,13 @@ func TestConnection(input *plugin.ApiResourceInput) 
(*plugin.ApiResourceOutput,
                        missingPriPerms := findMissingPerms(userPerms, 
privatePermissions)
                        warning = len(missingPriPerms) > 0
                        if warning {
+                               msgFmt := "If you want to collect private 
repositories, please check the field(s) %s"
+                               if success {
+                                       // @Startrekzky and @yumengwang03 
firmly believe that this is critical for users to understand the message
+                                       msgFmt = "This token is able to collect 
public repositories. " + msgFmt
+                               }
                                messages = append(messages, fmt.Sprintf(
-                                       "%s is/are required to collect data 
from Private Repos",
+                                       msgFmt,
                                        strings.Join(missingPriPerms, ", "),
                                ))
                        }

Reply via email to