klesh commented on code in PR #5501:
URL: 
https://github.com/apache/incubator-devlake/pull/5501#discussion_r1233719570


##########
backend/plugins/gitlab/tasks/mr_extractor.go:
##########
@@ -51,6 +51,8 @@ type MergeRequestRes struct {
        MergedAt        *api.Iso8601Time `json:"merged_at"`
        ClosedAt        *api.Iso8601Time `json:"closed_at"`
        MergeCommitSha  string           `json:"merge_commit_sha"`
+       SquashCommitSha string           `json:"squash_commit_sha"`
+       DiffHeadSha     string           `json:"diff_head_sha"`

Review Comment:
   For DORA metric to work, we need to check if a PR is included in the 
deployment by looking up the commit sha(s) of the PR  in the deployed commit 
sha history.
   
   For `merge` and `squash`, the original commits (pr commits) may NOT exist in 
the deployed commit history, like squashing into one commit and throwing away 
the original commits. So, we should still prefer the `merge_commit_sha` and 
`squash_commit_sha`.
   
   However, for cases where `merge_commit_sha` and `squash_commit_sha` are both 
empty, it means the source branch was simply reset to the `sha`, so it would be 
included in the history and it should work for DORA metric.
   
   



-- 
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