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 31dacd8d4 chore(scope-config): fix scope config query (#8248)
31dacd8d4 is described below

commit 31dacd8d42ce33470e09a8fbea02448a0b2a127f
Author: Kostas Petrakis <[email protected]>
AuthorDate: Tue Jan 14 08:11:47 2025 +0100

    chore(scope-config): fix scope config query (#8248)
    
    * chore(scope-config): fix scope config query
    
    * chore: update notice
---
 NOTICE                                                   | 2 +-
 backend/helpers/srvhelper/scope_config_service_helper.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/NOTICE b/NOTICE
index a39b53446..56815530e 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
 Apache DevLake (incubating)
-Copyright 2022-2024 The Apache Software Foundation
+Copyright 2022-2025 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (https://www.apache.org/).
diff --git a/backend/helpers/srvhelper/scope_config_service_helper.go 
b/backend/helpers/srvhelper/scope_config_service_helper.go
index 6c7e3e05f..7a93492a6 100644
--- a/backend/helpers/srvhelper/scope_config_service_helper.go
+++ b/backend/helpers/srvhelper/scope_config_service_helper.go
@@ -82,7 +82,7 @@ func (scopeConfigSrv *ScopeConfigSrvHelper[C, S, SC]) 
GetProjectsByScopeConfig(p
                dal.Select(fmt.Sprintf("bp.id AS blueprint_id, bp.project_name, 
bps.scope_id, %s.*", scopeTable)),
                dal.From("_devlake_blueprint_scopes bps"),
                dal.Join("LEFT JOIN _devlake_blueprints bp ON (bp.id = 
bps.blueprint_id)"),
-               dal.Join(fmt.Sprintf("LEFT JOIN %s ON (%s.connection_id = 
bps.connection_id AND %s = bps.scope_id)", scopeTable, scopeTable, theOtherPk)),
+               dal.Join(fmt.Sprintf("LEFT JOIN %s ON (%s.connection_id = 
bps.connection_id AND cast(%s as varchar) = bps.scope_id)", scopeTable, 
scopeTable, theOtherPk)),
                dal.Where("bps.plugin_name = ? AND bps.connection_id = ?", 
pluginName, (*scopeConfig).ScopeConfigConnectionId()),
        ))
        projectScopeMap := make(map[string]*models.ProjectScope)

Reply via email to