You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by to...@apache.org on 2022/07/18 12:36:32 UTC
[lucene-jira-archive] branch main updated: show issue title for linked issues (#52)
This is an automated email from the ASF dual-hosted git repository.
tomoko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git
The following commit(s) were added to refs/heads/main by this push:
new e3ec8c74 show issue title for linked issues (#52)
e3ec8c74 is described below
commit e3ec8c748bc6e2887190f4b7c93288da0d31b0af
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Mon Jul 18 21:36:27 2022 +0900
show issue title for linked issues (#52)
---
migration/src/jira2github_import.py | 8 ++++----
migration/src/jira_util.py | 5 +----
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/migration/src/jira2github_import.py b/migration/src/jira2github_import.py
index 3dc644b7..3e9e832b 100644
--- a/migration/src/jira2github_import.py
+++ b/migration/src/jira2github_import.py
@@ -71,12 +71,12 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
# embed github issue number next to linked issue keys
linked_issues_list_items = []
for jira_key in linked_issues:
- linked_issues_list_items.append(f"[{jira_key}]({jira_issue_url(jira_key)})")
+ linked_issues_list_items.append(f"- [{jira_key}]({jira_issue_url(jira_key)})\n")
# embed github issue number next to sub task keys
subtasks_list_items = []
for jira_key in subtasks:
- subtasks_list_items.append(f"[{jira_key}]({jira_issue_url(jira_key)})")
+ subtasks_list_items.append(f"- [{jira_key}]({jira_issue_url(jira_key)})\n")
created_datetime = dateutil.parser.parse(created)
updated_datetime = dateutil.parser.parse(updated)
@@ -109,10 +109,10 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
body += f'\nAttachments: {", ".join(attachment_list_items)}'
if len(linked_issues_list_items) > 0:
- body += f'\nLinked issues: {", ".join(linked_issues_list_items)}'
+ body += f'\nLinked issues:\n {"".join(linked_issues_list_items)}'
if len(subtasks_list_items) > 0:
- body += f'\nSub-tasks: {", ".join(subtasks_list_items)}'
+ body += f'\nSub-tasks:\n {"".join(subtasks_list_items)}'
if len(pull_requests) > 0:
body += f'\nPull requests: {", ".join([str(x) for x in pull_requests])}'
diff --git a/migration/src/jira_util.py b/migration/src/jira_util.py
index 850b440e..cc0c701e 100644
--- a/migration/src/jira_util.py
+++ b/migration/src/jira_util.py
@@ -239,7 +239,6 @@ def embed_gh_issue_link(text: str, issue_id_map: dict[str, str]) -> str:
gh_number = issue_id_map.get(m.group(2))
if gh_number:
res = f"{m.group(1)}#{gh_number}{m.group(3)}"
- # print(res)
return res
def repl_paren(m: re.Match):
@@ -247,7 +246,6 @@ def embed_gh_issue_link(text: str, issue_id_map: dict[str, str]) -> str:
gh_number = issue_id_map.get(m.group(2))
if gh_number:
res = f"{m.group(1)}#{gh_number}{m.group(3)}"
- # print(res)
return res
def repl_bracket(m: re.Match):
@@ -255,7 +253,6 @@ def embed_gh_issue_link(text: str, issue_id_map: dict[str, str]) -> str:
gh_number = issue_id_map.get(m.group(2))
if gh_number:
res = f"#{gh_number}"
- # print(res)
return res
def repl_md_link(m: re.Match):
@@ -263,7 +260,7 @@ def embed_gh_issue_link(text: str, issue_id_map: dict[str, str]) -> str:
gh_number = issue_id_map.get(m.group(1))
if gh_number:
res = f"{m.group(0)} (#{gh_number})"
- print(res)
+ # print(res)
return res
text = re.sub(r"(\s)(LUCENE-\d+)([\s,\?\!\.])", repl_simple, text)