This is an automated email from the ASF dual-hosted git repository. klesh pushed a commit to branch kw-jks-clean-data-404 in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit c7d239ce375562f22c4937b07f11ec6efd92c63d Author: Klesh Wong <[email protected]> AuthorDate: Fri Dec 29 17:29:01 2023 +0800 fix: delete and clean scope not working for jenkins --- 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)
