sungkangaw opened a new issue, #8302:
URL: https://github.com/apache/incubator-devlake/issues/8302

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   We currently sync deployment data using github deployments. When the 
deployment is the latest deployment (active), there is no problem. But when 
syncing historical deployment data i.e. projects have run for some time and we 
are just setting up devlake project for it or recollect data in full refresh 
mode, we notice that incidents are not matched to the right deployments, lead 
time is not correct, consequently then also change failure rate and recovery 
time.
   
   After looking through the code, we found out for github deployments, 
finished_date (which is the basis of all dora calculation) is mapped to github 
deployment updated_at here
   
https://github.com/apache/incubator-devlake/blob/e061ef223a93a28d88bb1238a0acd7d29f39f2b6/backend/plugins/github_graphql/tasks/deployment_convertor.go#L93
 
   For latest deployment this is no issue.
   But for old deployment, the updated_at can be the date that status is 
changed to inactive (changed when there is a new active deployment)
   
![Image](https://github.com/user-attachments/assets/6dcec992-a9da-438e-be3d-e439b76c42ef)
   
   This result in wrong calculation of dora as updated_at is not the actual 
finished_date of the deployment.
   
   
   ### What do you expect to happen
   
   Correct calculation of dora. 
   We are not quite sure yet, but my proposal would be instead of using 
updated_at field of github deployment object. The graphql query should retrieve 
the last status where state = success and use updated_at of the status instead. 
This way the actual finished_date of when status is success is captured.
   But please make a suggest if there is any better solution.
   
   ### How to reproduce
   
   1. Sync github deployments data. Make sure your repo have a few deployments 
already.
   2. Check the finished_date of these deployments. It is usually around the 
time of the created_date of the next deployment and also check dora graph.
   
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   v1.0.1
   
   ### Are you willing to submit 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