abeizn commented on code in PR #4985:
URL: 
https://github.com/apache/incubator-devlake/pull/4985#discussion_r1174502779


##########
backend/python/plugins/azuredevops/azuredevops/streams/pull_request_commits.py:
##########
@@ -35,22 +35,11 @@ def collect(self, state, context, parent: GitPullRequest) 
-> Iterable[tuple[obje
             raw_commit["pull_request_id"] = parent.domain_id()
             yield raw_commit, state
 
-    def extract(self, raw_data: dict) -> GitPullRequestCommit:
-        return GitPullRequestCommit(
-            **raw_data,
-            commit_sha = raw_data["commitId"],
-            author_name = raw_data["author"]["name"],
-            author_email = raw_data["author"]["email"],
-            authored_date = raw_data["author"]["date"],
-            committer_name = raw_data["committer"]["name"],
-            committer_email = raw_data["committer"]["email"],
-            commit_date = raw_data["committer"]["date"],
-            additions = raw_data["changeCounts"]["Add"] if "changeCounts" in 
raw_data else 0,
-            deletions = raw_data["changeCounts"]["Delete"] if "changeCounts" 
in raw_data else 0
-        )
-
     def convert(self, commit: GitPullRequestCommit, context) -> 
Iterable[code.PullRequestCommit]:
         yield code.PullRequestCommit(
-            commit_sha=commit.commit_sha,
+            commit_sha=commit.commit_id,
             pull_request_id=commit.pull_request_id,
+            commit_authored_name=commit.author_name,
+            commit_authored_email=commit.author_email,

Review Comment:
   Sorry Camille, These two fields have been updated to `commit_author_name` 
and `commit_author_email`. 
   
   pull_request_commits table schema:
   
   TABLE pull_request_commits (
   commit_sha varchar(40) COLLATE utf8mb4_bin NOT NULL,
   pull_request_id varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT 'This key 
is generated based on details from the original plugin',
   created_at datetime(3) DEFAULT NULL,
   updated_at datetime(3) DEFAULT NULL,
   _raw_data_params varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   _raw_data_table varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   _raw_data_id bigint unsigned DEFAULT NULL,
   _raw_data_remark longtext COLLATE utf8mb4_bin,
   commit_authored_date datetime(3) DEFAULT NULL,
   commit_author_name varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   commit_author_email varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
   PRIMARY KEY (commit_sha,pull_request_id),
   KEY idx_pull_request_commits_raw_data_params (_raw_data_params)
   )



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