#82 Removing date from comments, and removing hours from status
Closed 4 years ago by sidpremkumar. Opened 4 years ago by sidpremkumar.
sidpremkumar/sync-to-jira removing-date-from-comments-and-status  into  develop

file modified
+3 -5
@@ -51,11 +51,9 @@ 

      Returns:

          Response (str): Comments formatted

      """

-     pretty_date = comment['date_created'].strftime("%a %b %d - %-I:%M%p")

- 

+     pretty_date = comment['date_created'].strftime("%a %b %d")

      return "[%s] Upstream, %s wrote [%s]:\n\n{quote}\n%s\n{quote}" % (

-         comment['id'], comment['author'],

-         pretty_date, comment['body'])

+         comment['id'], pretty_date, comment['author'], comment['body'])

  

  

  def _comment_format_legacy(comment):
@@ -652,7 +650,7 @@ 

      # Format the status

      today = datetime.today()

      formatted_status = "[%s] Upstream issue status: %s" % (

-         today.strftime("%a %b %y - %H:%M"), issue.status)

+         today.strftime("%a %b %y"), issue.status)

      new_description = existing.fields.description

      # Check if the issue has the issue status line

      if "] Upstream issue status:" in existing.fields.description:

file modified
+3 -3
@@ -551,7 +551,7 @@ 

          )

  

          # Assert all calls were made correctly

-         self.mock_today.strftime.assert_called_with("%a %b %y - %H:%M")

+         self.mock_today.strftime.assert_called_with("%a %b %y")

          self.mock_downstream.update.assert_called_with({'description': '[mock_today] Upstream issue status: Closed\n'})

          mock_client.transitions.assert_called_with(self.mock_downstream)

          mock_client.transition_issue.asert_called_with(self.mock_downstream, 1234)
@@ -580,7 +580,7 @@ 

          )

  

          # Assert all calls were made correctly

-         self.mock_today.strftime.assert_called_with("%a %b %y - %H:%M")

+         self.mock_today.strftime.assert_called_with("%a %b %y")

          self.mock_downstream.update.assert_called_with({'description': '[mock_today] Upstream issue status: Closed\n'})

          mock_client.transitions.assert_called_with(self.mock_downstream)

          mock_client.transition_issue.asert_called_with(self.mock_downstream, 1234)
@@ -607,7 +607,7 @@ 

          )

  

          # Assert all calls were made correctly

-         self.mock_today.strftime.assert_called_with("%a %b %y - %H:%M")

+         self.mock_today.strftime.assert_called_with("%a %b %y")

          self.mock_downstream.update.assert_called_with({'description': '[mock_today] Upstream issue status: Closed'})

          mock_client.transitions.assert_called_with(self.mock_downstream)

          mock_client.transition_issue.asert_called_with(self.mock_downstream, 1234)

Comment times were sporadic and unreliable on Pagure. Makes more sense to remove the hour and leave the date.

Furthermore depending on where you're located (global team) makes more sense to look at 'Last updated' on JIRA rather than having the hour/min on the upstream status.

rebased onto a1895cc

4 years ago

Pull-Request has been closed by sidpremkumar

4 years ago