d4x1 commented on code in PR #6173:
URL: 
https://github.com/apache/incubator-devlake/pull/6173#discussion_r1349608982


##########
backend/helpers/srvhelper/scope_service_helper.go:
##########
@@ -95,6 +95,22 @@ func (scopeSrv *ScopeSrvHelper[C, S, SC]) 
GetScopeDetail(includeBlueprints bool,
        return scopeDetail, nil
 }
 
+// MapScopeDetails returns scope details (scope and scopeConfig) for the given 
blueprint scopes
+func (scopeSrv *ScopeSrvHelper[C, S, SC]) MapScopeDetails(connectionId uint64, 
bpScopes []*models.BlueprintScope) ([]*ScopeDetail[S, SC], errors.Error) {
+       var err errors.Error
+       scopeDetails := make([]*ScopeDetail[S, SC], len(bpScopes))
+       for i, bpScope := range bpScopes {
+               scopeDetails[i], err = scopeSrv.GetScopeDetail(false, 
connectionId, bpScope.ScopeId)
+               if scopeDetails[i].ScopeConfig == nil {
+                       scopeDetails[i].ScopeConfig = new(SC)
+               }
+               if err != nil {

Review Comment:
   Err should be checked immediately, I think line 107 should be between line 
103 and line 104.



-- 
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