#108 Remove converting markdown by default, now optional flag that needs to be placed in the updates array
Merged 4 years ago by sidpremkumar. Opened 4 years ago by sidpremkumar.
sidpremkumar/sync-to-jira github-markdown-converter-optional  into  develop

file modified
+2 -1
@@ -45,7 +45,8 @@ 

      {'transition': True/'CUSTOM_TRANSITION'} :: Sync status (open/closed), Sync only status/

                                                  Attempt to transition JIRA ticket to

                                                  CUSTOM_TRANSITION on upstream closure

-     'labels: ['tag1'..] :: Optional field to have custom set labels on all downstream issues created.

+     'labels': ['tag1'..] :: Optional field to have custom set labels on all downstream issues created.

+     'github_markdown' :: If description syncing is turned on, this flag will convert Github markdown to plaintext.

  

  Note: Overwrite set to True will ensure that upstream issue fields will clear downstream

  issue fields, overwrite set to False will never delete downstream issue fields only append.

file modified
+5 -1
@@ -87,7 +87,11 @@ 

          * Sync title

      * :code:`{'transition': True/'CUSTOM_TRANSITION'}` 

          * Sync status (open/closed), Sync only status/Attempt to transition JIRA ticket to CUSTOM_TRANSITION on upstream closure

-     

+     * :code:`labels': ['tag1'..]`

+         * Optional field to have custom set labels on all downstream issues created.

+     * :code:`github_markdown`

+         * If description syncing is turned on, this flag will convert Github markdown to plaintext. This uses the pypandoc module.

+ 

      .. note:: 

          

          :Overwrite: Setting this to :code:`True` will ensure that Upstream (GitHub or Pagure) values will overwrite downstream ones (i.e. if its empty upstream it'll be empty downstream)

file modified
+2 -2
@@ -1059,8 +1059,8 @@ 

      if not config['sync2jira']['develop'] and not check_jira_status(client):

          log.warning('   The JIRA server looks like its down. Shutting down...')

          raise JIRAError

- 

-     if issue.source == 'github' and issue.content:

+     if issue.source == 'github' and issue.content and \

+             'github_markdown' in issue.downstream['updates']:

          issue.content = pypandoc.convert_text(issue.content, 'plain', format='md')

  

      # First, check to see if we have a matching issue using the new method.

Updated code to ensure that only individuals that opt-in will get their GitHub markdown converted to plaintext.

Also updated readme and docs accordingly.

Pull-Request has been merged by sidpremkumar

4 years ago