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 a5aa6d6d7 fix: remote api for github (#5432)
a5aa6d6d7 is described below

commit a5aa6d6d7686a360dd5220fbc2d6a65ba501460d
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Jun 12 13:00:54 2023 +0800

    fix: remote api for github (#5432)
---
 backend/plugins/github/api/remote.go | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/backend/plugins/github/api/remote.go 
b/backend/plugins/github/api/remote.go
index 64e3af44a..714b1b500 100644
--- a/backend/plugins/github/api/remote.go
+++ b/backend/plugins/github/api/remote.go
@@ -167,12 +167,12 @@ type repo struct {
 
 func (r repo) ConvertApiScope() plugin.ToolLayerScope {
        githubRepository := &models.GithubRepo{
-               //ConnectionId: data.Options.ConnectionId,
                GithubId:    r.ID,
-               Name:        r.Name,
+               Name:        r.FullName,
                HTMLUrl:     r.HTMLURL,
                Description: r.Description,
                OwnerId:     r.Owner.ID,
+               CloneUrl:    r.CloneURL,
                CreatedDate: r.CreatedAt,
                UpdatedDate: r.UpdatedAt,
        }
@@ -194,6 +194,9 @@ func (r repo) ConvertApiScope() plugin.ToolLayerScope {
 func RemoteScopes(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, 
errors.Error) {
        return remoteHelper.GetScopesFromRemote(input,
                func(basicRes context2.BasicRes, gid string, queryData 
*api.RemoteQueryData, connection models.GithubConnection) ([]org, errors.Error) 
{
+                       if gid != "" {
+                               return nil, nil
+                       }
                        apiClient, err := 
api.NewApiClientFromConnection(context.TODO(), basicRes, &connection)
                        if err != nil {
                                return nil, errors.BadInput.Wrap(err, "failed 
to get create apiClient")

Reply via email to