[Bug][DORA-change_lead_time_calculator] Wrong deployment reference #8188
Labels
devops
Something about CI/CD (devops)
severity/p1
This bug affects functionality or significantly affect ux
type/bug
This issue is a bug
Search before asking
What happened
While analyzing the data gathered from our GitHub integration, I stumbled upon an anomaly in a minor subset of deployments. Oddly enough, some deployments were reporting a deployment of incosistent time (in my example 30 weeks).
Given my familiarity with our GitHub operations, I was certain this wasn't accurate, prompting me to dig deeper. My investigation points towards a potential issue with the
getDeploymentCommit
function, particularly in relation toEnrichPrevSuccessDeploymentCommit
.To illustrate, I've attached an example PR
As you can see this PR was merged
2024-04-05 09:00:16
yet the deployment linked is incorrect, as it belongs to a different deployment.Manually checking in the
cicd_deployment_commits
for themerge_commit_sha
(b297c73092685c4b1a0ee62c2326d77115a86e94
) I can see that the deployment is there:Upon inspection, I've noticed that the
prev_success_deployment_commit_id
field is empty in our data. I suspect this might be influencing the results of the query in thechange_lead_time_calculator.go
module.I'm uncertain if the query should return
null
when faced with this condition, given thatprev_success_deployment_commit_id
is consistently empty for the first deployment recorded for the cicd_scope_id/repo_url/env grouping, as per code.Interestingly, the linked "deployment_commit_id" : "github:GithubRun:4:435823930:11612162783 is the final entry in the cicd_deployment_commits table for the cicd_scope_id/repo_url/env grouping.
What do you expect to happen
PR deployment should be linked to the proper run for this example (
github:GithubRun:4:435823930:8567339272:https:\/\/github.com\/l*****\/****
)How to reproduce
I will just describe what the status of that repo is, GitHub, deployment through CI/CD workflow, explore for the first PR deployment recorded by Devlake and evaluate the linked deployment.
This issue is only related to the first deployment for each cicd_scope_id/repo_url/env grouping.
Anything else
No response
Version
v1.0.1@e061ef2
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: