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/27 14:15:27 UTC

[lucene-jira-archive] 01/01: skip error-causing jira labels

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

tomoko pushed a commit to branch skip-errorcausing-labels
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git

commit e462adf29b502a43ba556f0b536e2abe03b91f13
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Wed Jul 27 23:15:14 2022 +0900

    skip error-causing jira labels
---
 migration/src/jira2github_import.py | 30 +++++-------------------------
 1 file changed, 5 insertions(+), 25 deletions(-)

diff --git a/migration/src/jira2github_import.py b/migration/src/jira2github_import.py
index 63b82db5..cbd7737c 100644
--- a/migration/src/jira2github_import.py
+++ b/migration/src/jira2github_import.py
@@ -205,31 +205,11 @@ def convert_issue(num: int, dump_dir: Path, output_dir: Path, account_map: dict[
         for label in jira_labels:
             # GitHub does not allow commas in labels
             label = label.replace(",","")
-            # several label texts have to be tweaked; otherwise import fails. don't know why.
-            # split tokens with '-'
-            if label == "queryparser":
-                label = "query-parser"
-            if label == "fastvectorhighlighter":
-                label = "fast-vector-highlighter"
-            # capitalize
-            if label == "highlighter":
-                label = "Highlighter"
-            if label.startswith("java"):
-                label = re.sub(r"^java", "Java", label)
-            # uncapitalize
-            if label == "Documentation":
-                label = "documentation"
-            if label == "Sort":
-                label = "sort"
-            if label == "Highlighting":
-                label = "highlighting"
-            if label == "Stemmer":
-                label = "stemmer"
-            if label == "Scorer":
-                label = "scorer"
-            # truncate
-            if label == "spatialrecursiveprefixtreefieldtype":
-                label = "spatialrecursiveprefixtree"
+            # several label texts have to be skipped; otherwise import fails. don't know why.
+            if label in ["queryparser", "fastvectorhighlighter", "highlighter", "Documentation", "Sort", "Highlighting", "Stemmer", "Scorer", "spatialrecursiveprefixtreefieldtype"] or \
+                label.startswith("java"):
+                logger.warning(f"Jira label '{label}' was skipped for {jira_id}. Please manually attach it from GitHub Web GUI.")
+                continue
             labels.append(f"legacy-jira-label:{label}")
         if resolution:
             labels.append(f"legacy-jira-resolution:{resolution}")