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 d14773c01 fix: can not add connection to bp (#5658)
d14773c01 is described below

commit d14773c011451f18c726b2280182ef9da923b04b
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Jul 11 20:50:05 2023 +0800

    fix: can not add connection to bp (#5658)
---
 backend/plugins/zentao/api/blueprint_V200_test.go | 2 +-
 backend/plugins/zentao/api/blueprint_v200.go      | 7 +------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/backend/plugins/zentao/api/blueprint_V200_test.go 
b/backend/plugins/zentao/api/blueprint_V200_test.go
index ecd98139f..114908fc8 100644
--- a/backend/plugins/zentao/api/blueprint_V200_test.go
+++ b/backend/plugins/zentao/api/blueprint_V200_test.go
@@ -62,7 +62,7 @@ func TestMakeDataSourcePipelinePlanV200(t *testing.T) {
        mockBasicRes(t)
 
        bs := &plugin.BlueprintScopeV200{
-               Id: "project/1",
+               Id: "1",
        }
        /*bs2 := &plugin.BlueprintScopeV200{
                Id: "product/1",
diff --git a/backend/plugins/zentao/api/blueprint_v200.go 
b/backend/plugins/zentao/api/blueprint_v200.go
index 06980cb4b..6c772e631 100644
--- a/backend/plugins/zentao/api/blueprint_v200.go
+++ b/backend/plugins/zentao/api/blueprint_v200.go
@@ -18,7 +18,6 @@ limitations under the License.
 package api
 
 import (
-       "strings"
        "time"
 
        "github.com/apache/incubator-devlake/core/errors"
@@ -67,13 +66,9 @@ func makePipelinePlanV200(
                        ConnectionId: connection.ID,
                }
 
-               //scopeType := strings.Split(bpScope.Id, `/`)[0]
-               scopeId := strings.Split(bpScope.Id, `/`)[1]
-
                var entities []string
 
-               //if scopeType == `project` {
-               project, scopeConfig, err := 
projectScopeHelper.DbHelper().GetScopeAndConfig(connection.ID, scopeId)
+               project, scopeConfig, err := 
projectScopeHelper.DbHelper().GetScopeAndConfig(connection.ID, bpScope.Id)
                if err != nil {
                        return nil, nil, err
                }

Reply via email to