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/24 10:48:00 UTC
[lucene-jira-archive] branch main updated: port 'Resolution' as a label (#73)
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 17f8d488 port 'Resolution' as a label (#73)
17f8d488 is described below
commit 17f8d488615dbf8abbc22fe9dc7208ee3bb35f45
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sun Jul 24 19:47:56 2022 +0900
port 'Resolution' as a label (#73)
---
migration/src/jira2github_import.py | 3 +++
migration/src/jira_util.py | 7 +++++++
2 files changed, 10 insertions(+)
diff --git a/migration/src/jira2github_import.py b/migration/src/jira2github_import.py
index e7c4080b..eefc59e2 100644
--- a/migration/src/jira2github_import.py
+++ b/migration/src/jira2github_import.py
@@ -57,6 +57,7 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
subtasks = extract_subtasks(o)
pull_requests = extract_pull_requests(o)
jira_labels = extract_labels(o)
+ resolution = extract_resolution(o)
reporter_gh = account_map.get(reporter_name)
reporter = f"{reporter_dispname} (@{reporter_gh})" if reporter_gh else f"{reporter_dispname}"
@@ -192,6 +193,8 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
logger.error(f"Unknown Component: {c}")
for label in jira_labels:
labels.append(f"legacy-jira-label:{label}")
+ if resolution:
+ labels.append(f"legacy-jira-resolution:{resolution}")
data = {
"issue": {
diff --git a/migration/src/jira_util.py b/migration/src/jira_util.py
index d939f3d9..89841e13 100644
--- a/migration/src/jira_util.py
+++ b/migration/src/jira_util.py
@@ -46,6 +46,13 @@ def extract_environment(o: dict) -> str:
return environment if environment else ""
+def extract_resolution(o: dict) -> Optional[str]:
+ resolution = o.get("fields").get("resolution")
+ if resolution:
+ return resolution.get("name")
+ return None
+
+
def extract_reporter(o: dict) -> tuple[str, str]:
reporter = o.get("fields").get("reporter")
name = reporter.get("name", "") if reporter else ""