From cdb2e56fe4b59e3a06957d0988fd78909db3a82a Mon Sep 17 00:00:00 2001 From: Andrew Brain Date: Tue, 15 Oct 2024 18:26:02 -0500 Subject: [PATCH] set repo_id on gitlab comments --- augur/application/db/data_parse.py | 3 ++- augur/tasks/gitlab/issues_task.py | 2 +- augur/tasks/gitlab/merge_request_task.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/augur/application/db/data_parse.py b/augur/application/db/data_parse.py index 219c09c0e7..f1d0fdff50 100644 --- a/augur/application/db/data_parse.py +++ b/augur/application/db/data_parse.py @@ -1151,7 +1151,7 @@ def extract_needed_gitlab_issue_message_ref_data(message: dict, issue_id: int, r return message_ref_dict -def extract_needed_gitlab_message_data(comment: dict, platform_id: int, tool_source: str, tool_version: str, data_source: str): +def extract_needed_gitlab_message_data(comment: dict, platform_id: int, repo_id: int, tool_source: str, tool_version: str, data_source: str): """ Extract specific metadata for a comment from an api response and connect it to the relevant platform id. @@ -1169,6 +1169,7 @@ def extract_needed_gitlab_message_data(comment: dict, platform_id: int, tool_sou """ comment_dict = { + "repo_id": repo_id, "pltfrm_id": platform_id, "msg_text": comment['body'], "msg_timestamp": comment['created_at'], diff --git a/augur/tasks/gitlab/issues_task.py b/augur/tasks/gitlab/issues_task.py index fe210a9f29..391f981d3b 100644 --- a/augur/tasks/gitlab/issues_task.py +++ b/augur/tasks/gitlab/issues_task.py @@ -319,7 +319,7 @@ def process_gitlab_issue_messages(data, task_name, repo_id, logger, session): } message_dicts.append( - extract_needed_gitlab_message_data(message, platform_id, tool_source, tool_version, data_source) + extract_needed_gitlab_message_data(message, platform_id, repo_id, tool_source, tool_version, data_source) ) contributors = remove_duplicate_dicts(contributors) diff --git a/augur/tasks/gitlab/merge_request_task.py b/augur/tasks/gitlab/merge_request_task.py index cdcd27a387..fd4674c3f5 100644 --- a/augur/tasks/gitlab/merge_request_task.py +++ b/augur/tasks/gitlab/merge_request_task.py @@ -244,7 +244,7 @@ def process_gitlab_mr_messages(data, task_name, repo_id, logger, session): } message_dicts.append( - extract_needed_gitlab_message_data(message, platform_id, tool_source, tool_version, data_source) + extract_needed_gitlab_message_data(message, platform_id, repo_id, tool_source, tool_version, data_source) ) contributors = remove_duplicate_dicts(contributors)