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 7083d97e4 fix: delete and clean scope not working for jenkins (#6708)
7083d97e4 is described below

commit 7083d97e4b7442d84710f78e2f8b54f3c53c6e48
Author: Klesh Wong <[email protected]>
AuthorDate: Fri Dec 29 17:35:51 2023 +0800

    fix: delete and clean scope not working for jenkins (#6708)
---
 backend/plugins/bitbucket/api/scope.go   | 1 +
 backend/plugins/jenkins/api/scope_api.go | 1 +
 backend/server/api/api.go                | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/backend/plugins/bitbucket/api/scope.go 
b/backend/plugins/bitbucket/api/scope.go
index 42db5a989..c64e400f2 100644
--- a/backend/plugins/bitbucket/api/scope.go
+++ b/backend/plugins/bitbucket/api/scope.go
@@ -119,5 +119,6 @@ func GetScope(input *plugin.ApiResourceInput) 
(*plugin.ApiResourceOutput, errors
 // @Failure 500  {object} shared.ApiBody "Internal Error"
 // @Router /plugins/bitbucket/connections/{connectionId}/scopes/{scopeId} 
[DELETE]
 func DeleteScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, 
errors.Error) {
+       input.Params["scopeId"] = strings.TrimLeft(input.Params["scopeId"], "/")
        return scopeHelper.Delete(input)
 }
diff --git a/backend/plugins/jenkins/api/scope_api.go 
b/backend/plugins/jenkins/api/scope_api.go
index b800feffb..a7c4ea428 100644
--- a/backend/plugins/jenkins/api/scope_api.go
+++ b/backend/plugins/jenkins/api/scope_api.go
@@ -119,5 +119,6 @@ func GetScope(input *plugin.ApiResourceInput) 
(*plugin.ApiResourceOutput, errors
 // @Failure 500  {object} shared.ApiBody "Internal Error"
 // @Router /plugins/jenkins/connections/{connectionId}/scopes/{scopeId} 
[DELETE]
 func DeleteScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, 
errors.Error) {
+       input.Params["scopeId"] = strings.TrimLeft(input.Params["scopeId"], "/")
        return dsHelper.ScopeApi.Delete(input)
 }
diff --git a/backend/server/api/api.go b/backend/server/api/api.go
index f9cfea8c1..a4894cf67 100644
--- a/backend/server/api/api.go
+++ b/backend/server/api/api.go
@@ -74,7 +74,7 @@ func CreateAndRunApiServer() {
 
 func CreateApiServer() *gin.Engine {
        // Create router
-       router := gin.New()
+       router := gin.Default()
 
        // For both protected and unprotected routes
        router.GET("/ping", ping.Get)

Reply via email to