nes-a-cti opened a new issue, #5909:
URL: https://github.com/apache/incubator-devlake/issues/5909

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and 
found no similar feature requirement.
   
   
   ### Use case
   
   For Github repo, if the PR is merged with "Squash And Commit" mode, the 
deploy_time is showing as null
   
   ### Description
   
   While investigating, it is found that `PR Deploy Time` is calculated by 
matching the column value of `commit_sha` of table `commits_diffs` (which was 
joined by `commit_sha` of `cicd_deployment_commits` table) with column value of 
`merge_commit_sha`  of table `pull_requests` as shown in below screen shot.
   
   <img width="1167" alt="screenshot1" 
src="https://github.com/apache/incubator-devlake/assets/1773811/3a72c4be-d369-49a0-83f0-ffbbb1363b75";>
   
   However, for the given pull_request, the column value of `commit_sha` of 
table `cicd_deployment_commits` has the column value of `head_commit_sha` of 
table  `pull_requests` and not column value of `merge_commit_sha`.  As shown in 
following screen shots
   
   <img width="1622" alt="Screenshot2" 
src="https://github.com/apache/incubator-devlake/assets/1773811/ce3ed8ab-b489-49cd-8332-0cad8f04c915";>
   
   <img width="1635" alt="Screenshot3" 
src="https://github.com/apache/incubator-devlake/assets/1773811/327bcb2c-6635-408d-9c6a-d72a40dd67c7";>
   
   So the condition in screen shot 1 is never met and hence the PR Deploy Time 
is always zero.
   
   As `pr_deploy` time not calculated, `pr_cycle` time is also not calculated. 
As shown below, pr_cycle time is calculated only if `pr_deploy` time is not 
nil. 
   
   <img width="1073" alt="screenshot5" 
src="https://github.com/apache/incubator-devlake/assets/1773811/210d0395-5aaf-497d-be2f-c80e5542df78";>
   
   As `PR Cycle Time` not calculated, `Median Lead Time To Change` in DORA 
metrics is also not showing as it calculated on `PR Cycle Time`.
   
   So may relax above condition to calculate the pr_cycle time even if the 
pr_deploy time is nil if the PR is merged with `Squash and Merge` mode ?
   
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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