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:41:19 UTC

[lucene-jira-archive] branch port-resolution-as-label created (now 6687da46)

This is an automated email from the ASF dual-hosted git repository.

tomoko pushed a change to branch port-resolution-as-label
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git


      at 6687da46 port 'Resolution' as a label

This branch includes the following new commits:

     new 6687da46 port 'Resolution' as a label

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[lucene-jira-archive] 01/01: port 'Resolution' as a label

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomoko pushed a commit to branch port-resolution-as-label
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git

commit 6687da46ad38e6e8c5eb452a7fec50135ba7ef1c
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Sun Jul 24 19:41:10 2022 +0900

    port 'Resolution' as a label
---
 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 ""