Skip to content

Commit

Permalink
Merge pull request #2937 from chaoss/set-repo-id-gitlab-comments
Browse files Browse the repository at this point in the history
Add repo_id on gitlab comments
  • Loading branch information
sgoggins authored Oct 15, 2024
2 parents 4d6293c + cdb2e56 commit ea5786a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion augur/application/db/data_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion augur/tasks/gitlab/issues_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion augur/tasks/gitlab/merge_request_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ea5786a

Please sign in to comment.