[Bug][github_graphql] Incorrect dora calculation based on github deployments updated_at #8302
Open
2 of 3 tasks
Labels
component/plugins
This issue or PR relates to plugins
devops
Something about CI/CD (devops)
type/bug
This issue is a bug
Search before asking
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
incubator-devlake/backend/plugins/github_graphql/tasks/deployment_convertor.go
Line 93 in e061ef2
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)
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
Anything else
No response
Version
v1.0.1
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: