dosubot[bot] commented on issue #8188: URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2470491718
<!-- Greeting --> Hello @kostas-petrakis! I'm here to help you with any bugs, questions, or contributions you have. Let me know how I can assist you while we wait for a human maintainer. <!-- Answer --> The issue you're encountering seems to be related to how the `getDeploymentCommit` function handles cases where the `prev_success_deployment_commit_id` is empty. This situation typically occurs for the first deployment in a `cicd_scope_id/repo_url/env` grouping, as the `EnrichPrevSuccessDeploymentCommit` function resets this field to an empty string for the first deployment in a new set of consecutive deployments <sup>[[1]](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/dora/tasks/prev_deployment_commit_enricher.go)</sup>. In the `change_lead_time_calculator.go` module, the logic for selecting the deployment commit might not be correctly handling cases where `prev_success_deployment_commit_id` is empty, leading to incorrect deployment references being linked. This could explain why the deployment time is inaccurately reported as 30 weeks. To address this, you might need to adjust the logic in the `getDeploymentCommit` function to ensure it correctly identifies and links the first deployment in such groupings. This could involve modifying the query to account for cases where `prev_success_deployment_commit_id` is empty and ensuring it selects the appropriate deployment commit for the first deployment scenario. Since this issue is specific to the first deployment in each grouping, reviewing and potentially updating the logic in both the `getDeploymentCommit` and `EnrichPrevSuccessDeploymentCommit` functions to handle these edge cases more effectively would be a good starting point. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* -- 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: dev-unsubscr...@devlake.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org