passtas commented on code in PR #8206:
URL: 
https://github.com/apache/incubator-devlake/pull/8206#discussion_r1993453354


##########
backend/plugins/bitbucket/tasks/pipeline_extractor.go:
##########
@@ -103,8 +103,10 @@ func ExtractApiPipelines(taskCtx plugin.SubTaskContext) 
errors.Error {
                                DurationInSeconds:   
bitbucketApiPipeline.DurationInSeconds,
                                BitbucketCreatedOn:  
common.Iso8601TimeToTime(bitbucketApiPipeline.CreatedOn),
                                BitbucketCompleteOn: 
common.Iso8601TimeToTime(bitbucketApiPipeline.CompletedOn),
-                               Type:                
data.RegexEnricher.ReturnNameIfMatched(devops.DEPLOYMENT, 
bitbucketApiPipeline.Target.RefName),
-                               Environment:         
data.RegexEnricher.ReturnNameIfOmittedOrMatched(devops.PRODUCTION, 
bitbucketApiPipeline.Target.RefName),
+                       }
+                       if data.Options.DeploymentPattern != nil || 
data.Options.ProductionPattern != nil {
+                               bitbucketPipeline.Type = 
data.RegexEnricher.ReturnNameIfMatched(devops.DEPLOYMENT, 
bitbucketApiPipeline.Target.RefName)
+                               bitbucketPipeline.Environment = 
data.RegexEnricher.ReturnNameIfOmittedOrMatched(devops.PRODUCTION, 
bitbucketApiPipeline.Target.RefName)

Review Comment:
   One of the issues we are encountering is that it is always assumed that 
pipeline execution has been performed for Production. Reality is, that likely 
pipeline has been executed before actual deployment to production, i.e. PR or 
commit linting, so those pipelines are then counted as actual deployments in 
DORA dashboards, while such actions are not even considered as a builds.
   
   P.S.: While it wasn't introduced in this specific PR. It may worth starting 
the discussion around this approach. It may worth creating separate issue.



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