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/23 11:06:20 UTC
[lucene-jira-archive] 01/01: preserve Jira 'Labels'
This is an automated email from the ASF dual-hosted git repository.
tomoko pushed a commit to branch preserve-jira-labels
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git
commit 80f69b10183a8602107afd247a36b5cbe37181cc
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sat Jul 23 20:06:10 2022 +0900
preserve Jira 'Labels'
---
migration/src/jira2github_import.py | 5 ++++-
migration/src/jira_util.py | 4 ++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/migration/src/jira2github_import.py b/migration/src/jira2github_import.py
index 8e9779cf..b87cacd0 100644
--- a/migration/src/jira2github_import.py
+++ b/migration/src/jira2github_import.py
@@ -54,7 +54,8 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
attachments = extract_attachments(o)
linked_issues = extract_issue_links(o)
subtasks = extract_subtasks(o)
- pull_requests =extract_pull_requests(o)
+ pull_requests = extract_pull_requests(o)
+ jira_labels = extract_labels(o)
reporter_gh = account_map.get(reporter_name)
reporter = f"{reporter_dispname} (@{reporter_gh})" if reporter_gh else f"{reporter_dispname}"
@@ -185,6 +186,8 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
labels.append(l)
else:
logger.error(f"Unknown Component: {c}")
+ for label in jira_labels:
+ labels.append(f"legacy-jira-label:{label}")
data = {
"issue": {
diff --git a/migration/src/jira_util.py b/migration/src/jira_util.py
index 934b2069..7595187e 100644
--- a/migration/src/jira_util.py
+++ b/migration/src/jira_util.py
@@ -79,6 +79,10 @@ def extract_components(o: dict) -> list[str]:
return [x.get("name", "") for x in o.get("fields").get("components", [])]
+def extract_labels(o: dict) -> list[str]:
+ return o.get("fields").get("labels", [])
+
+
def extract_attachments(o: dict) -> list[tuple[str, int]]:
attachments = o.get("fields").get("attachment")
if not attachments: