日志丰富功能 #20

Open
huaijin wants to merge 53 commits from qinxinqi/reposync:huaijin into master
2 changed files with 15 additions and 21 deletions
Showing only changes of commit edeacee59c - Show all commits

View File

@ -123,7 +123,7 @@ class GitLinkIssueParser:
return {
'number': parsed['number'],
'title': parsed['title'],
'body': f"从GitLink同步的Issue\n\n原Issue ID: {parsed['id']}\n\n{parsed['body']}",
'body': parsed['body'],
'state': parsed['state'],
'user': parsed['author'],
'assignees': parsed['assignees'],
@ -140,7 +140,7 @@ class GitLinkIssueParser:
return {
'number': parsed['number'],
'title': parsed['title'],
'body': f"从GitLink同步的Issue\n\n原Issue ID: {parsed['id']}\n\n{parsed['body']}",
'body': parsed['body'],
'state': parsed['state'],
'user': parsed['author'],
'assignee': parsed['assignees'][0] if parsed['assignees'] else None,

View File

@ -262,7 +262,7 @@ class IssueSyncService:
return True
# 创建新Issue
body = f"从GitHub同步的Issue\n\n原Issue ID: {github_issue.get('number')}\n\n{github_issue.get('body', '')}"
body = github_issue.get('body', '')
new_issue = gitlink_client.create_issue(title=title, description=body)
if new_issue:
@ -349,7 +349,7 @@ class IssueSyncService:
return True
# 创建新Issue
body = f"从Gitee同步的Issue\n\n原Issue ID: {gitee_issue.get('number')}\n\n{gitee_issue.get('body', '')}"
body = gitee_issue.get('body', '')
new_issue = gitlink_client.create_issue(title=title, description=body)
if new_issue:
@ -390,7 +390,7 @@ class IssueSyncService:
return True
# 创建新Issue
body = f"从GitHub同步的Issue\n\n原Issue ID: {github_issue.get('number')}\n\n{github_issue.get('body', '')}"
body = github_issue.get('body', '')
new_issue = gitee_client.create_issue(title=title, body=body)
if new_issue:
@ -416,7 +416,7 @@ class IssueSyncService:
return True
# 创建新Issue
body = f"从Gitee同步的Issue\n\n原Issue ID: {gitee_issue.get('number')}\n\n{gitee_issue.get('body', '')}"
body = gitee_issue.get('body', '')
new_issue = github_client.create_issue(title=title, body=body)
if new_issue:
@ -586,13 +586,11 @@ class IssueSyncService:
if not comment_body:
continue
# 添加同步标识和原始信息
author_name = comment.get('user', {}).get('login', 'Unknown')
created_at = comment.get('created_at', '')
sync_body = f"**[从{source_platform}同步]** @{author_name}{created_at}\n\n{comment_body}"
# 直接使用原始评论内容,不添加同步标识
sync_body = comment_body
# 检查是否已存在类似评论(避免重复同步)
if sync_body not in existing_contents and comment_body not in existing_contents:
if sync_body not in existing_contents:
new_comment = target_client.create_issue_comment(target_issue_number, sync_body)
if new_comment:
success_count += 1
@ -631,13 +629,11 @@ class IssueSyncService:
if not comment_body:
continue
# 添加同步标识和原始信息
author_name = comment.get('user', {}).get('name', 'Unknown')
created_at = comment.get('created_at', '')
sync_body = f"**[从{source_platform}同步]** @{author_name}{created_at}\n\n{comment_body}"
# 直接使用原始评论内容,不添加同步标识
sync_body = comment_body
# 检查是否已存在类似评论(避免重复同步)
if sync_body not in existing_contents and comment_body not in existing_contents:
if sync_body not in existing_contents:
new_comment = target_client.create_issue_comment(target_issue_number, sync_body)
if new_comment:
success_count += 1
@ -676,13 +672,11 @@ class IssueSyncService:
if not comment_body:
continue
# 添加同步标识和原始信息
author_name = comment.get('user', {}).get('login', 'Unknown')
created_at = comment.get('created_at', '')
sync_body = f"**[从{source_platform}同步]** @{author_name}{created_at}\n\n{comment_body}"
# 直接使用原始评论内容,不添加同步标识
sync_body = comment_body
# 检查是否已存在类似评论(避免重复同步)
if sync_body not in existing_contents and comment_body not in existing_contents:
if sync_body not in existing_contents:
new_comment = gitlink_client.create_issue_comment(gitlink_issue_index, sync_body)
if new_comment:
success_count += 1