klesh commented on code in PR #5153:
URL: 
https://github.com/apache/incubator-devlake/pull/5153#discussion_r1191295841


##########
backend/helpers/pluginhelper/api/scope_helper.go:
##########
@@ -207,24 +243,53 @@ func (c *ScopeApiHelper[Conn, Scope, Tr]) 
GetScopeList(input *plugin.ApiResource
        if err != nil {
                return nil, err
        }
+       if params.loadBlueprints {
+               if len(scopeIdFieldName) == 0 {
+                       return nil, errors.Default.New("scope Id field name is 
not known") //temporary, limited solution until I properly refactor all of this 
in another PR
+               }
+               scopesById := c.mapByScopeId(apiScopes, scopeIdFieldName[0])
+               var scopeIds []string
+               for id := range scopesById {
+                       scopeIds = append(scopeIds, id)
+               }
+               blueprintMap, err := 
c.bpManager.GetBlueprintsByScopes(scopeIds...)

Review Comment:
   Pardon?  Did you mean both?
   `ScopeId` itself is not sufficient to identify a scope, it should be used 
with `connectionId`, shouldn't it?
   
![image](https://github.com/apache/incubator-devlake/assets/61080/e18102c7-755f-446e-8bf1-c83af8874350)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to