You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@devlake.apache.org by "kostas-petrakis (via GitHub)" <gi...@apache.org> on 2024/11/12 13:06:19 UTC

[I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

kostas-petrakis opened a new issue, #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188

   ### 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
   
   I was evaluating the data collected from the GitHub integration when I noticed an issue with a small subset of deployments, more specifically some deployments reported a deployment time of 30 weeks.
   Since I knew from GitHub itself that this was not the case I started investigating and I feel there is an issue with the `getDeploymentCommit` functionality related to `EnrichPrevSuccessDeploymentCommit`.
   For example the following is the PR I used for the investigation:
   ```
   {
   "pull_requests": [
   	{
   		"id" : "github:GithubPullRequest:4:1806504909",
   		"created_at" : "2024-11-12 08:34:13.134",
   		"updated_at" : "2024-11-12 08:34:13.134",
   		"_raw_data_params" : "{\"ConnectionId\":4,\"Name\":\"********\"}",
   		"_raw_data_table" : "_raw_github_api_pull_requests",
   		"_raw_data_id" : 4499,
   		"_raw_data_remark" : "",
   		"base_repo_id" : "github:GithubRepo:4:***********",
   		"base_ref" : "main",
   		"base_commit_sha" : "a51af0dabd2d9e9bd7b23e432688842cf086c248",
   		"head_repo_id" : "github:GithubRepo:4:*******",
   		"head_ref" : "feature\***************",
   		"head_commit_sha" : "e6a73f3095d1c97d4d4576e3c06719fb07938bd1",
   		"merge_commit_sha" : "b297c73092685c4b1a0ee62c2326d77115a86e94",
   		"status" : "MERGED",
   		"original_status" : "closed",
   		"type" : "",
   		"component" : "",
   		"title" : "****************************",
   		"description" : "null",
   		"url" : "https:\/\/github.com\/******\/*******\/pull\/1025",
   		"author_name" : "***************",
   		"author_id" : "github:GithubAccount:4:***********",
   		"parent_pr_id" : "",
   		"pull_request_key" : 1025,
   		"created_date" : "2024-04-04 09:08:03",
   		"merged_date" : "2024-04-05 09:00:16",
   		"closed_date" : "2024-04-05 09:00:16",
   		"additions" : 0,
   		"deletions" : 0,
   		"merged_by_name" : "",
   		"merged_by_id" : "github:GithubAccount:4:0",
   		"is_draft" : 0
   	}
   ]}
   ```
   As you can see this PR was merged `2024-04-05 09:00:16` yet the deployment linked is incorrect:
   ```
   {
   "project_pr_metrics": [
   	{
   		"id" : "github:GithubPullRequest:4:1806504909",
   		"created_at" : "2024-11-12 08:38:29.797",
   		"updated_at" : "2024-11-12 08:38:29.797",
   		"_raw_data_params" : "",
   		"_raw_data_table" : "",
   		"_raw_data_id" : 0,
   		"_raw_data_remark" : "",
   		"project_name" : "adoption_and_collaboration_tribe",
   		"first_commit_sha" : "3726ef9fce54e1f95717ab0fbe695403cbf850ff",
   		"pr_coding_time" : 1,
   		"first_review_id" : "github:GithubPrReview:4:******",
   		"pr_pickup_time" : 4,
   		"pr_review_time" : 1429,
   		"deployment_commit_id" : "github:GithubRun:4:435823930:11612162783:https:\/\/github.com\/*****\/****",
   		"pr_deploy_time" : 301201,
   		"pr_cycle_time" : 302635,
   		"first_commit_authored_date" : "2024-04-04 09:07:51",
   		"pr_created_date" : "2024-04-04 09:08:03",
   		"first_comment_date" : "2024-04-04 09:11:44",
   		"pr_merged_date" : "2024-04-05 09:00:16",
   		"pr_deployed_date" : "2024-10-31 13:00:17"
   	}
   ]}
   ```
   Manually checking in the `cicd_deployment_commits` for the `merge_commit_sha` (`b297c73092685c4b1a0ee62c2326d77115a86e94`) I can see that the deployment is there:
   ```
   {
   "cicd_deployment_commits": [
   	{
   		"id" : "github:GithubRun:4:435823930:8567339272:https:\/\/github.com\/l*****\/****",
   		"created_at" : "2024-11-12 11:17:32.066",
   		"updated_at" : "2024-11-12 11:17:33.602",
   		"_raw_data_params" : "{\"ConnectionId\":4,\"Name\":\"*****\/****\"}",
   		"_raw_data_table" : "_raw_github_api_runs",
   		"_raw_data_id" : 2338,
   		"_raw_data_remark" : "prev_deployment_commit_id_enricher,",
   		"cicd_scope_id" : "github:GithubRepo:4:435823930",
   		"cicd_deployment_id" : "github:GithubRun:4:435823930:8567339272",
   		"name" : "CI\/CD",
   		"result" : "SUCCESS",
   		"original_result" : "success",
   		"status" : "DONE",
   		"original_status" : "completed",
   		"environment" : "PRODUCTION",
   		"original_environment" : "",
   		"created_date" : "2024-04-05 09:00:19",
   		"queued_date" : null,
   		"queued_duration_sec" : null,
   		"started_date" : "2024-04-05 09:00:19",
   		"finished_date" : "2024-04-05 09:14:22",
   		"duration_sec" : 843.0,
   		"commit_sha" : "b297c73092685c4b1a0ee62c2326d77115a86e94",
   		"ref_name" : "main",
   		"repo_id" : "github:GithubRepo:4:435823930",
   		"repo_url" : "https:\/\/github.com\/*****\/****",
   		"prev_success_deployment_commit_id" : "",
   		"commit_msg" : "",
   		"subtask_name" : "dora.generateDeploymentCommits",
   		"display_title" : "Merge pull request #1025 from *****\/****",
   		"url" : "https:\/\/github.com\/*****\/****/actions\/runs\/8567339272"
   	}
   ]}
   ```
   As you notice the `prev_success_deployment_commit_id` is empty here, which I think affects the results of the [query](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/dora/tasks/change_lead_time_calculator.go#L221) in the `change_lead_time_calculator.go` module, I am not sure if that query should return null in this condition, as the `prev_success_deployment_commit_id` is empty always (?) for the first deployment recorded for the repo for the given time period (6 months) according to the [code](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/dora/tasks/prev_deployment_commit_enricher.go#L99) grouping.
   The linked `"deployment_commit_id" : "github:GithubRun:4:435823930:11612162783`  is actually the last 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?
   
   - [ ] 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: dev-unsubscribe@devlake.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "nicolavolpini (via GitHub)" <gi...@apache.org>.
nicolavolpini commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2862129754

   Hello @kostas-petrakis , we are also keeping track of this ticket since we are affected.
   Have you found out anything more about your affected PRs? Thanks.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "marktuckcp (via GitHub)" <gi...@apache.org>.
marktuckcp commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2642276275

   We've been tracking this and it's still an issue for us! Although we're transitioning over to Github Actions we still have a lot of teams using Github for commits and an old Jenkins set up for deploy. Where devlake is finding PRs within Github but can't find a corresponding deploy it's choosing (we think) the first and so earliest deploy available to it, creating massive data skews of 10s of weeks. 
   
   If there is a PR that says it's been deployed but devlake can't find a deploy job we'd expect it to just not include that PR at all


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "kostas-petrakis (via GitHub)" <gi...@apache.org>.
kostas-petrakis commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2684241079

   We are in the process of analyzing some of the PRs that have been  wrongly mapped to non relevant deployments. This is likely due to the previously mentioned query, which appears to be producing inaccurate results during transformation. We are currently investigating affected PRs.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "petkostas (via GitHub)" <gi...@apache.org>.
petkostas commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-3446292242

   Will test next week


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "nicolavolpini (via GitHub)" <gi...@apache.org>.
nicolavolpini commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2865521489

   Hello Kostas, thanks for the update. We are on `v1.0.2-beta7`.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "hera-a-glitch (via GitHub)" <gi...@apache.org>.
hera-a-glitch commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2904263681

   I am seeing similar behaviour although a different use case. 
   
   We have historic PRs that do not have any deployment commits associated. 
   
   During testing I noticed that all historic PRs without  a associated deployment  can be simultaneously populated by a deployment commit ID that has no link to it. 
   
   This doesnt happen all the time so I am investigating what might trigger it. 
   
   I thought looking at the GO code that there would have to be a merge commit hash match for a deployment commit ID to associate with a pull requesr in project PR metrics.
   
   This is hugely annoying for our usecase as it completely skews the median lead time for change.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "kostas-petrakis (via GitHub)" <gi...@apache.org>.
kostas-petrakis commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2904545532

   Following up on this issue now that we've resolved the more urgent missing DORA calculations.
   I can confirm that we're still seeing the same behavior on some of the newly onboarded services. As @hera-a-glitch  pointed out, the behavior isn't entirely consistent—likely due to recalculation of DORA? (need to check)
   From what I’ve observed, this issue only affects the first batch of collected commits. The current logic attempts to find a previous deployment; if none is found, it links the PR deployment to the latest available one (if I’m recalling the behavior correctly).
   I'll dig deeper into this and explore potential solutions. Thanks for your patience!


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #8188: [Bug][DORA-change_lead_time_calculator] Wrong deployment reference
URL: https://github.com/apache/incubator-devlake/issues/8188


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-3703103018

   This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "Startrekzky (via GitHub)" <gi...@apache.org>.
Startrekzky commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2503573757

   Hi @kostas-petrakis , I saw your PR https://github.com/apache/incubator-devlake/pull/8206
   
   
   one of DevLake's strategies of `PR-deployment_commit` mapping is to skip the mapping of the very first `deployment_commit` in DevLake. Why? 
   
   Because in many cases, 
   1. Users will collect both `PRs` and `deployment_commits` within a selected timeframe.
   2. When finding a PR's associated deployment_commit, we need to diff the commits between every consecutive deployment_commits, which means we don't know the `precise commits` deployed by the very first deployment_commit collected by DevLake.
   3. Hence, we don't know the PRs deployed by the very first deployment_commit.
   
   In your case, the PR `github:GithubPullRequest:4:1806504909` might be deployed by the first deployement_commit `github:GithubRun:4:435823930:8567339272:https:\/\/github.com\/l*****\/****` for sure.
   
   However, if we allow the first deployment_commit mapped to PRs. If the `deploy time` between the prior deployment to the first deployment collected by DevLake, many irrelevant PRs merged during this period will be mis-mapped to the deployment commit (some other users had encountered the problem).
   
   Finally, we adopted the above strategy of excluding the very first deployment when mapping to PR.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-3105234361

   This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-3690648363

   This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-3445318261

   This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2629647287

   This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "marktuckcp (via GitHub)" <gi...@apache.org>.
marktuckcp commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2751382217

   Appreciate it @kostas-petrakis ! We'll keep an eye on this thread, thanks


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-3134492047

   This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "Startrekzky (via GitHub)" <gi...@apache.org>.
Startrekzky commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-3218795086

   Hi @petkostas , thanks for the proposal. I'll discuss with @klesh to figure out how to optimize this part.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "petkostas (via GitHub)" <gi...@apache.org>.
petkostas commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-3217084639

   I am re-opening this as it is still affecting some of our repositories and raising questions from engineering teams.
   I took some time to think about a possible approach which would possibly reduce the effect.
   @Startrekzky 
   I am thinking of the following approach:
   
   Adjust `getDeploymentCommit` to use a two-phase strategy:
     - Direct match: if there exists a successful PRODUCTION deployment in the project whose `commit_sha` equals the PR’s merge commit, return it. This is precise and does not risk the first-deployment over-mapping problem.
     - Fallback to diff-based mapping: retain the current strategy (including the filter `dc.prev_success_deployment_commit_id <> ''`) to avoid mapping to the first deployment via diffs.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "kostas-petrakis (via GitHub)" <gi...@apache.org>.
kostas-petrakis commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2863761143

   Hi @nicolavolpini I have to revisit this issue, as my original tests were performed over older versions of Apache Devlake locally. Since then we deployed `v1.0.2-beta4` for "production" use. I will try to run a local experiment at some point and see if this case is still applicable.
   Could you share which version of Apache Devlake you have deployed?
   


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "kostas-petrakis (via GitHub)" <gi...@apache.org>.
kostas-petrakis commented on issue #8188:
URL: https://github.com/apache/incubator-devlake/issues/8188#issuecomment-2517669470

   @Startrekzky thanks for the explanation. However, in my specific use case (and I assume to others looking at the upvotes), I've observed that PRs associated with the initial recorded commit are being mapped to an incorrect deployment. This seems to introduce a different kind of mis-mapping issue, which affects the accuracy of our metrics and analyses (as explained with the data above).
   I'm wondering if there might be a way to refactor the PR-deployment mapping process to handle this situation more accurately.


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][DORA-change_lead_time_calculator] Wrong deployment reference [incubator-devlake]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #8188: [Bug][DORA-change_lead_time_calculator] Wrong deployment reference
URL: https://github.com/apache/incubator-devlake/issues/8188


-- 
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-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org