warren830 commented on code in PR #4858:
URL: 
https://github.com/apache/incubator-devlake/pull/4858#discussion_r1161747687


##########
backend/plugins/dora/tasks/change_lead_time_calculator.go:
##########
@@ -123,17 +123,18 @@ func CalculateChangeLeadTime(taskCtx 
plugin.SubTaskContext) errors.Error {
                        }
 
                        // Calculate PR cycle time
-                       projectPrMetric.PrCycleTime = nil
+                       if deployment == nil {
+                               // Return the projectPrMetric with nill cycle 
time
+                               return []interface{}{projectPrMetric}, nil
+                       }
                        var result int64
                        if projectPrMetric.PrCodingTime != nil {
                                result += *projectPrMetric.PrCodingTime
                        }
                        if prDuring != nil {
                                result += *prDuring
                        }
-                       if projectPrMetric.PrDeployTime != nil {
-                               result += *projectPrMetric.PrDeployTime
-                       }
+                       result += *projectPrMetric.PrDeployTime

Review Comment:
                        // Calculate PR cycle time
                        if deployment == nil || projectPrMetric.PrDeployTime == 
nil {
                                // Return the projectPrMetric with nill cycle 
time
                                return []interface{}{projectPrMetric}, nil
                        }



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