From 670aa40a3a1afec624ba42e276f275658f6a59c2 Mon Sep 17 00:00:00 2001 From: sidpremkumar Date: Nov 04 2019 15:31:36 +0000 Subject: Add diff log to update_description function --- diff --git a/sync2jira/downstream.py b/sync2jira/downstream.py index 647898c..595bf87 100644 --- a/sync2jira/downstream.py +++ b/sync2jira/downstream.py @@ -21,6 +21,7 @@ import operator import logging import re +import difflib import arrow import jira.client @@ -1052,6 +1053,15 @@ def _update_description(existing, issue): # Now we can update the JIRA issue if we need to if new_description != existing.fields.description: + # This logging is temporary and will be used to debug an + # issue regarding phantom updates + # Get the diff between new_description and existing + diff = difflib.unified_diff(existing.fields.description, new_description) + log.info(f" DEBUG: Issue {issue.title}") + log.info(f" DEBUG: Diff: {''.join(diff)}") + log.info(f" DEBUG: Old: {existing.fields.description}") + log.info(f" DEBUG: New: {new_description}") + data = {'description': new_description} existing.update(data) log.info(' Updated description')