You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2022/07/25 12:43:55 UTC

[lucene-jira-archive] branch priority_and_votes created (now 2c629c8d)

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

mikemccand pushed a change to branch priority_and_votes
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git


      at 2c629c8d 61: map Jira priority to legacy-jira-priority, and include votes in the 'Legacy Jira Information' header when it's > 0

This branch includes the following new commits:

     new 2c629c8d 61: map Jira priority to legacy-jira-priority, and include votes in the 'Legacy Jira Information' header when it's > 0

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: 61: map Jira priority to legacy-jira-priority, and include votes in the 'Legacy Jira Information' header when it's > 0

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

mikemccand pushed a commit to branch priority_and_votes
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git

commit 2c629c8dc153f01af65068f137fdc2f9cc87aa1e
Author: Mike McCandless <mi...@apache.org>
AuthorDate: Mon Jul 25 08:43:45 2022 -0400

    61: map Jira priority to legacy-jira-priority, and include votes in the 'Legacy Jira Information' header when it's > 0
---
 migration/src/jira2github_import.py | 11 ++++++++++-
 migration/src/jira_util.py          | 16 ++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/migration/src/jira2github_import.py b/migration/src/jira2github_import.py
index eefc59e2..eaea4201 100644
--- a/migration/src/jira2github_import.py
+++ b/migration/src/jira2github_import.py
@@ -58,7 +58,9 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
         pull_requests = extract_pull_requests(o)
         jira_labels = extract_labels(o)
         resolution = extract_resolution(o)
-
+        priority = extract_priority(o)
+        vote_count = extract_vote_count(o)
+            
         reporter_gh = account_map.get(reporter_name)
         reporter = f"{reporter_dispname} (@{reporter_gh})" if reporter_gh else f"{reporter_dispname}"
         assignee_gh = account_map.get(assignee_name)
@@ -103,6 +105,11 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
 
 [{jira_id}]({jira_issue_url(jira_id)}) by {reporter} on {created_datetime.strftime('%b %d %Y')}"""
 
+        if vote_count:
+            body += f", {vote_count} vote"
+            if vote_count > 1:
+                body += 's'
+            
         if resolutiondate_datetime is not None:
             body += f", resolved {resolutiondate_datetime.strftime('%b %d %Y')}"
         elif created_datetime.date() != updated_datetime.date():
@@ -195,6 +202,8 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
             labels.append(f"legacy-jira-label:{label}")
         if resolution:
             labels.append(f"legacy-jira-resolution:{resolution}")
+        if priority:
+            labels.append(f"legacy-jira-priority:{priority}")
 
         data = {
             "issue": {
diff --git a/migration/src/jira_util.py b/migration/src/jira_util.py
index 89841e13..551f7773 100644
--- a/migration/src/jira_util.py
+++ b/migration/src/jira_util.py
@@ -53,6 +53,22 @@ def extract_resolution(o: dict) -> Optional[str]:
     return None
 
 
+def extract_priority(o: dict) -> Optional[str]:
+    priority = o.get("fields").get("priority")
+    if priority:
+        return priority.get("name")
+    return None
+
+
+def extract_vote_count(o: dict) -> Optional[str]:
+    votes = o.get("fields").get("votes")
+    if votes:
+        vote_count = votes.get("votes")
+        if vote_count > 0:
+            return vote_count
+    return None
+
+
 def extract_reporter(o: dict) -> tuple[str, str]:
     reporter = o.get("fields").get("reporter")
     name = reporter.get("name", "") if reporter else ""