From 015a041726a74fcfe9390a4f256ab4ec7545a3c7 Mon Sep 17 00:00:00 2001 From: sidpremkumar Date: Sep 09 2019 18:28:23 +0000 Subject: Adding converter to change github markdown to plaintext --- diff --git a/openshift/containers/sync2jira/Dockerfile b/openshift/containers/sync2jira/Dockerfile index 0fcb245..10fda44 100644 --- a/openshift/containers/sync2jira/Dockerfile +++ b/openshift/containers/sync2jira/Dockerfile @@ -15,6 +15,7 @@ RUN dnf -y install \ python3-fedmsg-core \ python3-pygithub \ python3-jinja2 \ + python3-pypandoc \ && dnf -y clean all ARG SYNC2JIRA_GIT_REPO=https://pagure.io/sync-to-jira diff --git a/requirements.txt b/requirements.txt index b8059ef..e2e8291 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,6 @@ jira requests fedmsg PyGithub +pypandoc urllib3 jinja2 \ No newline at end of file diff --git a/sync2jira/downstream.py b/sync2jira/downstream.py index f6eaac5..3095214 100644 --- a/sync2jira/downstream.py +++ b/sync2jira/downstream.py @@ -27,6 +27,7 @@ import jira.client from jira import JIRAError from datetime import datetime import jinja2 +import pypandoc from sync2jira.intermediary import Issue from sync2jira.mailer import send_mail @@ -1056,6 +1057,9 @@ def sync_with_jira(issue, config): log.warning(' The JIRA server looks like its down. Shutting down...') raise JIRAError + if issue.source == 'github' and issue.content: + issue.content = pypandoc.convert_text(issue.content, 'plain', format='md') + # First, check to see if we have a matching issue using the new method. # If we do, then just bail out. No sync needed. log.info(" Looking for matching downstream issue via new method.")