This is an automated email from the ASF dual-hosted git repository.
lynwee 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 c667a5ad4 fix: unable to create scope config for circleci (#7417)
c667a5ad4 is described below
commit c667a5ad462a79c6a8a4e56f0b21d934eb7ed2d4
Author: Klesh Wong <[email protected]>
AuthorDate: Tue Apr 30 16:22:40 2024 +0800
fix: unable to create scope config for circleci (#7417)
---
backend/plugins/circleci/api/connection_api.go | 6 +++---
backend/plugins/circleci/impl/impl.go | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/backend/plugins/circleci/api/connection_api.go
b/backend/plugins/circleci/api/connection_api.go
index 56c8f7ca9..37f8389ee 100644
--- a/backend/plugins/circleci/api/connection_api.go
+++ b/backend/plugins/circleci/api/connection_api.go
@@ -33,7 +33,7 @@ type CircleciTestConnResponse struct {
shared.ApiBody
}
-func testConnection(ctx context.Context, connection
*models.CircleciConnection) (*CircleciTestConnResponse, errors.Error) {
+func testConnection(ctx context.Context, connection *models.CircleciConn)
(*CircleciTestConnResponse, errors.Error) {
// validate
if vld != nil {
if err := vld.Struct(connection); err != nil {
@@ -73,7 +73,7 @@ func testConnection(ctx context.Context, connection
*models.CircleciConnection)
// @Router /plugins/circleci/test [POST]
func TestConnection(input *plugin.ApiResourceInput)
(*plugin.ApiResourceOutput, errors.Error) {
// process input
- connection := &models.CircleciConnection{}
+ connection := &models.CircleciConn{}
err := api.Decode(input.Body, connection, vld)
if err != nil {
return nil, err
@@ -104,7 +104,7 @@ func TestExistingConnection(input *plugin.ApiResourceInput)
(*plugin.ApiResource
return nil, err
}
// test connection
- result, err := testConnection(context.TODO(), connection)
+ result, err := testConnection(context.TODO(), &connection.CircleciConn)
if err != nil {
return nil, plugin.WrapTestConnectionErrResp(basicRes, err)
}
diff --git a/backend/plugins/circleci/impl/impl.go
b/backend/plugins/circleci/impl/impl.go
index 0c1ad8529..89e559ec5 100644
--- a/backend/plugins/circleci/impl/impl.go
+++ b/backend/plugins/circleci/impl/impl.go
@@ -199,7 +199,7 @@ func (p Circleci) ApiResources()
map[string]map[string]plugin.ApiResourceHandler
"PUT": api.PutScopes,
},
"connections/:connectionId/scope-configs": {
- "POST": api.PostConnections,
+ "POST": api.PostScopeConfig,
"GET": api.GetScopeConfigList,
},
"connections/:connectionId/scope-configs/:id": {